Narumol Prangnawarat | 15effd8 | 2019-10-22 14:17:11 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2019 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | |
| 13 | namespace profiling |
| 14 | { |
| 15 | |
| 16 | class ProfilingGuid |
| 17 | { |
| 18 | public: |
| 19 | ProfilingGuid(uint64_t guid) : m_Guid(guid) {} |
| 20 | |
| 21 | operator uint64_t () const { return m_Guid; } |
| 22 | |
| 23 | bool operator==(const ProfilingGuid& other) const |
| 24 | { |
| 25 | return m_Guid == other.m_Guid; |
| 26 | } |
| 27 | |
| 28 | bool operator!=(const ProfilingGuid& other) const |
| 29 | { |
| 30 | return !(*this == other); |
| 31 | } |
| 32 | |
| 33 | bool operator<(const ProfilingGuid& other) const |
| 34 | { |
| 35 | return m_Guid < other.m_Guid; |
| 36 | } |
| 37 | |
| 38 | bool operator<=(const ProfilingGuid& other) const |
| 39 | { |
| 40 | return m_Guid <= other.m_Guid; |
| 41 | } |
| 42 | |
| 43 | bool operator>(const ProfilingGuid& other) const |
| 44 | { |
| 45 | return m_Guid > other.m_Guid; |
| 46 | } |
| 47 | |
| 48 | bool operator>=(const ProfilingGuid& other) const |
| 49 | { |
| 50 | return m_Guid >= other.m_Guid; |
| 51 | } |
| 52 | |
| 53 | protected: |
| 54 | uint64_t m_Guid; |
| 55 | }; |
| 56 | |
| 57 | /// Strongly typed guids to distinguish between those generated at runtime, and those that are statically defined. |
| 58 | struct ProfilingDynamicGuid : public ProfilingGuid |
| 59 | { |
| 60 | using ProfilingGuid::ProfilingGuid; |
| 61 | }; |
| 62 | |
| 63 | struct ProfilingStaticGuid : public ProfilingGuid |
| 64 | { |
| 65 | using ProfilingGuid::ProfilingGuid; |
| 66 | }; |
| 67 | |
| 68 | } // namespace profiling |
| 69 | |
| 70 | } // namespace armnn |