Release 18.08
[platform/upstream/armnn.git] / src / armnn / backends / ClWorkloads / ClDepthwiseConvolutionFloat32Workload.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 "ClDepthwiseConvolutionFloat32Workload.hpp"
7
8 #include "backends/ClWorkloadUtils.hpp"
9 #include "backends/CpuTensorHandle.hpp"
10
11 namespace armnn
12 {
13
14 ClDepthwiseConvolutionFloat32Workload::ClDepthwiseConvolutionFloat32Workload(
15     const DepthwiseConvolution2dQueueDescriptor& descriptor,
16     const WorkloadInfo& info)
17     : ClDepthwiseConvolutionBaseWorkload(descriptor, info)
18 {
19     InitializeArmComputeClTensorDataForFloatTypes(*m_KernelTensor, m_Data.m_Weight);
20
21     if (m_BiasTensor)
22     {
23         InitializeArmComputeClTensorDataForFloatTypes(*m_BiasTensor, m_Data.m_Bias);
24     }
25
26     m_DepthwiseConvolutionLayer->prepare();
27     FreeUnusedTensors();
28 }
29
30 void ClDepthwiseConvolutionFloat32Workload::Execute() const
31 {
32     ARMNN_SCOPED_PROFILING_EVENT_CL("ClDepthwiseConvolutionFloat32Workload_Execute");
33     BOOST_ASSERT(m_DepthwiseConvolutionLayer);
34
35     m_DepthwiseConvolutionLayer->run();
36 }
37
38 } //namespace armnn