Compute Library
 21.02
CpuSub Class Reference

Basic function to run kernels::CpuSubKernel. More...

#include <CpuSub.h>

Collaboration diagram for CpuSub:
[legend]

Public Member Functions

void configure (const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Initialise the kernel's inputs, dst and conversion policy. More...
 
- Public Member Functions inherited from INEOperator
 INEOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 INEOperator (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INEOperator (INEOperator &&)=default
 Default move constructor. More...
 
INEOperatoroperator= (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INEOperatoroperator= (INEOperator &&)=default
 Default move assignment operator. More...
 
 ~INEOperator ()
 Default destructor. 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 *src0, const ITensorInfo *src1, const ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Static function to check if given info will lead to a valid configuration of CpuSub. More...
 

Detailed Description

Basic function to run kernels::CpuSubKernel.

Definition at line 34 of file CpuSub.h.

Member Function Documentation

◆ configure()

void configure ( const ITensorInfo src0,
const ITensorInfo src1,
ITensorInfo dst,
ConvertPolicy  policy,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)

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

Valid configurations (src0,src1) -> dst :

  • (U8,U8) -> U8
  • (U8,U8) -> S16
  • (QASYMM8, QASYMM8) -> QASYMM8
  • (QASYMM8_SIGNED, QASYMM8_SIGNED) -> QASYMM8_SIGNED
  • (S16,U8) -> S16
  • (U8,S16) -> S16
  • (S16,S16) -> S16
  • (S32,S32) -> S32
  • (F16,F16) -> F16
  • (F32,F32) -> F32
Parameters
[in]src0First tensor input info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32
[in]src1Second tensor input info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32
[out]dstOutput tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32
[in]policyPolicy to use to handle overflow. Convert policy cannot be WRAP if datatype is quantized.
[in]act_info(Optional) Activation layer information in case of a fused activation. Currently not supported.

Definition at line 32 of file CpuSub.cpp.

References ARM_COMPUTE_UNUSED.

33 {
34  ARM_COMPUTE_UNUSED(act_info);
35  auto k = std::make_unique<kernels::CpuSubKernel>();
36  k->configure(src0, src1, dst, policy);
37  _kernel = std::move(k);
38 }
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152

◆ validate()

Status validate ( const ITensorInfo src0,
const ITensorInfo src1,
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 CpuSub.

Valid configurations (src0,src1) -> dst :

  • (U8,U8) -> U8
  • (U8,U8) -> S16
  • (QASYMM8, QASYMM8) -> QASYMM8
  • (QASYMM8_SIGNED, QASYMM8_SIGNED) -> QASYMM8_SIGNED
  • (S16,U8) -> S16
  • (U8,S16) -> S16
  • (S16,S16) -> S16
  • (S32,S32) -> S32
  • (F16,F16) -> F16
  • (F32,F32) -> F32
Parameters
[in]src0First tensor input. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/S32/F16/F32
[in]src1Second tensor input. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/S32/F16/F32
[in]dstOutput tensor. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/S32/F16/F32
[in]policyPolicy to use to handle overflow. Convert policy cannot be WRAP if datatype is quantized.
[in]act_info(Optional) Activation layer information in case of a fused activation. Currently not supported.
Returns
a status

Definition at line 40 of file CpuSub.cpp.

References ARM_COMPUTE_RETURN_ERROR_ON, ActivationLayerInfo::enabled(), and CpuSubKernel::validate().

Referenced by NEArithmeticSubtraction::validate().

41 {
42  ARM_COMPUTE_RETURN_ERROR_ON(act_info.enabled());
43  return kernels::CpuSubKernel::validate(src0, src1, dst, policy);
44 }
static Status validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, ConvertPolicy policy)
Static function to check if given info will lead to a valid configuration of CpuSubKernel.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Definition: Error.h:296

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