24.02.1
|
Go to the documentation of this file.
40 CpuPool2d::CpuPool2d()
41 : _pooling_layer_kernel(),
43 _is_global_pooling_layer(false),
44 _use_kernel_indices(false),
57 const bool run_optimised =
75 auto pooling_wrapper = std::make_unique<kernels::CpuPool2dAssemblyWrapperKernel>();
77 pooling_wrapper->configure(
src,
dst, pool_info,
ci);
80 constexpr
size_t alignment = 4096;
81 const size_t workspace_size = pooling_wrapper->get_working_size(num_threads);
84 _asm_glue = std::move(pooling_wrapper);
89 auto k = std::make_unique<kernels::CpuPool2dKernel>();
90 k->configure(
src,
dst, pool_info, indices);
91 _pooling_layer_kernel = std::move(k);
100 const bool run_optimised =
122 switch (_data_layout)
127 _pooling_layer_kernel->window(), tensors);
132 _pooling_layer_kernel->window(), tensors);
@ NCHW
Num samples, channels, height, width.
void configure(ITensorInfo *src, ITensorInfo *dst, const PoolingLayerInfo &pool_info, ITensorInfo *indices=nullptr)
Set the src and dst tensors.
std::vector< MemoryInfo > MemoryRequirements
SimpleTensor< float > src
DataLayout
[DataLayout enum definition]
@ NHWC
Num samples, height, width, channels.
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.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
CPUInfo & cpu_info()
Get CPU info.
size_t height
Height of the image region or rectangle.
experimental::MemoryRequirements workspace() const override
Return the memory requirements required by the workspace.
bool empty() const
Checks if pack is empty.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
size_t width
Width of the image region or rectangle.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
static IScheduler & get()
Access the scheduler singleton.
Pooling Layer Information struct.
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.
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.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Copyright (c) 2017-2024 Arm Limited.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
virtual unsigned int num_threads() const =0
Returns the number of threads that the SingleThreadScheduler has in its pool.
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
#define ARM_COMPUTE_LOG_PARAMS(...)
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.