ArmNN
 22.11
ClFloorFloatWorkload Class Reference

#include <ClFloorFloatWorkload.hpp>

Inheritance diagram for ClFloorFloatWorkload:
TypedWorkload< QueueDescriptor, DataTypes > BaseWorkload< QueueDescriptor > IWorkload

Public Member Functions

 ClFloorFloatWorkload (const FloorQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
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)
 
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
 

Detailed Description

Definition at line 18 of file ClFloorFloatWorkload.hpp.

Constructor & Destructor Documentation

◆ ClFloorFloatWorkload()

ClFloorFloatWorkload ( const FloorQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 23 of file ClFloorFloatWorkload.cpp.

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

26  : FloatWorkload<FloorQueueDescriptor>(descriptor, info)
27 {
28  m_Data.ValidateInputsOutputs("ClFloorFloatWorkload", 1, 1);
29 
30  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
31  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
32  {
33  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClFloorFloatWorkload_configure");
34  m_Layer.configure(clCompileContext, &input, &output);
35  }
36 }
IConnectableLayer * m_Layer
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
QueueDescriptor m_Data
Definition: Workload.hpp:83
std::vector< ITensorHandle * > m_Outputs
std::vector< ITensorHandle * > m_Inputs

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 38 of file ClFloorFloatWorkload.cpp.

References ARMNN_SCOPED_PROFILING_EVENT_CL_GUID, CHECK_LOCATION, BaseWorkload< QueueDescriptor >::GetGuid(), and armnn::RunClFunction().

39 {
40  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClFloorFloatWorkload_Execute", this->GetGuid());
42 }
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
IConnectableLayer * m_Layer
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:61
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203

◆ ReplaceInputTensorHandle()

void ReplaceInputTensorHandle ( ITensorHandle tensorHandle,
unsigned int  slot 
)
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 44 of file ClFloorFloatWorkload.cpp.

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

45 {
46  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
47  this->m_Data.m_Inputs[slot] = tensorHandle;
48  try
49  {
50  Reconfigure();
51  }
53  {
54  // Cannot reconfigure, revert the slot back and throw the exception.
55  this->m_Data.m_Inputs[slot] = backupHandle;
56  throw e;
57  }
58 }
QueueDescriptor m_Data
Definition: Workload.hpp:83
std::vector< ITensorHandle * > m_Inputs

◆ ReplaceOutputTensorHandle()

void ReplaceOutputTensorHandle ( ITensorHandle tensorHandle,
unsigned int  slot 
)
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 61 of file ClFloorFloatWorkload.cpp.

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

62 {
63  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
64  this->m_Data.m_Inputs[slot] = tensorHandle;
65  try
66  {
67  Reconfigure();
68  }
70  {
71  // Cannot reconfigure, revert the slot back and throw the exception.
72  this->m_Data.m_Inputs[slot] = backupHandle;
73  throw e;
74  }
75 }
QueueDescriptor m_Data
Definition: Workload.hpp:83
std::vector< ITensorHandle * > m_Inputs

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