blob: 4ea55904864a7144a397480d37e9f77f14ff1cba [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
6#include "ClDepthwiseConvolutionUint8Workload.hpp"
telsoa01c577f2c2018-08-31 09:22:23 +01007
telsoa014fcda012018-03-09 14:13:49 +00008#include "backends/CpuTensorHandle.hpp"
9
Matthew Bentham14e46692018-09-20 15:35:30 +010010#include "ClWorkloadUtils.hpp"
11
telsoa014fcda012018-03-09 14:13:49 +000012namespace armnn
13{
14
telsoa014fcda012018-03-09 14:13:49 +000015ClDepthwiseConvolutionUint8Workload::ClDepthwiseConvolutionUint8Workload(
16 const DepthwiseConvolution2dQueueDescriptor& descriptor,
17 const WorkloadInfo& info)
telsoa01c577f2c2018-08-31 09:22:23 +010018 : ClDepthwiseConvolutionBaseWorkload(descriptor, info)
telsoa014fcda012018-03-09 14:13:49 +000019{
Matthew Bentham785df502018-09-21 10:29:58 +010020 InitializeArmComputeClTensorData(*m_KernelTensor, m_Data.m_Weight);
telsoa01c577f2c2018-08-31 09:22:23 +010021
22 if (m_BiasTensor)
23 {
Matthew Bentham785df502018-09-21 10:29:58 +010024 InitializeArmComputeClTensorData(*m_BiasTensor, m_Data.m_Bias);
telsoa01c577f2c2018-08-31 09:22:23 +010025 }
26
27 m_DepthwiseConvolutionLayer->prepare();
28 FreeUnusedTensors();
telsoa014fcda012018-03-09 14:13:49 +000029}
30
31void ClDepthwiseConvolutionUint8Workload::Execute() const
32{
telsoa01c577f2c2018-08-31 09:22:23 +010033 ARMNN_SCOPED_PROFILING_EVENT_CL("ClDepthwiseConvolutionUint8Workload_Execute");
34 BOOST_ASSERT(m_DepthwiseConvolutionLayer);
telsoa014fcda012018-03-09 14:13:49 +000035
telsoa01c577f2c2018-08-31 09:22:23 +010036 m_DepthwiseConvolutionLayer->run();
telsoa014fcda012018-03-09 14:13:49 +000037}
38
39} //namespace armnn
40