ArmNN
 24.08
ClL2NormalizationFloatWorkload Class Reference

#include <ClL2NormalizationFloatWorkload.hpp>

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

Public Member Functions

 ClL2NormalizationFloatWorkload (const L2NormalizationQueueDescriptor &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)
 
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 19 of file ClL2NormalizationFloatWorkload.hpp.

Constructor & Destructor Documentation

◆ ClL2NormalizationFloatWorkload()

ClL2NormalizationFloatWorkload ( const L2NormalizationQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 29 of file ClL2NormalizationFloatWorkload.cpp.

32  : FloatWorkload<L2NormalizationQueueDescriptor>(descriptor, info)
33 {
34  // Report Profiling Details
35  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClL2NormalizationFloatWorkload_Construct",
36  descriptor.m_Parameters,
37  info,
38  this->GetGuid());
39 
40  m_Data.ValidateInputsOutputs("ClL2NormalizationFloatWorkload", 1, 1);
41 
42  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
43  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
44 
45  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
46  input.info()->set_data_layout(aclDataLayout);
47  output.info()->set_data_layout(aclDataLayout);
48 
49  int axis = (m_Data.m_Parameters.m_DataLayout == DataLayout::NCHW) ? 2 : 0;
50 
51  {
52  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClL2NormalizationFloatWorkload_configure");
53  m_Layer.configure(clCompileContext, &input, &output, axis, m_Data.m_Parameters.m_Eps);
54  }
55 }

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

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 57 of file ClL2NormalizationFloatWorkload.cpp.

58 {
59  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClL2NormalizationFloatWorkload_Execute");
61 }

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 63 of file ClL2NormalizationFloatWorkload.cpp.

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

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 80 of file ClL2NormalizationFloatWorkload.cpp.

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

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


The documentation for this class was generated from the following files:
armnn::DataLayout
DataLayout
Definition: Types.hpp:62
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
m_Layer
IConnectableLayer * m_Layer
Definition: SubgraphViewSelector.cpp:257
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: ClWorkloadUtils.hpp:36
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::BaseWorkload::m_Data
QueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:167
armnn::UnimplementedException
Definition: Exceptions.hpp:98
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26
armnn::DataLayout::NCHW
@ NCHW