Compute Library
 21.02
NESpaceToDepthLayer Class Reference

This function calls the following Neon kernels/functions: More...

#include <NESpaceToDepthLayer.h>

Collaboration diagram for NESpaceToDepthLayer:
[legend]

Public Member Functions

 NESpaceToDepthLayer ()
 Default constructor. More...
 
 NESpaceToDepthLayer (const NESpaceToDepthLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NESpaceToDepthLayeroperator= (const NESpaceToDepthLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NESpaceToDepthLayer (NESpaceToDepthLayer &&)=default
 Allow instances of this class to be moved. More...
 
NESpaceToDepthLayeroperator= (NESpaceToDepthLayer &&)=default
 Allow instances of this class to be moved. More...
 
 ~NESpaceToDepthLayer ()
 Default destructor. More...
 
void configure (const ITensor *input, ITensor *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 NESpaceToDepthLayer (Static block shape and paddings) More...
 

Detailed Description

This function calls the following Neon kernels/functions:

  1. NESpaceToDepthLayerKernel

Definition at line 42 of file NESpaceToDepthLayer.h.

Constructor & Destructor Documentation

◆ NESpaceToDepthLayer() [1/3]

Default constructor.

Definition at line 38 of file NESpaceToDepthLayer.cpp.

39  : _space_to_depth_kernel()
40 {
41 }

◆ NESpaceToDepthLayer() [2/3]

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

◆ NESpaceToDepthLayer() [3/3]

Allow instances of this class to be moved.

◆ ~NESpaceToDepthLayer()

~NESpaceToDepthLayer ( )
default

Default destructor.

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor 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 NESpaceToDepthLayer.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR.

44 {
46  _space_to_depth_kernel = std::make_unique<NESpaceToDepthLayerKernel>();
47  _space_to_depth_kernel->configure(input, output, block_shape);
48 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NESpaceToDepthLayer& operator= ( const NESpaceToDepthLayer )
delete

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

◆ operator=() [2/2]

NESpaceToDepthLayer& operator= ( NESpaceToDepthLayer &&  )
default

Allow 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 56 of file NESpaceToDepthLayer.cpp.

References Window::DimY, Scheduler::get(), and IScheduler::schedule().

57 {
58  NEScheduler::get().schedule(_space_to_depth_kernel.get(), Window::DimY);
59 }
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94

◆ 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 NESpaceToDepthLayer (Static block shape and paddings)

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 50 of file NESpaceToDepthLayer.cpp.

References ARM_COMPUTE_RETURN_ON_ERROR, and NESpaceToDepthLayerKernel::validate().

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

51 {
53  return Status{};
54 }
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 NESpaceToDepthLayerKerne...
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204

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