Compute Library
 24.07
NEPooling3dLayer Class Reference

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

#include <NEPooling3dLayer.h>

Collaboration diagram for NEPooling3dLayer:
[legend]

Public Member Functions

 NEPooling3dLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr)
 Constructor. More...
 
 NEPooling3dLayer (const NEPooling3dLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEPooling3dLayeroperator= (const NEPooling3dLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEPooling3dLayer (NEPooling3dLayer &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
NEPooling3dLayeroperator= (NEPooling3dLayer &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
 ~NEPooling3dLayer ()
 Default destructor. More...
 
void configure (const ITensor *input, ITensor *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 NEPooling3dLayer. More...
 

Detailed Description

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

This function calls the following kernels:

  1. cpu::CpuPool3d

Definition at line 42 of file NEPooling3dLayer.h.

Constructor & Destructor Documentation

◆ NEPooling3dLayer() [1/3]

NEPooling3dLayer ( std::shared_ptr< IMemoryManager memory_manager = nullptr)

Constructor.

Definition at line 47 of file NEPooling3dLayer.cpp.

47  : _impl(std::make_unique<Impl>())
48 {
49  _impl->memory_group = MemoryGroup(std::move(memory_manager));
50 }

◆ NEPooling3dLayer() [2/3]

NEPooling3dLayer ( const NEPooling3dLayer )
delete

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

◆ NEPooling3dLayer() [3/3]

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ ~NEPooling3dLayer()

~NEPooling3dLayer ( )
default

Default destructor.

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor 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
Parameters
[in]inputSource tensor. Data types supported: F16/F32/QASYMM8/QASYMM8_SIGNED.
[out]outputDestination tensor.
[in]pool_infoContains pooling operation information described in Pooling3dLayerInfo.

Definition at line 52 of file NEPooling3dLayer.cpp.

53 {
54  _impl->src = input;
55  _impl->dst = output;
56  _impl->op = std::make_unique<cpu::CpuPool3d>();
57  _impl->op->configure(input->info(), output->info(), pool_info);
58 
59  _impl->run_pack = {{TensorType::ACL_SRC, _impl->src}, {TensorType::ACL_DST_0, _impl->dst}};
60  _impl->workspace_tensors = manage_workspace<Tensor>(_impl->op->workspace(), _impl->memory_group, _impl->run_pack);
61 }

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

◆ operator=() [1/2]

NEPooling3dLayer& operator= ( const NEPooling3dLayer )
delete

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

◆ operator=() [2/2]

NEPooling3dLayer& operator= ( NEPooling3dLayer &&  )
delete

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ 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 69 of file NEPooling3dLayer.cpp.

70 {
71  MemoryGroupResourceScope scope_mg(_impl->memory_group);
72  ARM_COMPUTE_ERROR_ON_NULLPTR(_impl->src, _impl->dst);
73  _impl->op->run(_impl->run_pack);
74 }

References ARM_COMPUTE_ERROR_ON_NULLPTR.

◆ 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 NEPooling3dLayer.

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

Definition at line 64 of file NEPooling3dLayer.cpp.

65 {
66  return cpu::CpuPool3d::validate(input, output, pool_info);
67 }

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


The documentation for this class was generated from the following files:
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:159
arm_compute::ACL_DST_0
@ ACL_DST_0
Definition: Types.h:56
arm_compute::cpu::CpuPool3d::validate
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const Pooling3dLayerInfo &pool_info)
Static function to check if given info will lead to a valid configuration.
Definition: CpuPool3d.cpp:55
arm_compute::ACL_SRC
@ ACL_SRC
Definition: Types.h:44
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486