Compute Library
 19.08
CLBatchToSpaceLayer Class Reference

Basic function to run CLBatchToSpaceLayerKernel. More...

#include <CLBatchToSpaceLayer.h>

Collaboration diagram for CLBatchToSpaceLayer:
[legend]

Public Member Functions

 CLBatchToSpaceLayer ()
 Default constructor. More...
 
void configure (const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
 Set the input and output tensors. More...
 
void configure (const ICLTensor *input, int32_t block_shape_x, int32_t block_shape_y, ICLTensor *output)
 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 *block_shape, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayer. More...
 
static Status validate (const ITensorInfo *input, int32_t block_shape_x, int32_t block_shape_y, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayer (Static block shape). More...
 

Detailed Description

Basic function to run CLBatchToSpaceLayerKernel.

Definition at line 37 of file CLBatchToSpaceLayer.h.

Constructor & Destructor Documentation

◆ CLBatchToSpaceLayer()

Default constructor.

Definition at line 35 of file CLBatchToSpaceLayer.cpp.

36  : _batch_to_space_kernel()
37 {
38 }

Member Function Documentation

◆ configure() [1/2]

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

Set the input and output tensors.

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[in]block_shape1-D tensor with shape [M]. Data types supported: S32
[out]outputTensor output. Data types supported: same as input

Definition at line 40 of file CLBatchToSpaceLayer.cpp.

41 {
42  _batch_to_space_kernel.configure(input, block_shape, output);
43 }
void configure(const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
Initialise the kernel's inputs and output.

References CLBatchToSpaceLayerKernel::configure().

◆ configure() [2/2]

void configure ( const ICLTensor input,
int32_t  block_shape_x,
int32_t  block_shape_y,
ICLTensor output 
)

Set the input and output tensors.

(Static block shape).

Parameters
[in]inputTensor input. Supported tensor rank: 4. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[in]block_shape_xBlock shape x value.
[in]block_shape_yBlock shape y value.
[out]outputTensor output. Data types supported: same as input

Definition at line 45 of file CLBatchToSpaceLayer.cpp.

46 {
47  _batch_to_space_kernel.configure(input, block_shape_x, block_shape_y, output);
48 }
void configure(const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output)
Initialise the kernel's inputs and output.

References CLBatchToSpaceLayerKernel::configure().

◆ 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 60 of file CLBatchToSpaceLayer.cpp.

61 {
62  CLScheduler::get().enqueue(_batch_to_space_kernel, true);
63 }
static CLScheduler & get()
Access the scheduler singleton.
Definition: CLScheduler.cpp:41
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
Definition: CLScheduler.cpp:95

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

◆ validate() [1/2]

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

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

Parameters
[in]inputTensor input info. Supported tensor rank: 4. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[in]block_shapeblock shape tensor info with shape [M]. Data types supported: S32
[out]outputTensor output info. Data types supported: same as input
Returns
a status

Definition at line 50 of file CLBatchToSpaceLayer.cpp.

51 {
52  return CLBatchToSpaceLayerKernel::validate(input, block_shape, output);
53 }
static Status validate(const ITensorInfo *input, const ITensorInfo *block_shape, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayerKerne...

References CLBatchToSpaceLayerKernel::validate().

◆ validate() [2/2]

Status validate ( const ITensorInfo input,
int32_t  block_shape_x,
int32_t  block_shape_y,
const ITensorInfo output 
)
static

Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayer (Static block shape).

Parameters
[in]inputTensor input info. Supported tensor rank: 4. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[in]block_shape_xBlock shape x value.
[in]block_shape_yBlock shape y value.
[out]outputTensor output info. Data types supported: same as input
Returns
a status

Definition at line 55 of file CLBatchToSpaceLayer.cpp.

56 {
57  return CLBatchToSpaceLayerKernel::validate(input, block_shape_x, block_shape_y, output);
58 }
static Status validate(const ITensorInfo *input, const ITensorInfo *block_shape, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of CLBatchToSpaceLayerKerne...

References CLBatchToSpaceLayerKernel::validate().


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