ArmNN
 21.11
ClRankWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
10 
11 #include "ClWorkloadUtils.hpp"
12 
13 namespace armnn
14 {
15 
16 struct ClRankWorkload : public BaseWorkload<RankQueueDescriptor>
17 {
18 public:
20  virtual void Execute() const override
21  {
22  const ClTensorHandle* clTensorHandle = PolymorphicDowncast<const ClTensorHandle*>(m_Data.m_Inputs[0]);
23  const int32_t rank = static_cast<int32_t>(clTensorHandle->GetShape().GetNumDimensions());
24 
25  std::memcpy(GetOutputTensorData<void>(0, m_Data), &rank, sizeof(int32_t));
26  m_Data.m_Outputs[0]->Unmap();
27  }
28 };
29 
30 } //namespace armnn
TensorShape GetShape() const override
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
Copyright (c) 2021 ARM Limited and Contributors.
virtual void Execute() const override
std::vector< ITensorHandle * > m_Outputs
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition: Tensor.cpp:174
std::vector< ITensorHandle * > m_Inputs