ArmNN
 24.08
ClConvolution3dWorkload Class Reference

#include <ClConvolution3dWorkload.hpp>

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

Public Member Functions

 ClConvolution3dWorkload (const Convolution3dQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const arm_compute::CLCompileContext &clCompileContext, const bool isFastMathEnabled=false)
 
void Execute () const override
 
- Public Member Functions inherited from ClBaseWorkload< Convolution3dQueueDescriptor >
 ClBaseWorkload (const Convolution3dQueueDescriptor &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< Convolution3dQueueDescriptor >
 BaseWorkload (const Convolution3dQueueDescriptor &descriptor, const WorkloadInfo &info)
 
virtual const std::string & GetName () const override
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const Convolution3dQueueDescriptorGetData () 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< Convolution3dQueueDescriptor >
virtual void Reconfigure ()
 
- Protected Attributes inherited from BaseWorkload< Convolution3dQueueDescriptor >
Convolution3dQueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 
const std::string m_Name
 

Detailed Description

Definition at line 26 of file ClConvolution3dWorkload.hpp.

Constructor & Destructor Documentation

◆ ClConvolution3dWorkload()

ClConvolution3dWorkload ( const Convolution3dQueueDescriptor descriptor,
const WorkloadInfo info,
std::shared_ptr< arm_compute::MemoryManagerOnDemand > &  memoryManager,
const arm_compute::CLCompileContext &  clCompileContext,
const bool  isFastMathEnabled = false 
)

Definition at line 60 of file ClConvolution3dWorkload.cpp.

65  : ClBaseWorkload<Convolution3dQueueDescriptor>(descriptor, info)
66  , m_ConvolutionLayer()
67 {
68  IgnoreUnused(memoryManager);
69 
70  uint32_t numInputs = m_Data.m_Parameters.m_BiasEnabled ? 3: 2;
71  m_Data.ValidateInputsOutputs("ClConvolution3dWorkload", numInputs, 1);
72 
73  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
74  arm_compute::ICLTensor& weights = static_cast<IClTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
75  arm_compute::ICLTensor* biasesPtr = nullptr;
77  {
78  biasesPtr = &static_cast<IClTensorHandle*>(m_Data.m_Inputs[2])->GetTensor();
79  }
80  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
81 
82  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
83  input.info()->set_data_layout(aclDataLayout);
84  weights.info()->set_data_layout(aclDataLayout);
85  output.info()->set_data_layout(aclDataLayout);
86 
87  const arm_compute::Conv3dInfo aclConv3DInfo = ComputeConv3DInfo(descriptor,
88  isFastMathEnabled);
89 
90  {
91  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConvolution3dWorkload_configure");
92  m_ConvolutionLayer.configure(clCompileContext,
93  &input,
94  &weights,
95  biasesPtr,
96  &output,
97  aclConv3DInfo);
98  }
99  // Add details for profiling output
100  WorkloadInfo detailsInfo;
101 
102  detailsInfo.m_InputTensorInfos = info.m_InputTensorInfos;
103  detailsInfo.m_OutputTensorInfos = info.m_OutputTensorInfos;
104 
105  // Report Profiling Details
106  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClConvolution3dWorkload_Construct",
107  descriptor.m_Parameters,
108  detailsInfo,
109  this->GetGuid());
110 
111  // Force Compute Library to perform the necessary copying and reshaping, after which
112  // delete all the input tensors that will no longer be needed
113  m_ConvolutionLayer.prepare();
114 }

References armnn::IgnoreUnused(), armnn::info, Convolution3dDescriptor::m_BiasEnabled, BaseWorkload< Convolution3dQueueDescriptor >::m_Data, QueueDescriptor::m_Inputs, QueueDescriptor::m_Outputs, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, and QueueDescriptor::ValidateInputsOutputs().

Member Function Documentation

◆ Execute()

void Execute ( ) const
overridevirtual

Implements IWorkload.

Definition at line 116 of file ClConvolution3dWorkload.cpp.

117 {
118  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClConvolution3dWorkload_Execute");
119  RunClFunction(m_ConvolutionLayer, CHECK_LOCATION());
120 }

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::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
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::ComputeConv3DInfo
arm_compute::Conv3dInfo ComputeConv3DInfo(const armnn::Convolution3dDescriptor descriptor, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
Utility function used to setup an arm_compute::Conv3dInfo object from convolution3d descriptor.
Definition: ArmComputeUtils.hpp:261
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::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< Convolution3dQueueDescriptor >::m_Data
Convolution3dQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:167
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
armnn::Convolution3dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:653
armnn::Convolution3dDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NDHWC, NCDHW).
Definition: Descriptors.hpp:655
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26