ArmNN
 24.02
NeonFloorFloatWorkload Class Reference

#include <NeonFloorFloatWorkload.hpp>

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

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 18 of file NeonFloorFloatWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonFloorFloatWorkload()

NeonFloorFloatWorkload ( const FloorQueueDescriptor descriptor,
const WorkloadInfo info 
)

Definition at line 16 of file NeonFloorFloatWorkload.cpp.

18  : FloatWorkload<FloorQueueDescriptor>(descriptor, info)
19 {
20  m_Data.ValidateInputsOutputs("NeonFloorFloatWorkload", 1, 1);
21 
22  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
23  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
24 
25  auto layer = std::make_unique<arm_compute::NEFloor>();
26  layer->configure(&input, &output);
27  m_Layer.reset(layer.release());
28 }

References armnn::info, BaseWorkload< QueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, and QueueDescriptor::ValidateInputsOutputs().

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 30 of file NeonFloorFloatWorkload.cpp.

31 {
32  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonFloorFloatWorkload_Execute");
33  m_Layer->run();
34 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.

◆ ReplaceInputTensorHandle()

void ReplaceInputTensorHandle ( ITensorHandle tensorHandle,
unsigned int  slot 
)
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 36 of file NeonFloorFloatWorkload.cpp.

37 {
38  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
39  this->m_Data.m_Inputs[slot] = tensorHandle;
40  try
41  {
42  Reconfigure();
43  }
45  {
46  // Cannot reconfigure, revert the slot back and throw the exception.
47  this->m_Data.m_Inputs[slot] = backupHandle;
48  throw e;
49  }
50 }

References BaseWorkload< QueueDescriptor >::m_Data, and QueueDescriptor::m_Inputs.

◆ ReplaceOutputTensorHandle()

void ReplaceOutputTensorHandle ( ITensorHandle tensorHandle,
unsigned int  slot 
)
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 53 of file NeonFloorFloatWorkload.cpp.

54 {
55  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
56  this->m_Data.m_Inputs[slot] = tensorHandle;
57  try
58  {
59  Reconfigure();
60  }
62  {
63  // Cannot reconfigure, revert the slot back and throw the exception.
64  this->m_Data.m_Inputs[slot] = backupHandle;
65  throw e;
66  }
67 }

References BaseWorkload< QueueDescriptor >::m_Data, and QueueDescriptor::m_Inputs.


The documentation for this class was generated from the following files:
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:446
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::BaseWorkload::m_Data
QueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::UnimplementedException
Definition: Exceptions.hpp:98
ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: NeonWorkloadUtils.hpp:32
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26