43 struct MeanStdDevNormSelectorData
51 struct MeanStdDevNormKernel
58 static const MeanStdDevNormKernel available_kernels[] =
61 "fp32_neon_meanstddevnorm",
62 [](
const MeanStdDevNormSelectorData & data) {
return data.dt ==
DataType::F32; },
65 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 67 "fp16_neon_meanstddevnorm",
68 [](
const MeanStdDevNormSelectorData & data) {
return data.dt ==
DataType::F16; },
71 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 80 const MeanStdDevNormKernel *get_implementation(
const MeanStdDevNormSelectorData &data)
82 for(
const auto &uk : available_kernels)
84 if(uk.is_selected(data))
101 if((output !=
nullptr) && (output->total_size() != 0))
111 if(output !=
nullptr)
122 return std::make_pair(Status{}, win);
127 : _input(nullptr), _output(nullptr), _epsilon(1e-8f)
138 _output = (output ==
nullptr) ? input : output;
144 ICPPKernel::configure(win_config.second);
160 const auto *uk = get_implementation(MeanStdDevNormSelectorData{ _output->
info()->
data_type() });
163 uk->ukernel(_input, _output, _epsilon, window);
void neon_fp32_meanstddevnorm(ITensor *input, ITensor *output, float epsilon, const Window &window)
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.
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
NEMeanStdDevNormalizationKernel()
Default constructor.
#define REGISTER_FP16_NEON(func_name)
MeanStdDevNormUKernelPtr ukernel
#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
#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)
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
decltype(strategy::transforms) typedef type
Interface for CPU tensor.
Copyright (c) 2017-2022 Arm Limited.
1 channel, 1 F16 per channel
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
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...
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
static Status validate(const ITensorInfo *input, const ITensorInfo *output=nullptr, float epsilon=1e-8f)
Static function to check if given info will lead to a valid configuration of NEMeanStdDevNormalizatio...
const MeanStdDevNormSelctorPtr is_selected
void configure(ITensor *input, ITensor *output=nullptr, float epsilon=1e-8f)
Initialise the kernel's input and outputs.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
void neon_fp16_meanstddevnorm(ITensor *input, ITensor *output, float epsilon, const Window &window)
Information about executing thread and CPU.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
#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(...)
Includes all wrapper headers at once.
DataType
Available data types.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)