ArmNN
 20.08
RefElementwiseWorkload< Functor, ParentDescriptor, DebugString > Class Template Reference

#include <RefElementwiseWorkload.hpp>

Inheritance diagram for RefElementwiseWorkload< Functor, ParentDescriptor, DebugString >:
BaseWorkload< ParentDescriptor > IWorkload

Public Types

using InType = typename ElementwiseBinaryFunction< Functor >::InType
 
using OutType = typename ElementwiseBinaryFunction< Functor >::OutType
 

Public Member Functions

 RefElementwiseWorkload (const ParentDescriptor &descriptor, const WorkloadInfo &info)
 
void PostAllocationConfigure () override
 
void Execute () const override
 
- Public Member Functions inherited from BaseWorkload< ParentDescriptor >
 BaseWorkload (const ParentDescriptor &descriptor, const WorkloadInfo &info)
 
void PostAllocationConfigure () override
 
const ParentDescriptor & GetData () const
 
profiling::ProfilingGuid GetGuid () const final
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 

Additional Inherited Members

- Protected Attributes inherited from BaseWorkload< ParentDescriptor >
const ParentDescriptor m_Data
 
const profiling::ProfilingGuid m_Guid
 

Detailed Description

template<typename Functor, typename ParentDescriptor, typename armnn::StringMapping::Id DebugString>
class armnn::RefElementwiseWorkload< Functor, ParentDescriptor, DebugString >

Definition at line 21 of file RefElementwiseWorkload.hpp.

Member Typedef Documentation

◆ InType

using InType = typename ElementwiseBinaryFunction<Functor>::InType

Definition at line 24 of file RefElementwiseWorkload.hpp.

◆ OutType

using OutType = typename ElementwiseBinaryFunction<Functor>::OutType

Definition at line 25 of file RefElementwiseWorkload.hpp.

Constructor & Destructor Documentation

◆ RefElementwiseWorkload()

RefElementwiseWorkload ( const ParentDescriptor &  descriptor,
const WorkloadInfo info 
)

Definition at line 21 of file RefElementwiseWorkload.cpp.

24  : BaseWorkload<ParentDescriptor>(desc, info)
25 {
26 }

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 41 of file RefElementwiseWorkload.cpp.

References ARMNN_SCOPED_PROFILING_EVENT, armnn::CpuRef, TensorInfo::GetShape(), armnn::GetTensorInfo(), StringMapping::Instance(), BaseWorkload< ParentDescriptor >::m_Data, StringMapping::RefAdditionWorkload_Execute, StringMapping::RefDivisionWorkload_Execute, StringMapping::RefMaximumWorkload_Execute, StringMapping::RefMinimumWorkload_Execute, StringMapping::RefMultiplicationWorkload_Execute, and StringMapping::RefSubtractionWorkload_Execute.

42 {
44  const TensorInfo& inputInfo0 = GetTensorInfo(m_Data.m_Inputs[0]);
45  const TensorInfo& inputInfo1 = GetTensorInfo(m_Data.m_Inputs[1]);
46  const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]);
47 
48  const TensorShape& inShape0 = inputInfo0.GetShape();
49  const TensorShape& inShape1 = inputInfo1.GetShape();
50  const TensorShape& outShape = outputInfo.GetShape();
51 
52  m_Input0->Reset(m_Data.m_Inputs[0]->Map());
53  m_Input1->Reset(m_Data.m_Inputs[1]->Map());
54  m_Output->Reset(m_Data.m_Outputs[0]->Map());
55 
56  ElementwiseBinaryFunction<Functor>(inShape0,
57  inShape1,
58  outShape,
59  *m_Input0,
60  *m_Input1,
61  *m_Output);
62 }
CPU Execution: Reference C++ kernels.
static const StringMapping & Instance()
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:169
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers

◆ PostAllocationConfigure()

void PostAllocationConfigure ( )
overridevirtual

Implements IWorkload.

Definition at line 29 of file RefElementwiseWorkload.cpp.

References armnn::GetTensorInfo(), and BaseWorkload< ParentDescriptor >::m_Data.

30 {
31  const TensorInfo& inputInfo0 = GetTensorInfo(m_Data.m_Inputs[0]);
32  const TensorInfo& inputInfo1 = GetTensorInfo(m_Data.m_Inputs[1]);
33  const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]);
34 
35  m_Input0 = MakeDecoder<InType>(inputInfo0);
36  m_Input1 = MakeDecoder<InType>(inputInfo1);
37  m_Output = MakeEncoder<OutType>(outputInfo);
38 }
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers

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