Compute Library
 22.05
ClPool2d Class Reference

Basic function to simulate a pooling layer with the specified pooling operation. More...

#include <ClPool2d.h>

Collaboration diagram for ClPool2d:
[legend]

Public Member Functions

 ClPool2d ()=default
 Constructor. More...
 
void configure (const ClCompileContext &compile_context, ITensorInfo *src, ITensorInfo *dst, const PoolingLayerInfo &info, ITensorInfo *indices=nullptr)
 Configure operator for a given list of arguments. More...
 
- Public Member Functions inherited from ICLOperator
 ICLOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLOperator (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLOperator (ICLOperator &&)=default
 Default move constructor. More...
 
ICLOperatoroperator= (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLOperatoroperator= (ICLOperator &&)=default
 Default move assignment operator. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. More...
 
MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from IOperator
virtual ~IOperator ()=default
 Destructor. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &info, const ITensorInfo *indices=nullptr)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to simulate a pooling layer with the specified pooling operation.

This function calls the following OpenCL kernels:

  1. opencl::ClPool2d

Definition at line 40 of file ClPool2d.h.

Constructor & Destructor Documentation

◆ ClPool2d()

ClPool2d ( )
default

Constructor.

Member Function Documentation

◆ configure()

void configure ( const ClCompileContext compile_context,
ITensorInfo src,
ITensorInfo dst,
const PoolingLayerInfo info,
ITensorInfo indices = nullptr 
)

Configure operator for a given list of arguments.

Parameters
[in]compile_contextThe compile context to be used.
[in]srcSource tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
[out]dstDestination tensor info. Data type supported: same as src
[in]infoPooling layer parameters.
[out]indices(optional) The indices info of the maximal values. Data type supported: U32.

Definition at line 37 of file ClPool2d.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, CLScheduler::get(), arm_compute::test::validation::k, and CLScheduler::tune_kernel_static().

38 {
40  ARM_COMPUTE_LOG_PARAMS(src, dst, info, indices);
41 
42  // Configure pooling kernel
43  auto k = std::make_unique<kernels::ClPool2dKernel>();
44  k->set_target(CLScheduler::get().target());
45  k->configure(compile_context, src, dst, info, indices);
46  _kernel = std::move(k);
47 
48  // Tune kernels
50 }
static CLScheduler & get()
Access the scheduler singleton.
SimpleTensor< float > src
Definition: DFT.cpp:155
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
#define ARM_COMPUTE_LOG_PARAMS(...)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157
void tune_kernel_static(ICLKernel &kernel)
Tunes OpenCL kernel.
Definition: CLScheduler.cpp:86

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst,
const PoolingLayerInfo info,
const ITensorInfo indices = nullptr 
)
static

Static function to check if given info will lead to a valid configuration.

Similar to ClPool2d::configure()

Returns
a status

Definition at line 52 of file ClPool2d.cpp.

References ClPool2dKernel::validate().

Referenced by CLPoolingLayer::validate().

53 {
54  return kernels::ClPool2dKernel::validate(src, dst, info, indices);
55 }
SimpleTensor< float > src
Definition: DFT.cpp:155
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.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

The documentation for this class was generated from the following files: