Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <backendsCommon/Workload.hpp> |
| 9 | #include <backendsCommon/WorkloadData.hpp> |
| 10 | |
| 11 | #include "RefWorkloadUtils.hpp" |
| 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | struct RefRankWorkload : public BaseWorkload<RankQueueDescriptor> |
| 17 | { |
| 18 | public: |
| 19 | using BaseWorkload<RankQueueDescriptor>::BaseWorkload; |
| 20 | virtual void Execute() const override |
| 21 | { |
| 22 | const int32_t rank = static_cast<int32_t>(GetTensorInfo(m_Data.m_Inputs[0]).GetNumDimensions()); |
| 23 | |
| 24 | std::memcpy(GetOutputTensorData<void>(0, m_Data), &rank, sizeof(int32_t)); |
David Monahan | c11ba46 | 2020-12-03 11:09:46 +0000 | [diff] [blame] | 25 | m_Data.m_Outputs[0]->Unmap(); |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 26 | } |
| 27 | }; |
| 28 | |
| 29 | } //namespace armnn |
| 30 | |
| 31 | |
| 32 | |
| 33 | |