Compute Library
 21.05
ClAdd Class Reference

Basic function to run arithmetic addition. More...

#include <ClAdd.h>

Collaboration diagram for ClAdd:
[legend]

Public Member Functions

 ClAdd ()=default
 Default Constructor. More...
 
void configure (const ClCompileContext &compile_context, ITensorInfo *src1, ITensorInfo *src2, ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Configure function for a given list of arguments. More...
 
- Public Member Functions inherited from ICLOperator
 ICLOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLOperator (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLOperator (ICLOperator &&)=default
 Default move constructor. More...
 
ICLOperatoroperator= (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLOperatoroperator= (ICLOperator &&)=default
 Default move assignment operator. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. More...
 
MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from IOperator
virtual ~IOperator ()=default
 Destructor. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Static function to check if given info will lead to a valid configuration of ClAdd. More...
 

Detailed Description

Basic function to run arithmetic addition.

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

Definition at line 39 of file ClAdd.h.

Constructor & Destructor Documentation

◆ ClAdd()

ClAdd ( )
default

Default Constructor.

Member Function Documentation

◆ configure()

void configure ( const ClCompileContext compile_context,
ITensorInfo src1,
ITensorInfo src2,
ITensorInfo dst,
ConvertPolicy  policy,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)

Configure function for a given list of arguments.

Valid configurations (src1,src2) -> dst :

  • (U8,U8) -> U8
  • (U8,U8) -> S16
  • (S16,U8) -> S16
  • (U8,S16) -> S16
  • (S16,S16) -> S16
  • (S32,S32) -> S32
  • (F16,F16) -> F16
  • (F32,F32) -> F32
  • (QASYMM8,QASYMM8) -> QASYMM8
  • (QASYMM8_SIGNED,QASYMM8_SIGNED) -> QASYMM8_SIGNED
  • (QSYMM16,QSYMM16) -> QSYMM16
Parameters
[in]compile_contextThe compile context to be used.
[in,out]src1First source tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32. The source tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[in,out]src2Second source tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32. The source tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[out]dstDestination tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32.
[in]policyPolicy to use to handle overflow.
[in]act_info(Optional) Activation layer information in case of a fused activation.

Definition at line 33 of file ClAdd.cpp.

35 {
36  auto k = std::make_unique<kernels::ClSaturatedArithmeticKernel>();
37  k->configure(compile_context, ArithmeticOperation::ADD, src1, src2, dst, policy, act_info);
38  _kernel = std::move(k);
39 }

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

◆ validate()

Status validate ( const ITensorInfo src1,
const ITensorInfo src2,
const ITensorInfo dst,
ConvertPolicy  policy,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)
static

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

Valid configurations (src1,src2) -> dst :

  • (U8,U8) -> U8
  • (U8,U8) -> S16
  • (S16,U8) -> S16
  • (U8,S16) -> S16
  • (S16,S16) -> S16
  • (S32,S32) -> S32
  • (F16,F16) -> F16
  • (F32,F32) -> F32
  • (QASYMM8,QASYMM8) -> QASYMM8
  • (QASYMM8_SIGNED,QASYMM8_SIGNED) -> QASYMM8_SIGNED
  • (QSYMM16,QSYMM16) -> QSYMM16
Parameters
[in]src1First source tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32.
[in]src2Second source tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32.
[in]dstDestination tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/S32/F16/F32.
[in]policyPolicy to use to handle overflow.
[in]act_info(Optional) Activation layer information in case of a fused activation.
Returns
a status

Definition at line 41 of file ClAdd.cpp.

43 {
45 }
static Status validate(ArithmeticOperation op, const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ConvertPolicy &policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of ClSaturatedArithmeticKer...

References arm_compute::ADD, arm_compute::test::validation::dst, and ClSaturatedArithmeticKernel::validate().

Referenced by CLArithmeticAddition::validate().


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