ArmNN
 25.11
Loading...
Searching...
No Matches
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 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 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 if (descriptor.m_Parameters.m_Operation != UnaryOperation::Sqrt)
38 {
39 throw InvalidArgumentException("ClSqrtWorkload: The descriptor does not indicate a Sqrt operation.");
40 }
41
42 // Report Profiling Details
43 ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClSqrtWorkload_Construct",
44 descriptor.m_Parameters,
45 info,
46 this->GetGuid());
47
48 m_Data.ValidateInputsOutputs("ClSqrtWorkload", 1, 1);
49
50 ActivationDescriptor activationDescriptor;
51 activationDescriptor.m_Function = ActivationFunction::Sqrt;
52 const arm_compute::ActivationLayerInfo activationLayerInfo =
54
55 arm_compute::ICLTensor& input = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
56 arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
57
58 {
59 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClSqrtWorkload_configure");
60 m_SqrtLayer.configure(clCompileContext, &input, &output, activationLayerInfo);
61 }
62}
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
arm_compute::ActivationLayerInfo ConvertActivationDescriptorToAclActivationLayerInfo(const ActivationDescriptor &actDesc)

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, ClBaseWorkload< ElementwiseUnaryQueueDescriptor >::ClBaseWorkload(), armnn::ConvertActivationDescriptorToAclActivationLayerInfo(), armnn::info, BaseWorkload< ElementwiseUnaryQueueDescriptor >::m_Data, ActivationDescriptor::m_Function, ElementwiseUnaryDescriptor::m_Operation, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, armnn::PolymorphicDowncast(), and armnn::Sqrt.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 64 of file ClSqrtWorkload.cpp.

65{
66 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClSqrtWorkload_Execute");
67 RunClFunction(m_SqrtLayer, CHECK_LOCATION());
68}
#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().


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