24.02.1
|
Go to the documentation of this file.
49 struct SelectKernelSelectorData
55 using SelectorPtr = std::add_pointer<bool(
const SelectKernelSelectorData &data)>
::type;
57 std::add_pointer<void(
const ITensor *,
const ITensor *,
const ITensor *, ITensor *,
const Window &)>
::type;
59 struct SelectKernelSelector
66 static const SelectKernelSelector available_kernels[] = {
68 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S8 && data.is_same_rank ==
true; },
70 {
"neon_s16_same_rank",
71 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S16 && data.is_same_rank ==
true; },
73 {
"neon_s32_same_rank",
74 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S32 && data.is_same_rank ==
true; },
77 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U8 && data.is_same_rank ==
true; },
79 {
"neon_u16_same_rank",
80 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U16 && data.is_same_rank ==
true; },
82 {
"neon_u32_same_rank",
83 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U32 && data.is_same_rank ==
true; },
85 {
"neon_s8_not_same_rank",
86 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S8 && data.is_same_rank ==
false; },
88 {
"neon_s16_not_same_rank",
89 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S16 && data.is_same_rank ==
false; },
91 {
"neon_s32_not_same_rank",
92 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::S32 && data.is_same_rank ==
false; },
94 {
"neon_u8_not_same_rank",
95 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U8 && data.is_same_rank ==
false; },
97 {
"neon_u16_not_same_rank",
98 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U16 && data.is_same_rank ==
false; },
100 {
"neon_u32_not_same_rank",
101 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::U32 && data.is_same_rank ==
false; },
103 {
"neon_f16_same_rank",
104 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::F16 && data.is_same_rank ==
true; },
106 {
"neon_f16_not_same_rank",
107 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::F16 && data.is_same_rank ==
false; },
109 {
"neon_f32_same_rank",
110 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::F32 && data.is_same_rank ==
true; },
112 {
"neon_f32_not_same_rank",
113 [](
const SelectKernelSelectorData &data) {
return data.dt ==
DataType::F32 && data.is_same_rank ==
false; },
117 const SelectKernelSelector *get_implementation(
const SelectKernelSelectorData &data)
119 for (
const auto &uk : available_kernels)
121 if (uk.is_selected(data))
132 : _c(nullptr), _x(nullptr), _y(nullptr), _output(nullptr), _has_same_rank(false)
151 INEKernel::configure(win);
170 if (output !=
nullptr && output->
total_size() != 0)
187 const auto *uk = get_implementation(SelectKernelSelectorData{_output->
info()->
data_type(), _has_same_rank});
190 uk->ukernel(_c, _x, _y, _output,
window);
void neon_f16_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
decltype(strategy::transforms) typedef type
void neon_f32_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ U16
unsigned 16-bit number
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
void neon_s32_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
void neon_s8_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
void neon_s16_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
Interface for CPU tensor.
#define REGISTER_FP16_NEON(func_name)
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Includes all wrapper headers at once.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
void neon_u8_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
void neon_u16_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
#define REGISTER_FP32_NEON(func_name)
void neon_s32_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
void neon_u8_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void neon_s16_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
#define ARM_COMPUTE_ERROR_THROW_ON(status)
@ U32
unsigned 32-bit number
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
@ U8
unsigned 8-bit number
@ S16
signed 16-bit number
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
#define REGISTER_INTEGER_NEON(func_name)
virtual DataType data_type() const =0
Data type used for each element of the tensor.
T x() const
Alias to access the size of the first dimension.
static Status validate(const ITensorInfo *c, const ITensorInfo *x, const ITensorInfo *y, const ITensorInfo *output)
Validate the argument passed to the kernel.
void neon_u32_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
void neon_f32_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
void configure(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output)
Common signature for all the specialised elementwise functions.
Describe a multidimensional execution window.
void neon_u16_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
@ S32
signed 32-bit number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
const SelectorPtr is_selected
Store the tensor's metadata.
@ F32
32-bit floating-point number
void neon_s8_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
NESelectKernel()
Default constructor.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
void neon_f16_select_not_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
DataType
Available data types.
void neon_u32_select_same_rank(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)