ArmNN
 24.02
NeonArgMinMaxWorkload Class Reference

#include <NeonArgMinMaxWorkload.hpp>

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

Public Member Functions

 NeonArgMinMaxWorkload (const ArgMinMaxQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual void Execute () const override
 
- Public Member Functions inherited from NeonBaseWorkload< ArgMinMaxQueueDescriptor >
 NeonBaseWorkload (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 NeonBaseWorkload< 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 NeonArgMinMaxWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonArgMinMaxWorkload()

NeonArgMinMaxWorkload ( const ArgMinMaxQueueDescriptor descriptor,
const WorkloadInfo info 
)

Definition at line 55 of file NeonArgMinMaxWorkload.cpp.

57  : NeonBaseWorkload<ArgMinMaxQueueDescriptor>(descriptor, info)
58 {
59  // Report Profiling Details
60  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonArgMinMaxWorkload_Construct",
61  descriptor.m_Parameters,
62  info,
63  this->GetGuid());
64 
65  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
66  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
67 
68  auto numDims = info.m_InputTensorInfos[0].GetNumDimensions();
69  auto unsignedAxis = armnnUtils::GetUnsignedAxis(numDims, m_Data.m_Parameters.m_Axis);
70  int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
71 
72  auto layer = std::make_unique<arm_compute::NEArgMinMaxLayer>();
73 
75  {
76  layer->configure(&input, aclAxis, &output, arm_compute::ReductionOperation::ARG_IDX_MAX);
77  }
78  else
79  {
80  layer->configure(&input, aclAxis, &output, arm_compute::ReductionOperation::ARG_IDX_MIN);
81  }
82 
83  m_ArgMinMaxLayer.reset(layer.release());
84 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, 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 86 of file NeonArgMinMaxWorkload.cpp.

87 {
88  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonArgMinMaxWorkload_Execute");
89  m_ArgMinMaxLayer->run();
90 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


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
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::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::ArgMinMaxDescriptor::m_Axis
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:83
ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: NeonWorkloadUtils.hpp:32
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26