Compute Library
 24.07
CLPooling3dLayer Class Reference

Basic function to run opencl::ClPool3d. More...

#include <CLPooling3dLayer.h>

Collaboration diagram for CLPooling3dLayer:
[legend]

Public Member Functions

 CLPooling3dLayer ()
 Default Constructor. More...
 
 ~CLPooling3dLayer ()
 Default Destructor. More...
 
 CLPooling3dLayer (const CLPooling3dLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLPooling3dLayer (CLPooling3dLayer &&)=default
 Default move constructor. More...
 
CLPooling3dLayeroperator= (const CLPooling3dLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLPooling3dLayeroperator= (CLPooling3dLayer &&)=default
 Default move assignment operator. More...
 
void configure (const ICLTensor *input, ICLTensor *output, const Pooling3dLayerInfo &pool_info)
 Set the input and output tensors. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, const Pooling3dLayerInfo &pool_info)
 Set the input and output tensors. More...
 
void run () override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, const Pooling3dLayerInfo &pool_info)
 Static function to check if given info will lead to a valid configuration of CLPooling3dLayer. More...
 

Detailed Description

Basic function to run opencl::ClPool3d.

Definition at line 39 of file CLPooling3dLayer.h.

Constructor & Destructor Documentation

◆ CLPooling3dLayer() [1/3]

Default Constructor.

Definition at line 42 of file CLPooling3dLayer.cpp.

42  : _impl(std::make_unique<Impl>())
43 {
44 }

◆ ~CLPooling3dLayer()

~CLPooling3dLayer ( )
default

Default Destructor.

◆ CLPooling3dLayer() [2/3]

CLPooling3dLayer ( const CLPooling3dLayer )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLPooling3dLayer() [3/3]

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output,
const Pooling3dLayerInfo pool_info 
)

Set the input and output tensors.

Parameters
[in]compile_contextThe compile context to be used.
[in,out]inputSource tensor. Data types supported: F16/F32/QASYMM8/QASYMM8_SIGNED.
[out]outputDestination tensor. Data types supported: Same as input.
[in]pool_infoContains 3d pooling operation information described in Pooling3dLayerInfo.

Definition at line 52 of file CLPooling3dLayer.cpp.

56 {
57  _impl->src = input;
58  _impl->dst = output;
59 
60  _impl->op = std::make_unique<opencl::ClPool3d>();
61  _impl->op->configure(compile_context, input->info(), output->info(), pool_info);
62 }

References ITensor::info(), and arm_compute::test::validation::input.

◆ configure() [2/2]

void configure ( const ICLTensor input,
ICLTensor output,
const Pooling3dLayerInfo pool_info 
)

Set the input and output tensors.

Valid data layouts:

  • NDHWC

Valid data type configurations:

src dst
F16 F16
F32 F32
QASYMM8 QASYMM8
QASYMM8_SIGNED QASYMM8_SIGNED
Note
Source tensor is padded with -inf for MAX pooling and 0 otherwise Cases where pooling region is completely outside input tensor are not supported
Asymmetric padding is not supported when dimension rounding type == CEIL.
Parameters
[in,out]inputSource tensor. Data types supported: F16/F32/QASYMM8/QASYMM8_SIGNED.
[out]outputDestination tensor. Data types supported: Same as input.
[in]pool_infoContains 3d pooling operation information described in Pooling3dLayerInfo.

Definition at line 47 of file CLPooling3dLayer.cpp.

48 {
49  configure(CLKernelLibrary::get().get_compile_context(), input, output, pool_info);
50 }

References CLKernelLibrary::get(), and arm_compute::test::validation::input.

◆ operator=() [1/2]

CLPooling3dLayer& operator= ( CLPooling3dLayer &&  )
default

Default move assignment operator.

◆ operator=() [2/2]

CLPooling3dLayer& operator= ( const CLPooling3dLayer )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For CPU kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 70 of file CLPooling3dLayer.cpp.

71 {
72  ITensorPack pack;
73  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
75  _impl->op->run(pack);
76 }

References arm_compute::ACL_DST_0, arm_compute::ACL_SRC, ITensorPack::add_tensor(), and arm_compute::test::validation::pack.

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const Pooling3dLayerInfo pool_info 
)
static

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

Parameters
[in]inputSource tensor info. Data types supported: F16/F32/QASYMM8/QASYMM8_SIGNED.
[in]outputDestination tensor info. Data types supported: Same as input.
[in]pool_infoContains 3d pooling operation information described in Pooling3dLayerInfo.
Returns
a status

Definition at line 65 of file CLPooling3dLayer.cpp.

66 {
67  return opencl::ClPool3d::validate(input, output, pool_info);
68 }

References arm_compute::test::validation::input, and ClPool3d::validate().


The documentation for this class was generated from the following files:
arm_compute::ITensorPack::add_tensor
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
Definition: ITensorPack.cpp:38
arm_compute::CLKernelLibrary::get
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Definition: CLKernelLibrary.cpp:41
arm_compute::CLPooling3dLayer::configure
void configure(const ICLTensor *input, ICLTensor *output, const Pooling3dLayerInfo &pool_info)
Set the input and output tensors.
Definition: CLPooling3dLayer.cpp:47
arm_compute::opencl::ClPool3d::validate
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const Pooling3dLayerInfo &info)
Static function to check if given info will lead to a valid configuration.
Definition: ClPool3d.cpp:54
arm_compute::ACL_DST_0
@ ACL_DST_0
Definition: Types.h:56
arm_compute::test::validation::pack
ITensorPack pack
Definition: Im2Col.cpp:204
arm_compute::ACL_SRC
@ ACL_SRC
Definition: Types.h:44
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486