Sadik Armagan | 9199e58 | 2019-09-05 17:35:31 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefAbsWorkload.hpp" |
| 7 | |
| 8 | #include "Abs.hpp" |
| 9 | #include "Decoders.hpp" |
| 10 | #include "Encoders.hpp" |
| 11 | #include "RefWorkloadUtils.hpp" |
| 12 | |
| 13 | #include <Profiling.hpp> |
| 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | void RefAbsWorkload::Execute() const |
| 19 | { |
| 20 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefAbsWorkload_Execute"); |
| 21 | |
| 22 | const TensorInfo& inputTensorInfo = GetTensorInfo(m_Data.m_Inputs[0]); |
| 23 | |
| 24 | std::unique_ptr<Decoder<float>> decoderPtr = MakeDecoder<float>(inputTensorInfo, m_Data.m_Inputs[0]->Map()); |
| 25 | Decoder<float>& decoder = *decoderPtr; |
| 26 | |
| 27 | const TensorInfo& outputTensorInfo = GetTensorInfo(m_Data.m_Outputs[0]); |
| 28 | |
| 29 | std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputTensorInfo, m_Data.m_Outputs[0]->Map()); |
| 30 | Encoder<float>& encoder = *encoderPtr; |
| 31 | |
| 32 | Abs(decoder, |
| 33 | encoder, |
| 34 | inputTensorInfo); |
| 35 | } |
| 36 | |
| 37 | } //namespace armnn |