Matteo Martincigh | 2135015 | 2018-11-28 16:22:22 +0000 | [diff] [blame^] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | #include <armnn/Types.hpp> |
| 7 | |
| 8 | namespace armnnUtils |
| 9 | { |
| 10 | |
| 11 | // Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout |
| 12 | class DataLayoutIndexed |
| 13 | { |
| 14 | public: |
| 15 | DataLayoutIndexed(armnn::DataLayout dataLayout); |
| 16 | |
| 17 | armnn::DataLayout GetDataLayout() const { return m_DataLayout; } |
| 18 | unsigned int GetChannelsIndex() const { return m_ChannelsIndex; } |
| 19 | unsigned int GetHeightIndex() const { return m_HeightIndex; } |
| 20 | unsigned int GetWidthIndex() const { return m_WidthIndex; } |
| 21 | |
| 22 | private: |
| 23 | armnn::DataLayout m_DataLayout; |
| 24 | unsigned int m_ChannelsIndex; |
| 25 | unsigned int m_HeightIndex; |
| 26 | unsigned int m_WidthIndex; |
| 27 | }; |
| 28 | |
| 29 | // Equality methods |
| 30 | bool operator==(const armnn::DataLayout& dataLayout, const DataLayoutIndexed& indexed); |
| 31 | bool operator==(const DataLayoutIndexed& indexed, const armnn::DataLayout& dataLayout); |
| 32 | |
| 33 | } // namespace armnnUtils |