39 CpuPool2d::CpuPool2d()
40 : _pooling_layer_kernel(),
43 _is_global_pooling_layer(false),
69 auto pooling_wrapper = std::make_unique<kernels::CpuPool2dAssemblyWrapperKernel>();
71 pooling_wrapper->configure(src, dst, pool_info, ci);
74 constexpr
size_t alignment = 4096;
75 const size_t workspace_size = pooling_wrapper->get_working_size(num_threads);
78 _asm_glue = std::move(pooling_wrapper);
83 auto k = std::make_unique<kernels::CpuPool2dKernel>();
84 k->configure(src, dst, pool_info, indices);
85 _pooling_layer_kernel = std::move(k);
93 PixelValue zero_value((indices) ? std::numeric_limits<int>::min() : 0.f);
98 auto b = std::make_unique<NEFillBorderKernel>();
99 b->configure(src, _pooling_layer_kernel->border_size(), border_mode, zero_value);
100 _border_handler = std::move(b);
BorderMode
Methods available to handle borders.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &pool_info, const ITensorInfo *indices=nullptr)
Static function to check if given info will lead to a valid configuration.
Class describing the value of a pixel for any image format.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
bool empty() const
Checks if pack is empty.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
#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.
CPUInfo & cpu_info()
Get CPU info.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
size_t height
Height of the image region or rectangle.
std::vector< MemoryInfo > MemoryRequirements
experimental::MemoryRequirements workspace() const override
Return the memory requirements required by the workspace.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &pool_info, const ITensorInfo *indices=nullptr)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
Pooling Layer Information struct.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
Num samples, channels, height, width.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
size_t width
Width of the image region or rectangle.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Pixels outside the image are assumed to have the same value as the closest image pixel.
Num samples, height, width, channels.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &info)
Static function to check if given info will lead to a valid configuration.
virtual unsigned int num_threads() const =0
Returns the number of threads that the SingleThreadScheduler has in his pool.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
DataLayout
[DataLayout enum definition]
void configure(ITensorInfo *src, ITensorInfo *dst, const PoolingLayerInfo &pool_info, ITensorInfo *indices=nullptr)
Set the src and dst tensors.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
static IScheduler & get()
Access the scheduler singleton.