Compute Library
 21.02
CLSpaceToDepthLayer Class Reference

Basic function to run CLSpaceToDepthLayerKernel. More...

#include <CLSpaceToDepthLayer.h>

Collaboration diagram for CLSpaceToDepthLayer:
[legend]

Public Member Functions

 CLSpaceToDepthLayer ()
 Default constructor. More...
 
 CLSpaceToDepthLayer (const CLSpaceToDepthLayer &)=delete
 Prevent instances of this class from being copied. More...
 
CLSpaceToDepthLayeroperator= (const CLSpaceToDepthLayer &)=delete
 Prevent instances of this class from being copied. More...
 
 CLSpaceToDepthLayer (CLSpaceToDepthLayer &&)=delete
 Prevent instances of this class to be moved. More...
 
CLSpaceToDepthLayeroperator= (CLSpaceToDepthLayer &&)=delete
 Prevent instances of this class to be moved. More...
 
 ~CLSpaceToDepthLayer ()
 Default destructor. More...
 
void configure (const ICLTensor *input, ICLTensor *output, int32_t block_shape)
 Set the input and output tensors. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, int32_t block_shape)
 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, int32_t block_shape)
 Static function to check if given info will lead to a valid configuration of CLSpaceToDepthLayer. More...
 

Detailed Description

Basic function to run CLSpaceToDepthLayerKernel.

Definition at line 40 of file CLSpaceToDepthLayer.h.

Constructor & Destructor Documentation

◆ CLSpaceToDepthLayer() [1/3]

Default constructor.

Definition at line 36 of file CLSpaceToDepthLayer.cpp.

References CLSpaceToDepthLayer::~CLSpaceToDepthLayer().

37  : _space_to_depth_kernel(std::make_unique<CLSpaceToDepthLayerKernel>())
38 {
39 }

◆ CLSpaceToDepthLayer() [2/3]

Prevent instances of this class from being copied.

◆ CLSpaceToDepthLayer() [3/3]

Prevent instances of this class to be moved.

◆ ~CLSpaceToDepthLayer()

~CLSpaceToDepthLayer ( )
default

Default destructor.

Referenced by CLSpaceToDepthLayer::CLSpaceToDepthLayer().

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output,
int32_t  block_shape 
)

Set the input and output tensors.

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[out]outputTensor output. Data types supported: same as input
[in]block_shapeBlock shape value.

Definition at line 43 of file CLSpaceToDepthLayer.cpp.

References CLKernelLibrary::get().

44 {
45  configure(CLKernelLibrary::get().get_compile_context(), input, output, block_shape);
46 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, ICLTensor *output, int32_t block_shape)
Set the input and output tensors.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output,
int32_t  block_shape 
)

Set the input and output tensors.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputTensor input. Supported tensor rank: 4. Data types supported: All.
[out]outputTensor output. Data types supported: same as input
[in]block_shapeBlock shape value.

Definition at line 48 of file CLSpaceToDepthLayer.cpp.

49 {
50  _space_to_depth_kernel->configure(compile_context, input, output, block_shape);
51 }

◆ operator=() [1/2]

CLSpaceToDepthLayer& operator= ( const CLSpaceToDepthLayer )
delete

Prevent instances of this class from being copied.

◆ operator=() [2/2]

CLSpaceToDepthLayer& operator= ( CLSpaceToDepthLayer &&  )
delete

Prevent instances of this class to be moved.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon 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 58 of file CLSpaceToDepthLayer.cpp.

References CLScheduler::enqueue(), and CLScheduler::get().

59 {
60  CLScheduler::get().enqueue(*_space_to_depth_kernel, true);
61 }
static CLScheduler & get()
Access the scheduler singleton.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
int32_t  block_shape 
)
static

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

Parameters
[in]inputTensor input info. Supported tensor rank: 4. Data types supported: All.
[in]outputTensor output info. Data types supported: same as input
[in]block_shapeBlock shape value.
Returns
a status

Definition at line 53 of file CLSpaceToDepthLayer.cpp.

References CLSpaceToDepthLayerKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

54 {
55  return CLSpaceToDepthLayerKernel::validate(input, output, block_shape);
56 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, int32_t block_shape)
Static function to check if given info will lead to a valid configuration of CLSpaceToDepthLayerKerne...

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