42 struct SubSelectorData
57 static const SubKernel available_kernels[] =
61 [](
const SubSelectorData & data) {
return (data.dt ==
DataType::F32); },
64 #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) 67 [](
const SubSelectorData & data) {
return (data.dt ==
DataType::F16); },
73 [](
const SubSelectorData & data) {
return (data.dt ==
DataType::U8); },
78 [](
const SubSelectorData & data) {
return (data.dt ==
DataType::S16); },
83 [](
const SubSelectorData & data) {
return (data.dt ==
DataType::S32); },
109 const SubKernel *get_implementation(
DataType dt)
111 for(
const auto &uk : available_kernels)
113 if(uk.is_selected({ dt }))
121 inline Status validate_arguments(
const ITensorInfo &src0,
const ITensorInfo &src1,
const ITensorInfo &
dst,
ConvertPolicy policy)
129 const auto *uk = get_implementation(src0.data_type());
136 "Convert policy cannot be WRAP if datatype is quantized");
139 if(dst.total_size() > 0)
143 "Wrong shape for dst");
160 const auto *uk = get_implementation(src0->
data_type());
164 _run_method = uk->ukernel;
165 _name = std::string(
"CpuSubKernel").append(
"/").append(uk->name);
170 ICpuKernel::configure(win);
192 _run_method(src0, src1, dst, _policy, window);
197 return _name.c_str();
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
const SubSelectorPtr is_selected
quantized, symmetric fixed-point 16-bit number
bool set_data_type_if_unknown(ITensorInfo &info, DataType data_type)
Set the data type and number of channels to the specified value if the current data type is unknown...
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
#define REGISTER_FP16_NEON(func_name)
1 channel, 1 U8 per channel
#define REGISTER_FP32_NEON(func_name)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
1 channel, 1 F32 per channel
static TensorShape broadcast_shape(const Shapes &... shapes)
If shapes are broadcast compatible, return the broadcasted shape.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
#define REGISTER_QASYMM8_SIGNED_NEON(func_name)
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
static Status validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, ConvertPolicy policy)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
decltype(strategy::transforms) typedef type
Interface for CPU tensor.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define REGISTER_INTEGER_NEON(func_name)
const char * name() const override
Name of the kernel.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
1 channel, 1 S32 per channel
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
#define REGISTER_QASYMM8_NEON(func_name)
void configure(const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, ConvertPolicy policy)
Initialise the kernel's src and dst.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
quantized, asymmetric fixed-point 8-bit number unsigned
Class to describe a number of elements in each dimension.
#define REGISTER_QSYMM16_NEON(func_name)
bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape)
Set the shape to the specified value if the current assignment is empty.
bool have_different_dimensions(const Dimensions< T > &dim1, const Dimensions< T > &dim2, unsigned int upper_dim)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
1 channel, 1 S16 per channel
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
void sub_qasymm8_signed_neon(const ITensor *src0, const ITensor *src1, ITensor *dst, const ConvertPolicy &policy, const Window &window)
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.
void sub_qsymm16_neon(const ITensor *src0, const ITensor *src1, ITensor *dst, const ConvertPolicy &policy, const Window &window)
Information about executing thread and CPU.
void sub_qasymm8_neon(const ITensor *src0, const ITensor *src1, ITensor *dst, const ConvertPolicy &policy, const Window &window)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
quantized, asymmetric fixed-point 8-bit number signed
DataType
Available data types.
Describe a multidimensional execution window.
ConvertPolicy
Policy to handle overflow.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)