ArmNN
 24.08
NeonTransposeConvolution2dWorkload Class Reference

#include <NeonTransposeConvolution2dWorkload.hpp>

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

Public Member Functions

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

Detailed Description

Definition at line 27 of file NeonTransposeConvolution2dWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonTransposeConvolution2dWorkload()

NeonTransposeConvolution2dWorkload ( const TransposeConvolution2dQueueDescriptor descriptor,
const WorkloadInfo info,
std::shared_ptr< arm_compute::MemoryManagerOnDemand > &  memoryManager 
)

Definition at line 56 of file NeonTransposeConvolution2dWorkload.cpp.

59  : NeonBaseWorkload<TransposeConvolution2dQueueDescriptor>(descriptor, info)
60 {
61  m_Data.ValidateInputsOutputs("NeonTransposeConvolution2dWorkload", 1, 1);
62 
63  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
64  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
65 
66  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
67  input.info()->set_data_layout(aclDataLayout);
68  output.info()->set_data_layout(aclDataLayout);
69 
70  m_KernelTensor = std::make_unique<arm_compute::Tensor>();
71  BuildArmComputeTensor(*m_KernelTensor, m_Data.m_Weight->GetTensorInfo(), m_Data.m_Parameters.m_DataLayout);
72 
74  {
75  m_BiasTensor = std::make_unique<arm_compute::Tensor>();
76  BuildArmComputeTensor(*m_BiasTensor, m_Data.m_Bias->GetTensorInfo(), m_Data.m_Parameters.m_DataLayout);
77  }
78 
79  arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters);
80 
81  // Add details for profiling output
82  WorkloadInfo detailsInfo;
83 
84  detailsInfo.m_InputTensorInfos = info.m_InputTensorInfos;
85  detailsInfo.m_OutputTensorInfos = info.m_OutputTensorInfos;
86  detailsInfo.m_WeightsTensorInfo = armnn::Optional<armnn::TensorInfo>(descriptor.m_Weight->GetTensorInfo());
87  if (descriptor.m_Parameters.m_BiasEnabled)
88  {
89  detailsInfo.m_BiasTensorInfo = armnn::Optional<armnn::TensorInfo>(descriptor.m_Bias->GetTensorInfo());
90  }
91 
92  // Report Profiling Details
93  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonTransposeConvolution2dWorkload_Construct",
94  descriptor.m_Parameters,
95  detailsInfo,
96  this->GetGuid());
97 
98  m_Layer = std::make_unique<arm_compute::NEDeconvolutionLayer>(memoryManager);
99  m_Layer->configure(&input, m_KernelTensor.get(), m_BiasTensor.get(), &output, padStrideInfo);
100 
102 
104  {
106  }
107 
108  m_Layer->prepare();
109  FreeUnusedTensors();
110 }

References armnn::info, BaseWorkload< TransposeConvolution2dQueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, and QueueDescriptor::ValidateInputsOutputs().

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 112 of file NeonTransposeConvolution2dWorkload.cpp.

113 {
114  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonTransposeConvolution2dWorkload_Execute");
115  m_Layer->run();
116 }

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


The documentation for this class was generated from the following files:
armnn::Optional< armnn::TensorInfo >
armnn::DataLayout
DataLayout
Definition: Types.hpp:62
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
armnn::TransposeConvolution2dQueueDescriptor::m_Weight
const ConstTensorHandle * m_Weight
Definition: WorkloadData.hpp:551
armnn::ConstTensorHandle::GetTensorInfo
const TensorInfo & GetTensorInfo() const
Definition: TensorHandle.hpp:40
armnn::InitializeArmComputeTensorData
void InitializeArmComputeTensorData(arm_compute::Tensor &tensor, TensorInfo tensorInfo, const ITensorHandle *handle)
Definition: NeonWorkloadUtils.hpp:69
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
armnn::TransposeConvolution2dQueueDescriptor::m_Bias
const ConstTensorHandle * m_Bias
Definition: WorkloadData.hpp:552
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< TransposeConvolution2dQueueDescriptor >::m_Data
TransposeConvolution2dQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::TransposeConvolution2dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:1481
armnn::TransposeConvolution2dDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition: Descriptors.hpp:1483
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