ArmNN
 24.08
ClTransposeConvolution2dWorkload Class Reference

#include <ClTransposeConvolution2dWorkload.hpp>

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

Public Member Functions

 ClTransposeConvolution2dWorkload (const TransposeConvolution2dQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const arm_compute::CLCompileContext &clCompileContext)
 
void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< TransposeConvolution2dQueueDescriptor >
 ClBaseWorkload (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 ClBaseWorkload< 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 ClTransposeConvolution2dWorkload.hpp.

Constructor & Destructor Documentation

◆ ClTransposeConvolution2dWorkload()

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

Definition at line 59 of file ClTransposeConvolution2dWorkload.cpp.

64  : ClBaseWorkload<TransposeConvolution2dQueueDescriptor>(descriptor, info)
65  , m_Layer(memoryManager)
66 {
67  // Add details for profiling output
68  WorkloadInfo detailsInfo;
69 
70  detailsInfo.m_InputTensorInfos = info.m_InputTensorInfos;
71  detailsInfo.m_OutputTensorInfos = info.m_OutputTensorInfos;
72  detailsInfo.m_WeightsTensorInfo = armnn::Optional<armnn::TensorInfo>(descriptor.m_Weight->GetTensorInfo());
73  if (descriptor.m_Parameters.m_BiasEnabled)
74  {
75  detailsInfo.m_BiasTensorInfo = armnn::Optional<armnn::TensorInfo>(descriptor.m_Bias->GetTensorInfo());
76  }
77 
78  // Report Profiling Details
79  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClTransposeConvolution2dWorkload_Construct",
80  descriptor.m_Parameters,
81  detailsInfo,
82  this->GetGuid());
83 
84  const TensorInfo& weightInfo = m_Data.m_Weight->GetTensorInfo();
85 
86  m_WeightsTensor = std::make_unique<arm_compute::CLTensor>();
87  BuildArmComputeTensor(*m_WeightsTensor, weightInfo, m_Data.m_Parameters.m_DataLayout);
88 
90  {
91  m_BiasesTensor = std::make_unique<arm_compute::CLTensor>();
92  BuildArmComputeTensor(*m_BiasesTensor, m_Data.m_Bias->GetTensorInfo(), m_Data.m_Parameters.m_DataLayout);
93  }
94 
95  m_Data.ValidateInputsOutputs("ClTransposeConvolution2dWorkload", 1, 1);
96 
97  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
98  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
99 
100  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
101 
102  input.info()->set_data_layout(aclDataLayout);
103  output.info()->set_data_layout(aclDataLayout);
104 
105  arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters);
106  {
107  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClTransposeConvolution2dWorkload_configure");
108  m_Layer.configure(clCompileContext, &input, m_WeightsTensor.get(), m_BiasesTensor.get(), &output,
109  padStrideInfo);
110  }
111 
113  if (m_BiasesTensor)
114  {
116  }
117 
118  m_Layer.prepare();
119 
120  FreeUnusedTensors();
121 }

References ARMNN_REPORT_PROFILING_WORKLOAD_DESC, ConstTensorHandle::GetTensorInfo(), armnn::info, TransposeConvolution2dQueueDescriptor::m_Bias, TransposeConvolution2dDescriptor::m_BiasEnabled, WorkloadInfo::m_BiasTensorInfo, BaseWorkload< TransposeConvolution2dQueueDescriptor >::m_Data, WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, TransposeConvolution2dQueueDescriptor::m_Weight, and WorkloadInfo::m_WeightsTensorInfo.

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 123 of file ClTransposeConvolution2dWorkload.cpp.

124 {
125  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClTransposeConvolution2dWorkload_Execute");
127 }

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::InitializeArmComputeClTensorData
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstTensorHandle *handle)
Definition: ClWorkloadUtils.hpp:124
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
m_Layer
IConnectableLayer * m_Layer
Definition: SubgraphViewSelector.cpp:257
armnn::TransposeConvolution2dQueueDescriptor::m_Weight
const ConstTensorHandle * m_Weight
Definition: WorkloadData.hpp:551
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::ConstTensorHandle::GetTensorInfo
const TensorInfo & GetTensorInfo() const
Definition: TensorHandle.hpp:40
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::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::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:167
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::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26