23.08
|
Go to the documentation of this file.
43 struct MeanStdDevNormSelectorData
48 using MeanStdDevNormSelctorPtr = std::add_pointer<bool(
const MeanStdDevNormSelectorData &data)>
::type;
49 using MeanStdDevNormUKernelPtr = std::add_pointer<void(ITensor *
input, ITensor *output,
float epsilon,
const Window &window)>
::type;
51 struct MeanStdDevNormKernel
58 static const std::vector<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
73 "qasymm8_neon_meanstddevnorm",
74 [](
const MeanStdDevNormSelectorData & data) {
return data.dt ==
DataType::QASYMM8; },
85 const MeanStdDevNormKernel *get_implementation(
const MeanStdDevNormSelectorData &data)
87 for(
const auto &uk : available_kernels)
89 if(uk.is_selected(data))
106 if((output !=
nullptr) && (output->total_size() != 0))
116 if(output !=
nullptr)
127 return std::make_pair(Status{}, win);
132 : _input(nullptr), _output(nullptr), _epsilon(1e-8f)
143 _output = (output ==
nullptr) ?
input : output;
149 ICPPKernel::configure(win_config.second);
165 const auto *uk = get_implementation(MeanStdDevNormSelectorData{ _output->
info()->
data_type() });
168 uk->ukernel(_input, _output, _epsilon,
window);
decltype(strategy::transforms) typedef type
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
NEMeanStdDevNormalizationKernel()
Default constructor.
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
void configure(ITensor *input, ITensor *output=nullptr, float epsilon=1e-8f)
Initialise the kernel's input and outputs.
Interface for CPU tensor.
#define REGISTER_FP16_NEON(func_name)
void neon_qasymm8_meanstddevnorm(ITensor *input, ITensor *output, float epsilon, const Window &window)
#define REGISTER_QASYMM8_NEON(func_name)
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,...)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#define REGISTER_FP32_NEON(func_name)
#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.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
MeanStdDevNormUKernelPtr ukernel
void neon_fp16_meanstddevnorm(ITensor *input, ITensor *output, float epsilon, const Window &window)
#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...
const MeanStdDevNormSelctorPtr is_selected
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
#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.
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
Describe a multidimensional execution window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2023 Arm Limited.
@ F16
16-bit floating-point number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
@ F32
32-bit floating-point number
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
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...
void neon_fp32_meanstddevnorm(ITensor *input, ITensor *output, float epsilon, const Window &window)
DataType
Available data types.