40 CpuPool2d::CpuPool2d()
41 : _pooling_layer_kernel(),
43 _is_global_pooling_layer(false),
71 auto pooling_wrapper = std::make_unique<kernels::CpuPool2dAssemblyWrapperKernel>();
73 pooling_wrapper->configure(src, dst, pool_info, ci);
76 constexpr
size_t alignment = 4096;
77 const size_t workspace_size = pooling_wrapper->get_working_size(num_threads);
80 _asm_glue = std::move(pooling_wrapper);
85 auto k = std::make_unique<kernels::CpuPool2dKernel>();
86 k->configure(src, dst, pool_info, indices);
87 _pooling_layer_kernel = std::move(
k);
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.
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 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.
Num samples, channels, height, width.
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.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Num samples, height, width, channels.
#define ARM_COMPUTE_LOG_PARAMS(...)
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 its pool.
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.