ArmNN
 25.11
Loading...
Searching...
No Matches
ClConvertFp16ToFp32Workload Class Reference

#include <ClConvertFp16ToFp32Workload.hpp>

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

Public Member Functions

 ClConvertFp16ToFp32Workload (const ConvertFp16ToFp32QueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
virtual void Execute () const override
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 MultiTypedWorkload< QueueDescriptor, armnn::DataType::Float16, armnn::DataType::Float32 >
 MultiTypedWorkload (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 PostAllocationConfigure () override
const QueueDescriptorGetData () const
arm::pipe::ProfilingGuid GetGuid () const final
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 17 of file ClConvertFp16ToFp32Workload.hpp.

Constructor & Destructor Documentation

◆ ClConvertFp16ToFp32Workload()

ClConvertFp16ToFp32Workload ( const ConvertFp16ToFp32QueueDescriptor & descriptor,
const WorkloadInfo & info,
const arm_compute::CLCompileContext & clCompileContext )

Definition at line 17 of file ClConvertFp16ToFp32Workload.cpp.

20 :
21 Float16ToFloat32Workload<ConvertFp16ToFp32QueueDescriptor>(descriptor, info)
22{
23 this->m_Data.ValidateInputsOutputs("ClConvertFp16ToFp32Workload", 1, 1);
24
25 arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(this->m_Data.m_Inputs[0])->GetTensor();
26 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
27
28 // Create Proxy tensor and set the initial tensor handle to it
29 m_InputProxy = std::make_unique<ICLTensorProxy>(&input);
30 m_OutputProxy = std::make_unique<ICLTensorProxy>(&output);
31
32 {
33 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConvertFp16ToFp32Workload_configure");
34 m_Layer.configure(clCompileContext, m_InputProxy.get(), m_OutputProxy.get(), g_AclConvertPolicy, 0);
35 }
36}
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.

References ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, IClTensorHandle::GetTensor(), armnn::info, and BaseWorkload< QueueDescriptor >::m_Data.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 38 of file ClConvertFp16ToFp32Workload.cpp.

39{
40 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConvertFp16ToFp32Workload_Execute");
41 RunClFunction(m_Layer, CHECK_LOCATION());
42}
#define CHECK_LOCATION()
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)

References ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, CHECK_LOCATION, and armnn::RunClFunction().

◆ ReplaceInputTensorHandle()

void ReplaceInputTensorHandle ( ITensorHandle * tensorHandle,
unsigned int slot )
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 64 of file ClConvertFp16ToFp32Workload.cpp.

65{
66 ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
67 this->m_Data.m_Inputs[slot] = tensorHandle;
68 try
69 {
70 Reconfigure();
71 }
72 catch(armnn::UnimplementedException& e)
73 {
74 // Cannot reconfigure, revert the slot back and throw the exception.
75 this->m_Data.m_Inputs[slot] = backupHandle;
76 throw e;
77 }
78}

References BaseWorkload< QueueDescriptor >::m_Data.

◆ ReplaceOutputTensorHandle()

void ReplaceOutputTensorHandle ( ITensorHandle * tensorHandle,
unsigned int slot )
overridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 81 of file ClConvertFp16ToFp32Workload.cpp.

82{
83 ITensorHandle* backupHandle = this->m_Data.m_Outputs[slot];
84 this->m_Data.m_Outputs[slot] = tensorHandle;
85 try
86 {
87 Reconfigure();
88 }
89 catch(armnn::UnimplementedException& e)
90 {
91 // Cannot reconfigure, revert the slot back and throw the exception.
92 this->m_Data.m_Outputs[slot] = backupHandle;
93 throw e;
94 }
95}

References BaseWorkload< QueueDescriptor >::m_Data.

◆ SupportsTensorHandleReplacement()

bool SupportsTensorHandleReplacement ( ) const
inlineoverridevirtual

Reimplemented from BaseWorkload< QueueDescriptor >.

Definition at line 26 of file ClConvertFp16ToFp32Workload.hpp.

26{ return true;};

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