IVGCVSW-1946: Remove armnn/src from the include paths
[platform/upstream/armnn.git] / src / backends / reference / workloads / RefConvertFp16ToFp32Workload.cpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5
6 #include "RefConvertFp16ToFp32Workload.hpp"
7
8 #include "RefWorkloadUtils.hpp"
9 #include "FloatingPointConverter.hpp"
10
11 #include <Half.hpp>
12
13 namespace armnn
14 {
15
16 void RefConvertFp16ToFp32Workload::Execute() const
17 {
18     ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefConvertFp16ToFp32Workload_Execute");
19
20     const Half* const input = GetInputTensorDataHalf(0, m_Data);
21     float* const output = GetOutputTensorDataFloat(0, m_Data);
22
23     unsigned int numElements = GetTensorInfo(m_Data.m_Inputs[0]).GetNumElements();
24     armnnUtils::FloatingPointConverter::ConvertFloat16To32(input, numElements, output);
25 }
26
27 } //namespace armnn