blob: 1b1afca11a0b3469a71f21bc704c91a518982726 [file] [log] [blame]
Keith Davisa57eccb2019-06-14 17:33:22 +01001//
Mike Kelly7cbe7812023-07-25 17:37:33 +01002// Copyright © 2019,2021-2023 Arm Ltd and Contributors. All rights reserved.
Keith Davisa57eccb2019-06-14 17:33:22 +01003// SPDX-License-Identifier: MIT
4//
5
6#include "RefSpaceToDepthWorkload.hpp"
7#include "SpaceToDepth.hpp"
8
9#include "RefWorkloadUtils.hpp"
10#include <ResolveType.hpp>
11
12namespace armnn
13{
14
15void RefSpaceToDepthWorkload::Execute() const
16{
Finn Williamsb8181f72021-04-07 10:23:21 +010017 Execute(m_Data.m_Inputs, m_Data.m_Outputs);
18}
19
Matthew Sloyan2d213a72022-06-30 17:13:04 +010020void RefSpaceToDepthWorkload::ExecuteAsync(ExecutionData& executionData)
Finn Williamsb8181f72021-04-07 10:23:21 +010021{
Matthew Sloyan2d213a72022-06-30 17:13:04 +010022 WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
23 Execute(workingMemDescriptor->m_Inputs, workingMemDescriptor->m_Outputs);
Finn Williamsb8181f72021-04-07 10:23:21 +010024}
25
26void RefSpaceToDepthWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
27{
Mike Kelly7cbe7812023-07-25 17:37:33 +010028 ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefSpaceToDepthWorkload_Execute");
Keith Davisa57eccb2019-06-14 17:33:22 +010029
Finn Williamsb8181f72021-04-07 10:23:21 +010030 const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
31 std::unique_ptr<Decoder<float>> decoder = MakeDecoder<float>(inputInfo, inputs[0]->Map());
Keith Davisa57eccb2019-06-14 17:33:22 +010032
Finn Williamsb8181f72021-04-07 10:23:21 +010033 const TensorInfo& outputInfo = GetTensorInfo(outputs[0]);
34 std::unique_ptr<Encoder<float>> encoder = MakeEncoder<float>(outputInfo, outputs[0]->Map());
Keith Davisa57eccb2019-06-14 17:33:22 +010035
36 SpaceToDepth(inputInfo, outputInfo, m_Data.m_Parameters, *decoder, *encoder);
37}
38
39} //namespace armnn