Compute Library
 19.08
CLUpsampleLayer Class Reference

Basic function to run CLUpsampleLayerKernel. More...

#include <CLUpsampleLayer.h>

Collaboration diagram for CLUpsampleLayer:
[legend]

Public Member Functions

 CLUpsampleLayer ()
 Default constructor. More...
 
 CLUpsampleLayer (const CLUpsampleLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLUpsampleLayeroperator= (const CLUpsampleLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLUpsampleLayer (CLUpsampleLayer &&)=default
 Allow instances of this class to be moved. More...
 
CLUpsampleLayeroperator= (CLUpsampleLayer &&)=default
 Allow instances of this class to be moved. More...
 
virtual ~CLUpsampleLayer ()=default
 Default destructor. More...
 
void configure (ICLTensor *input, ICLTensor *output, const Size2D &info, const InterpolationPolicy upsampling_policy)
 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 Size2D &info, const InterpolationPolicy upsampling_policy)
 Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayerUpsample. More...
 

Detailed Description

Basic function to run CLUpsampleLayerKernel.

Definition at line 38 of file CLUpsampleLayer.h.

Constructor & Destructor Documentation

◆ CLUpsampleLayer() [1/3]

Default constructor.

Definition at line 32 of file CLUpsampleLayer.cpp.

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

◆ CLUpsampleLayer() [2/3]

CLUpsampleLayer ( const CLUpsampleLayer )
delete

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

◆ CLUpsampleLayer() [3/3]

CLUpsampleLayer ( CLUpsampleLayer &&  )
default

Allow instances of this class to be moved.

◆ ~CLUpsampleLayer()

virtual ~CLUpsampleLayer ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input,
ICLTensor output,
const Size2D info,
const InterpolationPolicy  upsampling_policy 
)

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

Parameters
[in]inputSource tensor. Data type supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[out]outputDestination tensor. Data types supported: same as input.
[in]infoContains stride information described in Size2D.
[in]upsampling_policyDefines the policy to fill the intermediate pixels.

Definition at line 44 of file CLUpsampleLayer.cpp.

46 {
47  ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
48 
49  _output = output;
50  _upsample.configure(input, _output, info, upsampling_policy);
51 }
void configure(const ICLTensor *input, ICLTensor *output, const Size2D &info, const InterpolationPolicy upsampling_policy)
Initialise the kernel's input and output.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

References ARM_COMPUTE_ERROR_ON_NULLPTR, CLUpsampleLayerKernel::configure(), and arm_compute::test::validation::info.

◆ operator=() [1/2]

CLUpsampleLayer& operator= ( const CLUpsampleLayer )
delete

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

◆ operator=() [2/2]

CLUpsampleLayer& operator= ( CLUpsampleLayer &&  )
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 53 of file CLUpsampleLayer.cpp.

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

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const Size2D info,
const InterpolationPolicy  upsampling_policy 
)
static

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

Parameters
[in]inputSource tensor info. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32.
[in]outputDestination tensor info. Data types supported: same as input.
[in]infoContains stride information described in Size2D.
[in]upsampling_policyDefines the policy to fill the intermediate pixels.
Returns
a status

Definition at line 38 of file CLUpsampleLayer.cpp.

40 {
41  return CLUpsampleLayerKernel::validate(input, output, info, upsampling_policy);
42 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &info, const InterpolationPolicy upsampling_policy)
Static function to check if given info will lead to a valid configuration of CLUpsampleLayerKernel.

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


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