24.02.1
|
Go to the documentation of this file.
43 using namespace misc::shape_calculator;
47 static const std::vector<CpuMaxUnpoolingLayerKernel::MaxUnpoolingKernel> available_kernels = {
48 {
"neon_fp32_maxunpooling", [](
const DataTypeISASelectorData &data) {
return data.dt ==
DataType::F32; },
50 {
"neon_fp16_maxunpooling",
51 [](
const DataTypeISASelectorData &data) {
return data.dt ==
DataType::F16 && data.isa.fp16; },
53 {
"neon_qu8_maxunpooling", [](
const DataTypeISASelectorData &data) {
return data.dt ==
DataType::QASYMM8; },
60 const ITensorInfo *indices,
61 const ITensorInfo *
dst,
62 const PoolingLayerInfo &pool_info)
71 int pool_stride_x = 0;
72 int pool_stride_y = 0;
74 const PadStrideInfo pad_stride_info = pool_info.pad_stride_info;
75 std::tie(pool_stride_x, pool_stride_y) = pad_stride_info.stride();
76 const int pool_size_x = pool_info.pool_size.width;
77 const int pool_size_y = pool_info.pool_size.height;
78 const Size2D pool_size(pool_size_x, pool_size_y);
81 "Pooling indices only supported for MAX pooling method");
83 if (
dst->total_size() != 0)
105 _run_method = uk->ukernel;
111 ICpuKernel::configure(window);
134 _run_method(
src, indices,
dst, window);
139 return "CpuMaxUnpoolingLayerKernel";
144 return available_kernels;
Class to describe a number of elements in each dimension.
SimpleTensor< float > src
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
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(...)
#define REGISTER_QASYMM8_SIGNED_NEON(func_name)
static CPUInfo & get()
Access the KernelLibrary singleton.
static const std::vector< MaxUnpoolingKernel > & get_available_kernels()
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
#define REGISTER_FP16_NEON(func_name)
void neon_qs8_maxunpooling(const ITensor *input, const ITensor *indices, ITensor *output, const Window &window)
void neon_qu8_maxunpooling(const ITensor *input, const ITensor *indices, ITensor *output, const Window &window)
#define REGISTER_QASYMM8_NEON(func_name)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
void configure(const ITensorInfo *src, const ITensorInfo *indices, ITensorInfo *dst, const PoolingLayerInfo &pool_info)
Configure kernel for a given list of arguments.
#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(...)
void neon_fp32_maxunpooling(const ITensor *input, const ITensor *indices, ITensor *output, const Window &window)
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
const char * name() const override
Name of the kernel.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
@ U32
unsigned 32-bit number
#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...
Pooling Layer Information struct.
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
TensorShape compute_unpool_shape(const ITensorInfo &input, PoolingLayerInfo pool_info)
Calculate the output unpool shape of a tensor.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
PoolingType
Available pooling types.
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...)
static Status validate(const ITensorInfo *src, const ITensorInfo *indices, const ITensorInfo *dst, const PoolingLayerInfo &pool_info)
Static function to check if given info will lead to a valid configuration of CpuMaxUnpoolingLayerKern...
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
static const auto * get_implementation(const SelectorType &selector, KernelSelectionType selection_type=KernelSelectionType::Supported)
Micro-kernel selector.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
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-2024 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)
void neon_fp16_maxunpooling(const ITensor *input, const ITensor *indices, ITensor *output, const Window &window)