Compute Library
 22.08
CpuPool3d Class Reference

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

#include <CpuPool3d.h>

Collaboration diagram for CpuPool3d:
[legend]

Public Member Functions

 CpuPool3d ()
 
 ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (CpuPool3d)
 
 ~CpuPool3d ()
 
void configure (const ITensorInfo *src, ITensorInfo *dst, const Pooling3dLayerInfo &pool_info)
 Set the src and dst tensors. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
experimental::MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from INEOperator
 INEOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 INEOperator (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INEOperator (INEOperator &&)=default
 Default move constructor. More...
 
INEOperatoroperator= (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INEOperatoroperator= (INEOperator &&)=default
 Default move assignment operator. More...
 
 ~INEOperator ()
 Default destructor. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. 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 Pooling3dLayerInfo &pool_info)
 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 kernels:

  1. kernels::CpuPool3dKernel

Definition at line 41 of file CpuPool3d.h.

Constructor & Destructor Documentation

◆ CpuPool3d()

CpuPool3d ( )

Definition at line 38 of file CpuPool3d.cpp.

39  : _aux_mem(1)
40 {
41 }

◆ ~CpuPool3d()

~CpuPool3d ( )
default

Member Function Documentation

◆ ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE()

ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE ( CpuPool3d  )

◆ configure()

void configure ( const ITensorInfo src,
ITensorInfo dst,
const Pooling3dLayerInfo pool_info 
)

Set the src and dst tensors.

Parameters
[in]srcSource tensor info. Data types supported: F16/F32/QASYMM8/QASYMM8_SIGNED.
[out]dstDestination tensor info. Data types supported: same as src.
[in]pool_infoContains pooling operation information described in Pooling3dLayerInfo.

Definition at line 45 of file CpuPool3d.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

46 {
47  ARM_COMPUTE_LOG_PARAMS(src, dst, pool_info);
48 
49  // Configure pooling kernel
50  auto k = std::make_unique<kernels::CpuPool3dKernel>();
51  k->configure(src, dst, pool_info);
52  _kernel = std::move(k);
53 }
SimpleTensor< float > src
Definition: DFT.cpp:155
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ run()

void run ( ITensorPack tensors)
overridevirtual

Run the kernels contained in the function.

Parameters
[in]tensorsVector that contains the tensors to operate on.

Reimplemented from INEOperator.

Definition at line 60 of file CpuPool3d.cpp.

References ARM_COMPUTE_ERROR_ON_MSG, Window::DimY, ITensorPack::empty(), Scheduler::get(), and IScheduler::schedule_op().

61 {
62  ARM_COMPUTE_ERROR_ON_MSG(tensors.empty(), "No tensors provided");
63 
64  Scheduler::get().schedule_op(_kernel.get(), Window::DimY, _kernel->window(), tensors);
65 }
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_MSG(cond, msg)
Definition: Error.h:456
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst,
const Pooling3dLayerInfo pool_info 
)
static

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

Similar to CpuPool3d::configure()

Returns
a status

Definition at line 55 of file CpuPool3d.cpp.

References CpuPool3dKernel::validate().

Referenced by NEPooling3dLayer::validate().

56 {
57  return kernels::CpuPool3dKernel::validate(src, dst, pool_info);
58 }
SimpleTensor< float > src
Definition: DFT.cpp:155
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.

◆ workspace()

experimental::MemoryRequirements workspace ( ) const
overridevirtual

Return the memory requirements required by the workspace.

Reimplemented from INEOperator.

Definition at line 67 of file CpuPool3d.cpp.

68 {
69  return _aux_mem;
70 }

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