Compute Library
 21.11
CpuElementwiseDivision Class Reference

Basic function to run cpu::kernels::CpuArithmeticKernel for division. More...

#include <CpuElementwise.h>

Collaboration diagram for CpuElementwiseDivision:
[legend]

Public Member Functions

void configure (const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst)
 Initialise the kernel's inputs, dst and conversion policy. 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

Basic function to run cpu::kernels::CpuArithmeticKernel for division.

Note
The tensor data type for the inputs must be S32/F16/F32.
The function performs a division operation between two tensors (i.e., out[i] = in1[i] / in2[i])

Definition at line 76 of file CpuElementwise.h.

Member Function Documentation

◆ configure()

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

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

Parameters
[in,out]src0First tensor input info. Data types supported: S32/F16/F32.
[in,out]src1Second tensor input info. Data types supported: Same as src0.
[out]dstOutput tensor info. Data types supported: Same as src0.

Definition at line 68 of file CpuElementwise.cpp.

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

69 {
70  ARM_COMPUTE_LOG_PARAMS(src0, src1, dst);
71  auto k = std::make_unique<kernels::CpuDivisionKernel>();
72  k->configure(src0, src1, dst);
73  _kernel = std::move(k);
74 }
#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 CpuElementwiseDivision::configure()

Returns
a status

Definition at line 76 of file CpuElementwise.cpp.

References CpuDivisionKernel::validate().

Referenced by NEElementwiseDivision::validate().

77 {
78  return kernels::CpuDivisionKernel::validate(src0, src1, dst);
79 }
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.

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