nikraj01 | 99a6631 | 2019-06-06 10:31:27 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefRsqrtWorkload.hpp" |
| 7 | |
| 8 | #include "Decoders.hpp" |
| 9 | #include "Encoders.hpp" |
| 10 | #include "RefWorkloadUtils.hpp" |
| 11 | #include "Rsqrt.hpp" |
| 12 | |
| 13 | #include <Profiling.hpp> |
| 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | void RefRsqrtWorkload::Execute() const |
| 19 | { |
| 20 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefRsqrtWorkload_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 | Rsqrt(decoder, |
| 33 | encoder, |
| 34 | GetTensorInfo(m_Data.m_Inputs[0])); |
| 35 | } |
| 36 | |
| 37 | } //namespace armnn |