From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- ...mnn_1_1_cl_depthwise_convolution_workload.xhtml | 375 +++++++++++++++++++++ 1 file changed, 375 insertions(+) create mode 100644 20.02/classarmnn_1_1_cl_depthwise_convolution_workload.xhtml (limited to '20.02/classarmnn_1_1_cl_depthwise_convolution_workload.xhtml') diff --git a/20.02/classarmnn_1_1_cl_depthwise_convolution_workload.xhtml b/20.02/classarmnn_1_1_cl_depthwise_convolution_workload.xhtml new file mode 100644 index 0000000000..7738addc09 --- /dev/null +++ b/20.02/classarmnn_1_1_cl_depthwise_convolution_workload.xhtml @@ -0,0 +1,375 @@ + + + + + + + + + + + + + +ArmNN: ClDepthwiseConvolutionWorkload Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ClDepthwiseConvolutionWorkload Class Reference
+
+
+ +

#include <ClDepthwiseConvolutionWorkload.hpp>

+
+Inheritance diagram for ClDepthwiseConvolutionWorkload:
+
+
+ + +BaseWorkload< DepthwiseConvolution2dQueueDescriptor > +IWorkload + +
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ClDepthwiseConvolutionWorkload (const DepthwiseConvolution2dQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void Execute () const override
 
- Public Member Functions inherited from BaseWorkload< DepthwiseConvolution2dQueueDescriptor >
 BaseWorkload (const DepthwiseConvolution2dQueueDescriptor &descriptor, const WorkloadInfo &info)
 
void PostAllocationConfigure () override
 
const DepthwiseConvolution2dQueueDescriptorGetData () const
 
profiling::ProfilingGuid GetGuid () const final
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 
+ + + +

+Protected Member Functions

void FreeUnusedTensors ()
 
+ + + + + + + + + + + + +

+Protected Attributes

std::unique_ptr< arm_compute::IFunction > m_DepthwiseConvolutionLayer
 
std::unique_ptr< arm_compute::CLTensor > m_KernelTensor
 
std::unique_ptr< arm_compute::CLTensor > m_BiasTensor
 
- Protected Attributes inherited from BaseWorkload< DepthwiseConvolution2dQueueDescriptor >
const DepthwiseConvolution2dQueueDescriptor m_Data
 
const profiling::ProfilingGuid m_Guid
 
+

Detailed Description

+
+

Definition at line 23 of file ClDepthwiseConvolutionWorkload.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ClDepthwiseConvolutionWorkload()

+ +
+
+ + + + + + + + + + + + + + + + + + +
ClDepthwiseConvolutionWorkload (const DepthwiseConvolution2dQueueDescriptordescriptor,
const WorkloadInfoinfo 
)
+
+ +

Definition at line 70 of file ClDepthwiseConvolutionWorkload.cpp.

+ +

References armnn::ConvertWeightTensorFromArmnnToAcl(), TensorInfo::GetNumBytes(), ConstCpuTensorHandle::GetTensorInfo(), BaseWorkload< DepthwiseConvolution2dQueueDescriptor >::m_Data, DepthwiseConvolution2dDescriptor::m_DataLayout, ClDepthwiseConvolutionWorkload::m_KernelTensor, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, and DepthwiseConvolution2dQueueDescriptor::m_Weight.

+
73  : BaseWorkload<DepthwiseConvolution2dQueueDescriptor>(descriptor, info)
74 {
75  // Allocate a buffer for the swizzling of the weight tensor
76  std::unique_ptr<unsigned char[]> permuteBuffer(new unsigned char[m_Data.m_Weight->GetTensorInfo().GetNumBytes()]);
77 
78  // Convert the weight format from ArmNN's [ M, I, H, W ] (does NOT depend on the data layout) to either
79  // [ 1, H, W, I * M ] (if NHWC) or [ 1, I * M, H, W ] (if NCHW), as required by the compute library
80  ConstTensor weightPermuted = ConvertWeightTensorFromArmnnToAcl(m_Data.m_Weight,
82  permuteBuffer.get());
83 
84  // Convert the weights into the compute library format
85  m_KernelTensor = std::make_unique<arm_compute::CLTensor>();
86  BuildArmComputeTensor(*m_KernelTensor, weightPermuted.GetInfo(), m_Data.m_Parameters.m_DataLayout);
87 
89  {
90  m_BiasTensor = std::make_unique<arm_compute::CLTensor>();
92  }
93 
94  const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D(
97 
98 
99  std::string name = std::string("ClDepthwiseConvolutionWorkload");
100  m_Data.ValidateInputsOutputs(name, 1, 1);
101 
102  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
103  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
104 
105  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
106  input.info()->set_data_layout(aclDataLayout);
107  output.info()->set_data_layout(aclDataLayout);
108 
109  // ArmNN's weight format is [ M, I, H, W ]
110  auto& weightInfo = m_Data.m_Weight->GetTensorInfo();
111 
112  // Get the depth multiplier
113  const unsigned int depthMultiplier = weightInfo.GetShape()[0];
114 
115  arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters);
116 
117  m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer>();
118  static_cast<arm_compute::CLDepthwiseConvolutionLayer*>(m_DepthwiseConvolutionLayer.get())->configure(
119  &input,
120  m_KernelTensor.get(),
121  m_BiasTensor.get(),
122  &output,
123  padStrideInfo,
124  depthMultiplier,
125  arm_compute::ActivationLayerInfo(),
126  aclDilationInfo);
127 
128  BOOST_ASSERT(m_DepthwiseConvolutionLayer);
129 
130  ScopedCpuTensorHandle weightsPermutedHandle(weightPermuted);
131  InitializeArmComputeClTensorData(*m_KernelTensor, &weightsPermutedHandle);
132 
133  if (m_BiasTensor)
134  {
136  }
137 
138  m_DepthwiseConvolutionLayer->prepare();
140 }
bool m_BiasEnabled
Enable/disable bias.
+
DataLayout
Definition: Types.hpp:49
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+
armnn::ConstTensor ConvertWeightTensorFromArmnnToAcl(const ConstCpuTensorHandle *weightTensor, DataLayout dataLayout, void *permuteBuffer)
+
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstCpuTensorHandle *handle)
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+ +
const DepthwiseConvolution2dQueueDescriptor m_Data
Definition: Workload.hpp:46
+
unsigned int GetNumBytes() const
Definition: Tensor.cpp:213
+
std::unique_ptr< arm_compute::IFunction > m_DepthwiseConvolutionLayer
+
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
+
std::unique_ptr< arm_compute::CLTensor > m_BiasTensor
+ +
uint32_t m_DilationY
Dilation factor value for height dimension.
+ +
uint32_t m_DilationX
Dilation factor value for width dimension.
+ +
std::unique_ptr< arm_compute::CLTensor > m_KernelTensor
+
std::vector< ITensorHandle * > m_Outputs
+ +
std::vector< ITensorHandle * > m_Inputs
+
const TensorInfo & GetTensorInfo() const
+
+
+
+

