blob: 756e9587532dd22fc8b2418246d3ef71333a1c8b [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 "RefDepthwiseConvolution2dFloat32Workload.hpp"
7
8#include "ConvImpl.hpp"
9#include "RefWorkloadUtils.hpp"
10
11#include "Profiling.hpp"
12
13namespace armnn
14{
telsoa01c577f2c2018-08-31 09:22:23 +010015RefDepthwiseConvolution2dFloat32Workload::RefDepthwiseConvolution2dFloat32Workload(
16 const DepthwiseConvolution2dQueueDescriptor& descriptor, const WorkloadInfo& info)
17 : Float32Workload<DepthwiseConvolution2dQueueDescriptor>(descriptor, info),
18 m_Weight(std::make_unique<ScopedCpuTensorHandle>(*(descriptor.m_Weight))),
19 m_Bias(descriptor.m_Parameters.m_BiasEnabled
20 ? std::make_unique<ScopedCpuTensorHandle>(*(descriptor.m_Bias)) : nullptr) {}
telsoa014fcda012018-03-09 14:13:49 +000021
22void RefDepthwiseConvolution2dFloat32Workload::Execute() const
23{
24 ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefDepthwiseConvolution2dFloat32Workload_Execute");
25
telsoa014fcda012018-03-09 14:13:49 +000026 const float* inputData = GetInputTensorDataFloat(0, m_Data);
telsoa01c577f2c2018-08-31 09:22:23 +010027 const float* weightData = m_Weight->template GetConstTensor<float>();
Matteo Martincigh747ef822018-12-18 09:26:39 +000028 const float* biasData = m_Data.m_Parameters.m_BiasEnabled ? m_Bias->template GetConstTensor<float>() : nullptr;
telsoa01c577f2c2018-08-31 09:22:23 +010029 const TensorInfo& filterInfo = m_Weight->GetTensorInfo();
telsoa014fcda012018-03-09 14:13:49 +000030
31 ConvImpl<armnn::DepthwiseConvolution2dQueueDescriptor, float, float, float>
Matteo Martincigh747ef822018-12-18 09:26:39 +000032 (m_Data, inputData, 0.0f, 0, weightData, 0.0f, 0, biasData, 0.0f, 0, filterInfo, true);
telsoa014fcda012018-03-09 14:13:49 +000033}
34
35} //namespace armnn