David Monahan | 97451b4 | 2020-12-03 09:48:06 +0000 | [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 "NeonWorkloadUtils.hpp" |
| 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | struct NeonRankWorkload : public BaseWorkload<RankQueueDescriptor> |
| 17 | { |
| 18 | public: |
| 19 | using BaseWorkload<RankQueueDescriptor>::BaseWorkload; |
| 20 | virtual void Execute() const override |
| 21 | { |
| 22 | const NeonTensorHandle* neonTensorHandle = PolymorphicDowncast<const NeonTensorHandle*>(m_Data.m_Inputs[0]); |
| 23 | const int32_t rank = static_cast<int32_t>(neonTensorHandle->GetShape().GetNumDimensions()); |
| 24 | |
| 25 | std::memcpy(GetOutputTensorData<void>(0, m_Data), &rank, sizeof(int32_t)); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | } //namespace armnn |