Member Function Documentation

+ +

◆ Execute()

+ +
+
+ + + + + +
+ + + + + + + +
void Execute () const
+
+overridevirtual
+
+ +

Implements IWorkload.

+ +

Definition at line 148 of file ClDepthwiseConvolutionWorkload.cpp.

+ +

References ARMNN_SCOPED_PROFILING_EVENT_CL, CHECK_LOCATION, ClDepthwiseConvolutionWorkload::m_DepthwiseConvolutionLayer, and armnn::RunClFunction().

+
149 {
150  ARMNN_SCOPED_PROFILING_EVENT_CL("ClDepthwiseConvolutionWorkload_Execute");
151  BOOST_ASSERT(m_DepthwiseConvolutionLayer);
152 
154 }
#define ARMNN_SCOPED_PROFILING_EVENT_CL(name)
+
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
+
std::unique_ptr< arm_compute::IFunction > m_DepthwiseConvolutionLayer
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192
+
+
+
+ +

◆ FreeUnusedTensors()

+ +
+
+ + + + + +
+ + + + + + + +
void FreeUnusedTensors ()
+
+protected
+
+ +

Definition at line 142 of file ClDepthwiseConvolutionWorkload.cpp.

+
143 {
144  FreeTensorIfUnused(m_KernelTensor);
145  FreeTensorIfUnused(m_BiasTensor);
146 }
std::unique_ptr< arm_compute::CLTensor > m_BiasTensor
+
std::unique_ptr< arm_compute::CLTensor > m_KernelTensor
+
+
+
+

Member Data Documentation

+ +

◆ m_BiasTensor

+ +
+
+ + + + + +
+ + + + +
std::unique_ptr<arm_compute::CLTensor> m_BiasTensor
+
+protected
+
+ +

Definition at line 37 of file ClDepthwiseConvolutionWorkload.hpp.

+ +
+
+ +

◆ m_DepthwiseConvolutionLayer

+ +
+
+ + + + + +
+ + + + +
std::unique_ptr<arm_compute::IFunction> m_DepthwiseConvolutionLayer
+
+protected
+
+ +

Definition at line 34 of file ClDepthwiseConvolutionWorkload.hpp.

+ +

Referenced by ClDepthwiseConvolutionWorkload::Execute().

+ +
+
+ +

◆ m_KernelTensor

+ +
+
+ + + + + +
+ + + + +
std::unique_ptr<arm_compute::CLTensor> m_KernelTensor
+
+protected
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1