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 "RefPooling2dUint8Workload.hpp" |
| 7 | |
| 8 | #include "Pooling2d.hpp" |
| 9 | #include "RefWorkloadUtils.hpp" |
| 10 | |
| 11 | #include "Profiling.hpp" |
| 12 | |
| 13 | #include <vector> |
| 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | void RefPooling2dUint8Workload::Execute() const |
| 19 | { |
| 20 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefPooling2dUint8Workload_Execute"); |
| 21 | |
| 22 | const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]); |
| 23 | const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]); |
| 24 | |
| 25 | auto dequant = Dequantize(GetInputTensorDataU8(0, m_Data), inputInfo); |
| 26 | |
| 27 | std::vector<float> results(outputInfo.GetNumElements()); |
| 28 | Pooling2d(dequant.data(), |
| 29 | results.data(), |
| 30 | inputInfo, |
| 31 | outputInfo, |
| 32 | m_Data.m_Parameters); |
| 33 | |
| 34 | Quantize(GetOutputTensorDataU8(0, m_Data), results.data(), outputInfo); |
| 35 | } |
| 36 | |
| 37 | } //namespace armnn |