Release 18.08
[platform/upstream/armnn.git] / src / armnn / backends / ClWorkloads / ClDepthwiseConvolutionUint8Workload.cpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
4 //
5
6 #include "ClDepthwiseConvolutionUint8Workload.hpp"
7
8 #include "backends/CpuTensorHandle.hpp"
9
10 namespace armnn
11 {
12
13 ClDepthwiseConvolutionUint8Workload::ClDepthwiseConvolutionUint8Workload(
14     const DepthwiseConvolution2dQueueDescriptor& descriptor,
15     const WorkloadInfo& info)
16     : ClDepthwiseConvolutionBaseWorkload(descriptor, info)
17 {
18     InitialiseArmComputeClTensorData(*m_KernelTensor, m_Data.m_Weight->template GetConstTensor<uint8_t>());
19
20     if (m_BiasTensor)
21     {
22         InitialiseArmComputeClTensorData(*m_BiasTensor, m_Data.m_Bias->template GetConstTensor<int32_t>());
23     }
24
25     m_DepthwiseConvolutionLayer->prepare();
26     FreeUnusedTensors();
27 }
28
29 void ClDepthwiseConvolutionUint8Workload::Execute() const
30 {
31     ARMNN_SCOPED_PROFILING_EVENT_CL("ClDepthwiseConvolutionUint8Workload_Execute");
32     BOOST_ASSERT(m_DepthwiseConvolutionLayer);
33
34     m_DepthwiseConvolutionLayer->run();
35 }
36
37 } //namespace armnn
38