ArmNN
 24.02
NeonConvolution3dWorkload Class Reference

#include <NeonConvolution3dWorkload.hpp>

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

Public Member Functions

 NeonConvolution3dWorkload (const Convolution3dQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const bool isFastMathENabled=false)
 
void Execute () const override
 
- Public Member Functions inherited from NeonBaseWorkload< Convolution3dQueueDescriptor >
 NeonBaseWorkload (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 NeonBaseWorkload< 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 27 of file NeonConvolution3dWorkload.hpp.

Constructor & Destructor Documentation

◆ NeonConvolution3dWorkload()

NeonConvolution3dWorkload ( const Convolution3dQueueDescriptor descriptor,
const WorkloadInfo info,
std::shared_ptr< arm_compute::MemoryManagerOnDemand > &  memoryManager,
const bool  isFastMathENabled = false 
)

Definition at line 60 of file NeonConvolution3dWorkload.cpp.

64  : NeonBaseWorkload<Convolution3dQueueDescriptor>(descriptor, info)
65 {
66  IgnoreUnused(memoryManager);
67 
68  using arm_compute::NEConv3D;
69  uint32_t numInputs = m_Data.m_Parameters.m_BiasEnabled ? 3: 2;
70  m_Data.ValidateInputsOutputs("NeonConvolution3dWorkload", numInputs, 1);
71 
72  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
73  arm_compute::ITensor& weights = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
74  arm_compute::ITensor* biasesPtr = nullptr;
76  {
77  biasesPtr = &PolymorphicDowncast<IAclTensorHandle *>(m_Data.m_Inputs[2])->GetTensor();
78  }
79  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
80 
81  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
82  input.info()->set_data_layout(aclDataLayout);
83  weights.info()->set_data_layout(aclDataLayout);
84  output.info()->set_data_layout(aclDataLayout);
85 
86  const arm_compute::Conv3dInfo aclConv3DInfo = ComputeConv3DInfo(descriptor, isFastMathEnabled);
87 
88  auto convolutionLayer = std::make_unique<arm_compute::NEConv3D>();
89  convolutionLayer->configure(&input,
90  &weights,
91  biasesPtr,
92  &output,
93  aclConv3DInfo);
94 
95  // Add details for profiling output
96  WorkloadInfo detailsInfo;
97 
98  detailsInfo.m_InputTensorInfos = info.m_InputTensorInfos;
99  detailsInfo.m_OutputTensorInfos = info.m_OutputTensorInfos;
100 
101  // Report Profiling Details
102  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonConvolution3dWorkload_Construct",
103  descriptor.m_Parameters,
104  detailsInfo,
105  this->GetGuid());
106 
107  m_ConvolutionLayer.reset(convolutionLayer.release());
108 
109  ARMNN_ASSERT(m_ConvolutionLayer);
110 
111  m_ConvolutionLayer->prepare();
112 }

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 114 of file NeonConvolution3dWorkload.cpp.

115 {
116  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonConvolution3dWorkload_Execute");
117  m_ConvolutionLayer->run();
118 }

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::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::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:288
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
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::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_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