blob: 1cf2a09e32d446c31e02fb5b775a1a68558f6f94 [file] [log] [blame]
Matteo Martincigh21350152018-11-28 16:22:22 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6#include <armnn/Types.hpp>
7
8namespace armnnUtils
9{
10
11// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout
12class DataLayoutIndexed
13{
14public:
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
22private:
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
30bool operator==(const armnn::DataLayout& dataLayout, const DataLayoutIndexed& indexed);
31bool operator==(const DataLayoutIndexed& indexed, const armnn::DataLayout& dataLayout);
32
33} // namespace armnnUtils