blob: 84d2db73633677a17b2ff976b0e52f2598e54e90 [file] [log] [blame]
Narumol Prangnawarat15effd82019-10-22 14:17:11 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <stdint.h>
9
10namespace armnn
11{
12
13namespace profiling
14{
15
16class ProfilingGuid
17{
18public:
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
53protected:
54 uint64_t m_Guid;
55};
56
57/// Strongly typed guids to distinguish between those generated at runtime, and those that are statically defined.
58struct ProfilingDynamicGuid : public ProfilingGuid
59{
60 using ProfilingGuid::ProfilingGuid;
61};
62
63struct ProfilingStaticGuid : public ProfilingGuid
64{
65 using ProfilingGuid::ProfilingGuid;
66};
67
68} // namespace profiling
69
70} // namespace armnn