ArmNN
 24.02
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 55 of file NeonTransposeConvolution2dWorkload.cpp.

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

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 113 of file NeonTransposeConvolution2dWorkload.cpp.

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

References ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID.


The documentation for this class was generated from the following files:
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
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:446
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:68
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:32
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26