ArmNN
 24.08
ClArgMinMaxWorkload Class Reference

#include <ClArgMinMaxWorkload.hpp>

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

Public Member Functions

 ClArgMinMaxWorkload (const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
 
virtual void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< ArgMinMaxQueueDescriptor >
 ClBaseWorkload (const ArgMinMaxQueueDescriptor &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< ArgMinMaxQueueDescriptor >
 BaseWorkload (const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const ArgMinMaxQueueDescriptorGetData () 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< ArgMinMaxQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< ArgMinMaxQueueDescriptor >
ArgMinMaxQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 20 of file ClArgMinMaxWorkload.hpp.

Constructor & Destructor Documentation

◆ ClArgMinMaxWorkload()

ClArgMinMaxWorkload ( const ArgMinMaxQueueDescriptor descriptor,
const WorkloadInfo info,
const arm_compute::CLCompileContext &  clCompileContext 
)

Definition at line 55 of file ClArgMinMaxWorkload.cpp.

58  : ClBaseWorkload<ArgMinMaxQueueDescriptor>(descriptor, info)
59 {
60  // Report Profiling Details
61  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClArgMinMaxWorkload_Construct",
62  descriptor.m_Parameters,
63  info,
64  this->GetGuid());
65 
66  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(this->m_Data.m_Inputs[0])->GetTensor();
67  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
68 
69  auto numDims = info.m_InputTensorInfos[0].GetNumDimensions();
70  auto unsignedAxis = armnnUtils::GetUnsignedAxis(numDims, m_Data.m_Parameters.m_Axis);
71  int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
72 
73  {
74  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClArgMinMaxWorkload_configure");
76  {
77  m_ArgMinMaxLayer.configure(clCompileContext,
78  &input,
79  aclAxis,
80  &output,
81  arm_compute::ReductionOperation::ARG_IDX_MAX);
82  }
83  else
84  {
85  m_ArgMinMaxLayer.configure(clCompileContext,
86  &input,
87  aclAxis,
88  &output,
89  arm_compute::ReductionOperation::ARG_IDX_MIN);
90  }
91  }
92 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID, armnnUtils::GetUnsignedAxis(), armnn::info, ArgMinMaxDescriptor::m_Axis, BaseWorkload< ArgMinMaxQueueDescriptor >::m_Data, ArgMinMaxDescriptor::m_Function, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, and armnn::Max.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 94 of file ClArgMinMaxWorkload.cpp.

95 {
96  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClArgMinMaxWorkload_Execute");
97  RunClFunction(m_ArgMinMaxLayer, CHECK_LOCATION());
98 }

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::ArgMinMaxFunction::Max
@ Max
armnnUtils::GetUnsignedAxis
unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis)
Definition: TensorUtils.cpp:236
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::ArgMinMaxDescriptor::m_Function
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
Definition: Descriptors.hpp:81
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
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::BoostLogSeverityMapping::info
@ info
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< ArgMinMaxQueueDescriptor >::m_Data
ArgMinMaxQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:167
armnn::ArgMinMaxDescriptor::m_Axis
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:83
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26