Compute Library
 21.05
INEOperator Class Reference

Basic interface for functions which have a single async CPU kernel. More...

#include <INEOperator.h>

Collaboration diagram for INEOperator:
[legend]

Public Member Functions

 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...
 

Detailed Description

Basic interface for functions which have a single async CPU kernel.

Definition at line 43 of file INEOperator.h.

Constructor & Destructor Documentation

◆ INEOperator() [1/3]

INEOperator ( IRuntimeContext ctx = nullptr)

Constructor.

Parameters
[in]ctxRuntime context to be used by the function

Definition at line 35 of file INEOperator.cpp.

36  : _kernel(), _ctx(ctx), _workspace()
37 {
38 }

◆ INEOperator() [2/3]

INEOperator ( const INEOperator )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ INEOperator() [3/3]

INEOperator ( INEOperator &&  )
default

Default move constructor.

◆ ~INEOperator()

~INEOperator ( )
default

Default destructor.

Member Function Documentation

◆ operator=() [1/2]

INEOperator& operator= ( const INEOperator )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

INEOperator& operator= ( INEOperator &&  )
default

Default move assignment operator.

◆ prepare()

void prepare ( ITensorPack constants)
overridevirtual

Prepare the function for executing.

Any one off pre-processing step required by the function is handled here

Parameters
[in]constantsVector that contains the constants tensors.
Note
Prepare stage might not need all the function's buffers' backing memory to be available in order to execute

Implements IOperator.

Reimplemented in CpuDepthwiseConvolution, CpuDepthwiseConvolutionAssemblyDispatch, and CpuScale.

Definition at line 55 of file INEOperator.cpp.

56 {
57  ARM_COMPUTE_UNUSED(constants);
58 }
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152

References ARM_COMPUTE_UNUSED.

Referenced by CpuDequantization::run().

◆ run()

void run ( ITensorPack tensors)
overridevirtual

Run the kernels contained in the function.

Parameters
[in]tensorsVector that contains the tensors to operate on.

Implements IOperator.

Reimplemented in NESynthetizeFunctionWithZeroConstantKernelBorder< K >, CpuDirectConvolution, CpuComplexMul, CpuDepthwiseConvolution, CpuPooling, CpuDepthwiseConvolutionAssemblyDispatch, CpuSoftmaxGeneric< IS_LOG >, CpuPoolingAssemblyDispatch, CpuMul, CpuConcatenate, CpuQuantization, CpuScale, CpuDequantization, CpuConvertFullyConnectedWeights, CpuElementwiseUnary, and CpuElementwiseBase.

Definition at line 40 of file INEOperator.cpp.

41 {
42  if(tensors.empty())
43  {
44  ARM_COMPUTE_ERROR("No inputs provided");
45  }
46 
47  run(tensors, _kernel->window());
48 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
Definition: INEOperator.cpp:40

References ARM_COMPUTE_ERROR, and ITensorPack::empty().

Referenced by CpuElementwiseBase::run(), and CpuElementwiseUnary::run().

◆ workspace()

MemoryRequirements workspace ( ) const
overridevirtual

Return the memory requirements required by the workspace.

Implements IOperator.

Reimplemented in CpuDepthwiseConvolutionAssemblyDispatch, and CpuSoftmaxGeneric< IS_LOG >.

Definition at line 60 of file INEOperator.cpp.

61 {
62  return _workspace;
63 }

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