telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #include "RefConvertFp16ToFp32Workload.hpp" |
| 7 | #include "Half.hpp" |
| 8 | #include "RefWorkloadUtils.hpp" |
| 9 | #include "FloatingPointConverter.hpp" |
| 10 | |
| 11 | namespace armnn |
| 12 | { |
| 13 | |
| 14 | void RefConvertFp16ToFp32Workload::Execute() const |
| 15 | { |
| 16 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefConvertFp16ToFp32Workload_Execute"); |
| 17 | |
| 18 | const Half* const input = GetInputTensorDataHalf(0, m_Data); |
| 19 | float* const output = GetOutputTensorDataFloat(0, m_Data); |
| 20 | |
| 21 | unsigned int numElements = GetTensorInfo(m_Data.m_Inputs[0]).GetNumElements(); |
| 22 | armnnUtils::FloatingPointConverter::ConvertFloat16To32(input, numElements, output); |
| 23 | } |
| 24 | |
| 25 | } //namespace armnn |