ArmNN
 24.02
SampleDynamicAdditionWorkload Class Reference

#include <SampleDynamicAdditionWorkload.hpp>

Inheritance diagram for SampleDynamicAdditionWorkload:
[legend]
Collaboration diagram for SampleDynamicAdditionWorkload:
[legend]

Public Member Functions

 SampleDynamicAdditionWorkload (const armnn::AdditionQueueDescriptor &descriptor, const armnn::WorkloadInfo &info)
 
void Execute () const override
 
- Public Member Functions inherited from BaseWorkload< armnn::AdditionQueueDescriptor >
 BaseWorkload (const armnn::AdditionQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const armnn::AdditionQueueDescriptorGetData () const
 
arm::pipe::ProfilingGuid GetGuid () const final
 
virtual bool SupportsTensorHandleReplacement () const override
 
void ReplaceInputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
void ReplaceOutputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual arm::pipe::ProfilingGuid GetGuid () const =0
 
virtual bool SupportsTensorHandleReplacement () const =0
 
virtual const std::string & GetName () const =0
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 
virtual armnn::Optional< armnn::MemoryRequirementsGetMemoryRequirements ()
 

Additional Inherited Members

- Protected Attributes inherited from BaseWorkload< armnn::AdditionQueueDescriptor >
armnn::AdditionQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 13 of file SampleDynamicAdditionWorkload.hpp.

Constructor & Destructor Documentation

◆ SampleDynamicAdditionWorkload()

Definition at line 34 of file SampleDynamicAdditionWorkload.cpp.

36  : BaseWorkload(descriptor, info)
37 {}

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 39 of file SampleDynamicAdditionWorkload.cpp.

40 {
42  unsigned int num = info.GetNumElements();
43 
44  const float* inputData0 = GetInputTensorData(0, m_Data);
45  const float* inputData1 = GetInputTensorData(1, m_Data);
46  float* outputData = GetOutputTensorData(0, m_Data);
47 
48  for (unsigned int i = 0; i < num; ++i)
49  {
50  outputData[i] = inputData0[i] + inputData1[i];
51  }
52 }

References sdb::GetInputTensorData(), sdb::GetOutputTensorData(), sdb::GetTensorInfo(), BaseWorkload< armnn::AdditionQueueDescriptor >::m_Data, and QueueDescriptor::m_Inputs.


The documentation for this class was generated from the following files:
armnn::BaseWorkload< armnn::AdditionQueueDescriptor >::BaseWorkload
BaseWorkload(const armnn::AdditionQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: Workload.hpp:37
armnn::TensorInfo
Definition: Tensor.hpp:152
sdb::GetTensorInfo
const armnn::TensorInfo & GetTensorInfo(const armnn::ITensorHandle *tensorHandle)
Definition: SampleDynamicAdditionWorkload.cpp:14
armnn::BoostLogSeverityMapping::info
@ info
armnn::BaseWorkload< armnn::AdditionQueueDescriptor >::m_Data
armnn::AdditionQueueDescriptor m_Data
Definition: Workload.hpp:89
sdb::GetInputTensorData
const float * GetInputTensorData(unsigned int idx, const armnn::AdditionQueueDescriptor &data)
Definition: SampleDynamicAdditionWorkload.cpp:22
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26
sdb::GetOutputTensorData
float * GetOutputTensorData(unsigned int idx, const armnn::AdditionQueueDescriptor &data)
Definition: SampleDynamicAdditionWorkload.cpp:28