Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 1 | // |
Matthew Sloyan | 21a6a1a | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 2 | // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. |
Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefPooling3dWorkload.hpp" |
| 7 | |
| 8 | #include "Pooling3d.hpp" |
| 9 | #include "RefWorkloadUtils.hpp" |
| 10 | |
| 11 | #include "Profiling.hpp" |
| 12 | #include "BaseIterator.hpp" |
| 13 | |
| 14 | namespace armnn |
| 15 | { |
| 16 | void RefPooling3dWorkload::Execute() const |
| 17 | { |
| 18 | Execute(m_Data.m_Inputs, m_Data.m_Outputs); |
| 19 | } |
| 20 | |
Matthew Sloyan | 21a6a1a | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 21 | void RefPooling3dWorkload::ExecuteAsync(ExecutionData& executionData) |
Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 22 | { |
Matthew Sloyan | 21a6a1a | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 23 | WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data); |
| 24 | Execute(workingMemDescriptor->m_Inputs, workingMemDescriptor->m_Outputs); |
Tamás Nyíri | 7b885b3 | 2021-10-26 14:47:57 +0100 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | void RefPooling3dWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const |
| 28 | { |
| 29 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefPooling3dWorkload_Execute"); |
| 30 | |
| 31 | const TensorInfo& inputInfo = GetTensorInfo(inputs[0]); |
| 32 | const TensorInfo& outputInfo = GetTensorInfo(outputs[0]); |
| 33 | |
| 34 | auto inputDecoder = MakeDecoder<float>(inputInfo, inputs[0] ->Map()); |
| 35 | auto outputEncoder = MakeEncoder<float>(outputInfo, outputs[0]->Map()); |
| 36 | |
| 37 | Pooling3d(*inputDecoder, |
| 38 | *outputEncoder, |
| 39 | inputInfo, |
| 40 | outputInfo, |
| 41 | m_Data.m_Parameters); |
| 42 | } |
| 43 | } //namespace armnn |