48 struct ElementwiseUnaryKernel
55 static const ElementwiseUnaryKernel available_kernels[] =
57 #if defined(__ARM_FEATURE_SVE) 59 "fp32_sve_elementwise_unary",
64 "fp16_sve_elementwise_unary",
69 "s32_sve_elementwise_unary",
73 #endif // defined(__ARM_FEATURE_SVE) 75 "fp32_neon_elementwise_unary",
79 #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) 81 "fp16_neon_elementwise_unary",
85 #endif // defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) 87 "s32_neon_elementwise_unary",
93 const ElementwiseUnaryKernel *get_implementation(
DataType dt)
95 for(
const auto &uk : available_kernels)
97 if(uk.is_selected(dt))
117 const TensorShape &out_shape = broadcast_pair.first;
127 ICpuKernel::configure(win);
134 const auto *uk = get_implementation(input.
data_type());
170 auto func = get_implementation(
src->info()->data_type())->
ukernel;
const ElementwiseUnarySelector is_selected
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
CpuElementwiseUnaryKernel()
Default constructor.
const Window & window() const
The maximum window the kernel can be executed on.
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
#define REGISTER_FP32_NEON(func_name)
virtual DataType data_type() const =0
Data type used for each element of the tensor.
CpuElementwiseUnaryKernel::ElementwiseUnaryUkernelPtr ukernel
1 channel, 1 F32 per channel
#define REGISTER_FP32_SVE(func_name)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
const ValidRegion valid_region
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
static std::pair< TensorShape, ValidRegion > broadcast_shape_and_valid_region(const Infos &... infos)
If infos are broadcast compatible tensor info's, return the broadcasted shape and the intersection of...
decltype(strategy::transforms) typedef type
static Status validate(ElementWiseUnary op, const ITensorInfo &input, const ITensorInfo &output)
Static function to check if given info will lead to a valid configuration of CpuElementwiseUnaryKerne...
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define REGISTER_INTEGER_NEON(func_name)
1 channel, 1 S32 per channel
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
#define REGISTER_INTEGER_SVE(func_name)
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...
void configure(ElementWiseUnary op, const ITensorInfo &input, ITensorInfo &output)
Function to configure the CpuElementwiseUnaryKernel.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
std::add_pointer< void(const ITensor *, ITensor *, const Window &, ElementWiseUnary)>::type ElementwiseUnaryUkernelPtr
Common signature for all the specialised elementwise unary micro-kernels.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
Information about executing thread and CPU.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
#define REGISTER_FP16_SVE(func_name)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Container for valid region of a window.
DataType
Available data types.
ElementWiseUnary
Available element wise unary operations.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)