blob: 17ecd293078d663ea1040e95b5114cbfa0ee48a8 [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
arovir019e53a352018-08-31 15:26:35 +01006#include "ClDepthwiseConvolutionFloatWorkload.hpp"
telsoa01c577f2c2018-08-31 09:22:23 +01007
David Beckac42efd2018-09-26 17:41:13 +01008#include <backends/CpuTensorHandle.hpp>
telsoa014fcda012018-03-09 14:13:49 +00009
Matthew Bentham14e46692018-09-20 15:35:30 +010010#include "ClWorkloadUtils.hpp"
11
telsoa014fcda012018-03-09 14:13:49 +000012namespace armnn
13{
14
arovir019e53a352018-08-31 15:26:35 +010015ClDepthwiseConvolutionFloatWorkload::ClDepthwiseConvolutionFloatWorkload(
telsoa014fcda012018-03-09 14:13:49 +000016 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
arovir019e53a352018-08-31 15:26:35 +010031void ClDepthwiseConvolutionFloatWorkload::Execute() const
telsoa014fcda012018-03-09 14:13:49 +000032{
arovir019e53a352018-08-31 15:26:35 +010033 ARMNN_SCOPED_PROFILING_EVENT_CL("ClDepthwiseConvolutionFloatWorkload_Execute");
telsoa01c577f2c2018-08-31 09:22:23 +010034 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