Compute Library
 21.05
CLDequantizationLayer Class Reference

Basic function to run opencl::ClDequantization that dequantizes an input tensor. More...

#include <CLDequantizationLayer.h>

Collaboration diagram for CLDequantizationLayer:
[legend]

Public Member Functions

 CLDequantizationLayer ()
 Default Constructor. More...
 
 ~CLDequantizationLayer ()
 Default Destructor. More...
 
 CLDequantizationLayer (const CLDequantizationLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLDequantizationLayer (CLDequantizationLayer &&)=default
 Default move constructor. More...
 
CLDequantizationLayeroperator= (const CLDequantizationLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLDequantizationLayeroperator= (CLDequantizationLayer &&)=default
 Default move assignment operator. More...
 
void configure (const ICLTensor *input, ICLTensor *output)
 Set the input and output tensors. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, 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 *output)
 Static function to check if given info will lead to a valid configuration of CLDequantizationLayer. More...
 

Detailed Description

Basic function to run opencl::ClDequantization that dequantizes an input tensor.

Definition at line 40 of file CLDequantizationLayer.h.

Constructor & Destructor Documentation

◆ CLDequantizationLayer() [1/3]

Default Constructor.

Definition at line 41 of file CLDequantizationLayer.cpp.

42  : _impl(std::make_unique<Impl>())
43 {
44 }

◆ ~CLDequantizationLayer()

~CLDequantizationLayer ( )
default

Default Destructor.

◆ CLDequantizationLayer() [2/3]

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

◆ CLDequantizationLayer() [3/3]

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output 
)

Set the input and output tensors.

Valid data layouts:

  • All

Valid data type configurations:

src dst
QASYMM8 F16, F32
QASYMM8_SIGNED F16, F32
QSYMM8_PER_CHANNEL F16, F32
QSYMM8 F16, F32
QSYMM16 F16, F32
Parameters
[in]inputSource tensor with at least 3 dimensions. The dimensions over the third will be interpreted as batches. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/QSYMM8/QSYMM16.
[out]outputDestination tensor with the same dimensions of input. Data type supported: F16/F32.

Definition at line 47 of file CLDequantizationLayer.cpp.

48 {
49  configure(CLKernelLibrary::get().get_compile_context(), input, output);
50 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, ICLTensor *output)
Set the input and output tensors.

References CLKernelLibrary::get(), and arm_compute::test::validation::input.

Referenced by CLReduceMean::configure(), and CLLSTMLayerQuantized::configure().

◆ configure() [2/2]

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

Set the input and output tensors.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor with at least 3 dimensions. The dimensions over the third will be interpreted as batches. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/QSYMM8/QSYMM16.
[out]outputDestination tensor with the same dimensions of input. Data type supported: F16/F32.

Definition at line 52 of file CLDequantizationLayer.cpp.

53 {
54  _impl->src = input;
55  _impl->dst = output;
56 
57  _impl->op = std::make_unique<opencl::ClDequantization>();
58  _impl->op->configure(compile_context, input->info(), output->info());
59 }

References ITensor::info(), and arm_compute::test::validation::input.

◆ operator=() [1/2]

CLDequantizationLayer& operator= ( const CLDequantizationLayer )
delete

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

◆ operator=() [2/2]

CLDequantizationLayer& operator= ( CLDequantizationLayer &&  )
default

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For CPU 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 66 of file CLDequantizationLayer.cpp.

67 {
68  ITensorPack pack;
69  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
70  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
71  _impl->op->run(pack);
72 }

References arm_compute::ACL_DST, arm_compute::ACL_SRC, and ITensorPack::add_tensor().

Referenced by CLReduceMean::run(), and CLLSTMLayerQuantized::run().

◆ validate()

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

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

Parameters
[in]inputInput tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/QSYMM8/QSYMM16.
[in]outputOutput tensor info. Data type supported: F16/F32.
Returns
a status

Definition at line 61 of file CLDequantizationLayer.cpp.

62 {
64 }
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration of CLDequantizationLayer.

References arm_compute::test::validation::input, and ClDequantization::validate().

Referenced by CLGenerateProposalsLayer::validate(), and CLLSTMLayerQuantized::validate().


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