ArmNN
 24.08
NeonPadWorkload Class Reference

#include <NeonPadWorkload.hpp>

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

Public Member Functions

 NeonPadWorkload (const PadQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void Execute () const override
 
- Public Member Functions inherited from NeonBaseWorkload< PadQueueDescriptor >
 NeonBaseWorkload (const PadQueueDescriptor &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< PadQueueDescriptor >
 BaseWorkload (const PadQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const PadQueueDescriptorGetData () 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< PadQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< PadQueueDescriptor >
PadQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 15 of file NeonPadWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonPadWorkload()

NeonPadWorkload ( const PadQueueDescriptor descriptor,
const WorkloadInfo info 
)

Definition at line 20 of file NeonPadWorkload.cpp.

21  : NeonBaseWorkload<PadQueueDescriptor>(descriptor, info)
22 {
23  // Report Profiling Details
24  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonPadWorkload_Construct",
25  descriptor.m_Parameters,
26  info,
27  this->GetGuid());
28 
29  m_Data.ValidateInputsOutputs("NeonPadWorkload", 1, 1);
30 
31  arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
32  arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
33 
34  std::vector<std::pair<unsigned int, unsigned int>> reversed_PadList(descriptor.m_Parameters.m_PadList.size());
35 
36  std::reverse_copy(std::begin(descriptor.m_Parameters.m_PadList),
37  std::end(descriptor.m_Parameters.m_PadList),
38  std::begin(reversed_PadList));
39 
40  arm_compute::PaddingList padList = static_cast<arm_compute::PaddingList>(reversed_PadList);
41 
42  arm_compute::PixelValue pixelValue = GetPixelValue(input.info(), descriptor.m_Parameters.m_PadValue);
43 
44  auto layer = std::make_unique<arm_compute::NEPadLayer>();
45  layer->configure(&input,
46  &output,
47  padList,
48  pixelValue,
49  ConvertPaddingModeToAcl(descriptor.m_Parameters.m_PaddingMode));
50  m_Layer.reset(layer.release());
51 }

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

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 53 of file NeonPadWorkload.cpp.

54 {
55  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonPadWorkload_Execute");
56  m_Layer->run();
57 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


The documentation for this class was generated from the following files:
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
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< PadQueueDescriptor >::m_Data
PadQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::ConvertPaddingModeToAcl
arm_compute::PaddingMode ConvertPaddingModeToAcl(const PaddingMode &paddingMode)
Definition: ArmComputeUtils.hpp:295
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:33
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26