Compute Library
 19.08
CLArithmeticAddition Class Reference

Basic function to run CLSaturatedArithmeticOperationKernel for addition. More...

#include <CLElementwiseOperations.h>

Collaboration diagram for CLArithmeticAddition:
[legend]

Public Member Functions

void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy)
 Initialise the kernel's inputs, output and conversion policy. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction ()
 Default constructor. More...
 
void run () override final
 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 *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy)
 Static function to check if given info will lead to a valid configuration of CLSaturatedArithmeticOperationKernel for addition. More...
 

Detailed Description

Basic function to run CLSaturatedArithmeticOperationKernel for addition.

Note
The tensor data type for the inputs must be U8/QASYMM8/S16/QSYMM16/S32/U32/F16/F32.
The function performs an arithmetic addition between two tensors.

Definition at line 39 of file CLElementwiseOperations.h.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input1,
ICLTensor input2,
ICLTensor output,
ConvertPolicy  policy 
)

Initialise the kernel's inputs, output and conversion policy.

Parameters
[in,out]input1First tensor input. Data types supported: U8/QASYMM8/S16/QSYMM16/S32/U32/F16/F32. The input tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[in,out]input2Second tensor input. Data types supported: U8, QASYMM8 (only if input1 is QASYMM8), QSYMM16 (only if input1 is QSYMM16), S16/F16/F32. The input tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[out]outputOutput tensor. Data types supported: U8 (Only if both inputs are U8), QASYMM8 (only if both inputs are QASYMM8), QSYMM16 (only if both inputs is QSYMM16), S16/F16/F32.
[in]policyPolicy to use to handle overflow.

Definition at line 50 of file CLElementwiseOperations.cpp.

51 {
52  auto k = arm_compute::support::cpp14::make_unique<CLSaturatedArithmeticOperationKernel>();
53  k->configure(ArithmeticOperation::ADD, input1, input2, output, policy);
54  _kernel = std::move(k);
55  configure_border_handler(_border_handler, _kernel->border_size(), input1, input2, output);
56 }

References arm_compute::ADD, and arm_compute::test::validation::policy.

Referenced by CLFFTConvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), CLLSTMLayer::configure(), and arm_compute::test::validation::DATA_TEST_CASE().

◆ validate()

Status validate ( const ITensorInfo input1,
const ITensorInfo input2,
const ITensorInfo output,
ConvertPolicy  policy 
)
static

Static function to check if given info will lead to a valid configuration of CLSaturatedArithmeticOperationKernel for addition.

Parameters
[in]input1First tensor input info. Data types supported: U8/QASYMM8/S16/QSYMM16/S32/U32/F16/F32.
[in]input2Second tensor input info. Data types supported: U8, QASYMM8 (only if input1 is QASYMM8), QSYMM16 (only if input1 is QSYMM16), S16/F16/F32.
[in]outputOutput tensor info. Data types supported: U8 (Only if both inputs are U8), QASYMM8 (only if both inputs are QASYMM8), QSYMM16 (only if both inputs is QSYMM16), S16/F16/F32.
[in]policyPolicy to use to handle overflow.
Returns
a status

Definition at line 58 of file CLElementwiseOperations.cpp.

59 {
61 }
static Status validate(ArithmeticOperation op, const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ConvertPolicy &policy)
Static function to check if given info will lead to a valid configuration of CLSaturatedArithmeticOpe...

References arm_compute::ADD, arm_compute::test::validation::policy, and CLSaturatedArithmeticOperationKernel::validate().

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


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