telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [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 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #include "RefFloorFloat32Workload.hpp" |
| 7 | |
| 8 | #include "RefWorkloadUtils.hpp" |
| 9 | |
| 10 | #include "Profiling.hpp" |
| 11 | |
| 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | void RefFloorFloat32Workload::Execute() const |
| 16 | { |
| 17 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefFloorFloat32Workload_Execute"); |
| 18 | |
| 19 | const float* const input = GetInputTensorDataFloat(0, m_Data); |
| 20 | float* const output = GetOutputTensorDataFloat(0, m_Data); |
| 21 | |
| 22 | unsigned int numElements = GetTensorInfo(m_Data.m_Inputs[0]).GetNumElements(); |
| 23 | for (unsigned int i = 0; i < numElements; ++i) |
| 24 | { |
| 25 | output[i] = floorf(input[i]); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | } //namespace armnn |