Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefSpaceToDepthWorkload.hpp" |
| 7 | #include "SpaceToDepth.hpp" |
| 8 | |
| 9 | #include "RefWorkloadUtils.hpp" |
| 10 | #include <ResolveType.hpp> |
| 11 | |
| 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | void RefSpaceToDepthWorkload::Execute() const |
| 16 | { |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 17 | Execute(m_Data.m_Inputs, m_Data.m_Outputs); |
| 18 | } |
| 19 | |
| 20 | void RefSpaceToDepthWorkload::ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) |
| 21 | { |
| 22 | Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs); |
| 23 | } |
| 24 | |
| 25 | void RefSpaceToDepthWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const |
| 26 | { |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 27 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefSpaceToDepthWorkload_Execute"); |
| 28 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 29 | const TensorInfo& inputInfo = GetTensorInfo(inputs[0]); |
| 30 | std::unique_ptr<Decoder<float>> decoder = MakeDecoder<float>(inputInfo, inputs[0]->Map()); |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 31 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 32 | const TensorInfo& outputInfo = GetTensorInfo(outputs[0]); |
| 33 | std::unique_ptr<Encoder<float>> encoder = MakeEncoder<float>(outputInfo, outputs[0]->Map()); |
Keith Davis | a57eccb | 2019-06-14 17:33:22 +0100 | [diff] [blame] | 34 | |
| 35 | SpaceToDepth(inputInfo, outputInfo, m_Data.m_Parameters, *decoder, *encoder); |
| 36 | } |
| 37 | |
| 38 | } //namespace armnn |