Compute Library
 19.08
CLDeconvolutionLayerUpsample Class Reference

Basic function to execute deconvolution upsample on OpenCL. More...

#include <CLDeconvolutionLayerUpsample.h>

Collaboration diagram for CLDeconvolutionLayerUpsample:
[legend]

Public Member Functions

 CLDeconvolutionLayerUpsample ()
 Default constructor. More...
 
 CLDeconvolutionLayerUpsample (const CLDeconvolutionLayerUpsample &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLDeconvolutionLayerUpsampleoperator= (const CLDeconvolutionLayerUpsample &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLDeconvolutionLayerUpsample (CLDeconvolutionLayerUpsample &&)=default
 Allow instances of this class to be moved. More...
 
CLDeconvolutionLayerUpsampleoperator= (CLDeconvolutionLayerUpsample &&)=default
 Allow instances of this class to be moved. More...
 
virtual ~CLDeconvolutionLayerUpsample ()=default
 Default destructor. More...
 
void configure (ICLTensor *input, ICLTensor *output, const PadStrideInfo &info)
 Initialize the function's source, destination, interpolation type and border_mode. 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 PadStrideInfo &info)
 Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayerUpsample. More...
 

Detailed Description

Basic function to execute deconvolution upsample on OpenCL.

This function calls the following OpenCL kernels and functions:

  1. CLMemsetKernel
  2. CLDeconvolutionLayerUpsampleKernel

Definition at line 46 of file CLDeconvolutionLayerUpsample.h.

Constructor & Destructor Documentation

◆ CLDeconvolutionLayerUpsample() [1/3]

Default constructor.

Definition at line 32 of file CLDeconvolutionLayerUpsample.cpp.

33  : _upsample(),
34  _memset(),
35  _output(nullptr)
36 {
37 }

◆ CLDeconvolutionLayerUpsample() [2/3]

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

◆ CLDeconvolutionLayerUpsample() [3/3]

Allow instances of this class to be moved.

◆ ~CLDeconvolutionLayerUpsample()

virtual ~CLDeconvolutionLayerUpsample ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input,
ICLTensor output,
const PadStrideInfo info 
)

Initialize the function's source, destination, interpolation type and border_mode.

Parameters
[in,out]inputSource tensor. Data type supported: QASYMM8/F16/F32.
[out]outputDestination tensor. Data type supported: same as input.
[in]infoContains padding and policies to be used in the deconvolution.

Definition at line 44 of file CLDeconvolutionLayerUpsample.cpp.

45 {
46  ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
47 
48  _output = output;
49  _memset.configure(_output, PixelValue(0, _output->info()->data_type(), _output->info()->quantization_info()));
50  _upsample.configure(input, _output, info);
51 }
virtual DataType data_type() const =0
Data type used for each element of the tensor.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void configure(const ICLTensor *input, ICLTensor *output, const PadStrideInfo &info)
Initialise the kernel's input and output.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
void configure(ICLTensor *tensor, const PixelValue &constant_value, Window *window=nullptr)
Initialise the kernel's tensor and filling value.

References ARM_COMPUTE_ERROR_ON_NULLPTR, CLDeconvolutionLayerUpsampleKernel::configure(), CLMemsetKernel::configure(), ITensorInfo::data_type(), ITensor::info(), arm_compute::test::validation::info, and ITensorInfo::quantization_info().

Referenced by CLDirectDeconvolutionLayer::configure().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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 53 of file CLDeconvolutionLayerUpsample.cpp.

54 {
55  CLScheduler::get().enqueue(_memset, false);
56  CLScheduler::get().enqueue(_upsample, true);
57 }
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().

Referenced by CLDirectDeconvolutionLayer::run().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const PadStrideInfo info 
)
static

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

Parameters
[in]inputSource tensor info. Data type supported: QASYMM8/F16/F32.
[in]outputDestination tensor info. Data type supported: same as input.
[in]infoContains padding and policies to be used in the deconvolution.
Returns
a status

Definition at line 39 of file CLDeconvolutionLayerUpsample.cpp.

40 {
42 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PadStrideInfo &info)
Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayerUpsa...

References arm_compute::test::validation::info, and CLDeconvolutionLayerUpsampleKernel::validate().

Referenced by CLDirectDeconvolutionLayer::validate().


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