Compute Library
 21.11
CpuElementwiseArithmetic< op > Class Template Reference

Class to run cpu::kernels::CpuArithmeticKernel except for division and power. More...

#include <CpuElementwise.h>

Collaboration diagram for CpuElementwiseArithmetic< op >:
[legend]

Public Member Functions

void configure (const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst)
 Configure the operator. More...
 
- Public Member Functions inherited from CpuElementwiseBase
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. 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 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)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

template<ArithmeticOperation op>
class arm_compute::cpu::CpuElementwiseArithmetic< op >

Class to run cpu::kernels::CpuArithmeticKernel except for division and power.

Note
Max/Min/Squared difference supports input data type of QASYMM8/QASYMM8_SIGNED/S16/F16/S32/F32
PRelu supports inpute data type of QASYMM8/QASYMM8_SIGNED/F16/F32.

Definition at line 45 of file CpuElementwise.h.

Member Function Documentation

◆ configure()

void configure ( const ITensorInfo src0,
const ITensorInfo src1,
ITensorInfo dst 
)

Configure the operator.

Parameters
[in]src0The first source tensor information.
[in]src1The second source tensor information. With PRelu, this is used as alpha tensor.
[out]dstThe output tensor information.

Definition at line 49 of file CpuElementwise.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

50 {
51  ARM_COMPUTE_LOG_PARAMS(src0, src1, dst);
52  auto k = std::make_unique<kernels::CpuArithmeticKernel>();
53  k->configure(op, src0, src1, dst);
54  _kernel = std::move(k);
55 }
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo src0,
const ITensorInfo src1,
const ITensorInfo dst 
)
static

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

Similar to CpuElementwiseArithmetic::configure()

Returns
a status

Definition at line 58 of file CpuElementwise.cpp.

References CpuArithmeticKernel::validate().

Referenced by NEElementwiseMax::validate(), NEElementwiseMin::validate(), and NEElementwiseSquaredDiff::validate().

59 {
60  return kernels::CpuArithmeticKernel::validate(op, src0, src1, dst);
61 }
static Status validate(ArithmeticOperation op, const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.

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