ArmNN
 24.02
ClSqrtWorkload Class Reference

#include <ClSqrtWorkload.hpp>

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

Public Member Functions

 ClSqrtWorkload (const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
virtual void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< ElementwiseUnaryQueueDescriptor >
 ClBaseWorkload (const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void ReplaceInputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
void ReplaceOutputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
- Public Member Functions inherited from BaseWorkload< ElementwiseUnaryQueueDescriptor >
 BaseWorkload (const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const ElementwiseUnaryQueueDescriptorGetData () const
 
arm::pipe::ProfilingGuid GetGuid () const final
 
virtual bool SupportsTensorHandleReplacement () const 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 Member Functions inherited from ClBaseWorkload< ElementwiseUnaryQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< ElementwiseUnaryQueueDescriptor >
ElementwiseUnaryQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 18 of file ClSqrtWorkload.hpp.

Constructor & Destructor Documentation

◆ ClSqrtWorkload()

ClSqrtWorkload ( const ElementwiseUnaryQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 32 of file ClSqrtWorkload.cpp.

35  : ClBaseWorkload<ElementwiseUnaryQueueDescriptor>(descriptor, info)
36 {
37  ARMNN_ASSERT(descriptor.m_Parameters.m_Operation == UnaryOperation::Sqrt);
38 
39  // Report Profiling Details
40  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClSqrtWorkload_Construct",
41  descriptor.m_Parameters,
42  info,
43  this->GetGuid());
44 
45  m_Data.ValidateInputsOutputs("ClSqrtWorkload", 1, 1);
46 
47  ActivationDescriptor activationDescriptor;
48  activationDescriptor.m_Function = ActivationFunction::Sqrt;
49  const arm_compute::ActivationLayerInfo activationLayerInfo =
51 
52  arm_compute::ICLTensor& input = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
53  arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
54 
55  {
56  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClSqrtWorkload_configure");
57  m_SqrtLayer.configure(clCompileContext, &input, &output, activationLayerInfo);
58  }
59 }

References ARMNN_ASSERT, ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, armnn::ConvertActivationDescriptorToAclActivationLayerInfo(), armnn::info, BaseWorkload< ElementwiseUnaryQueueDescriptor >::m_Data, ActivationDescriptor::m_Function, QueueDescriptor::m_Inputs, ElementwiseUnaryDescriptor::m_Operation, QueueDescriptor::m_Outputs, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, armnn::Sqrt, and QueueDescriptor::ValidateInputsOutputs().

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 61 of file ClSqrtWorkload.cpp.

62 {
63  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClSqrtWorkload_Execute");
64  RunClFunction(m_SqrtLayer, CHECK_LOCATION());
65 }

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


The documentation for this class was generated from the following files:
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:446
armnn::ActivationFunction::Sqrt
@ Sqrt
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::UnaryOperation::Sqrt
@ Sqrt
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::ConvertActivationDescriptorToAclActivationLayerInfo
arm_compute::ActivationLayerInfo ConvertActivationDescriptorToAclActivationLayerInfo(const ActivationDescriptor &actDesc)
Definition: ArmComputeUtils.hpp:87
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< ElementwiseUnaryQueueDescriptor >::m_Data
ElementwiseUnaryQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:168
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26