sys-sage
Loading...
Searching...
No Matches
enums.hpp
1#ifndef ENUMS_HPP
2#define ENUMS_HPP
3
4#include <cstdint>
5#include <unordered_map>
6
7
8namespace sys_sage {
9
13
22 namespace ComponentType{
23 using type = int32_t;
25 constexpr type Any = -1;
26 constexpr type Generic = 1;
27 [[ deprecated("Use ComponentType::Generic instead. This constant will be removed in the future (used up until version 1.0.0).") ]]
28 constexpr type None = Generic;
29 constexpr type Thread = 2;
30 constexpr type Core = 3;
31 constexpr type Cache = 4;
32 constexpr type Subdivision = 5;
33 constexpr type Numa = 6;
34 constexpr type Chip = 7;
35 constexpr type Memory = 8;
36 constexpr type Storage = 9;
37 constexpr type Node = 10;
38 constexpr type QuantumBackend = 11;
39 constexpr type AtomSite = 12;
40 constexpr type Qubit = 13;
41 constexpr type Topology = 14;
43 //SVTODO this should remain private???
44 static const std::unordered_map<type, const char*> names = {
45 {Generic, "GenericComponent"},
46 {Thread, "HW_Thread"},
47 {Core, "Core"},
48 {Cache, "Cache"},
49 {Subdivision, "Subdivision"},
50 {Numa, "NUMA"},
51 {Chip, "Chip"},
52 {Memory, "Memory"},
53 {Storage, "Storage"},
54 {Node, "Node"},
55 {QuantumBackend, "QuantumBackend"},
56 {AtomSite, "AtomSite"},
57 {Qubit, "Qubit"},
58 {Topology, "Topology"}
59 };
60
69 inline const char* ToString(type rt) {
70 auto it = names.find(rt);
71 if (it != names.end()) return it->second;
72 return "Unknown";
73 }
74 }
75
80 namespace SubdivisionType {
81 using type = int32_t;
83 constexpr type None = 1;
84 constexpr type GpuSM = 2;
85 }
86
91 namespace ChipType {
92 using type = int32_t;
94 constexpr type None = 1;
95 constexpr type Cpu = 2;
96 constexpr type CpuSocket = 3;
97 constexpr type Gpu = 4;
98 }
99
103
110 namespace RelationType{
111 using type = int32_t;
113 constexpr type Any = -1;
114 constexpr type Relation = 0;
115 constexpr type DataPath = 1;
116 constexpr type QuantumGate = 2;
117 constexpr type CouplingMap = 3;
118 constexpr type _num_relation_types = 4;
119
120 constexpr type RelationTypeList [_num_relation_types] = {
121 Relation,
122 DataPath,
123 QuantumGate,
124 CouplingMap,
125 };
126
127 //SVTODO this should remain private???
128 static const std::unordered_map<type, const char*> names = {
129 {Any, "Any"},
130 {Relation, "Relation"},
131 {DataPath, "DataPath"},
132 {QuantumGate, "QuantumGate"},
133 {CouplingMap, "CouplingMap"}
134 };
135
143 inline const char* ToString(type rt) {
144 auto it = names.find(rt);
145 if (it != names.end()) return it->second;
146 return "Unknown";
147 }
148 }
149
153 namespace RelationCategory {
154 using type = int32_t;
156 constexpr type Any = -1;
157 constexpr type Default = 0;
158#ifdef SS_PAPI
159 constexpr type PAPI_Metrics = 1;
160#endif
161 }
162
169 namespace DataPathType{
170 using type = int32_t;
172 constexpr type Any = -1;
173 constexpr type None = 0;
174 constexpr type Logical = 1;
175 constexpr type Physical = 2;
176 constexpr type Datatransfer = 3;
177 constexpr type L3CAT = 4;
178 constexpr type MIG = 5;
179 constexpr type C2C = 6;
180 }
185 namespace DataPathDirection{
186 using type = int32_t;
188 constexpr type Any = 1;
189 constexpr type Outgoing = 2;
190 constexpr type Incoming = 3;
191 }
192
193 //SVTODO rename this to RelationOrientation? oriented x not oriented and include this also into general Relation, rather than just DataPath?
198 namespace DataPathOrientation{
199 using type = int32_t;
201 constexpr type Oriented = 1;
202 constexpr type Bidirectional = 2;
203 }
208 namespace QuantumGateType{
209 using type = int32_t;
211 constexpr type Unknown = 0;
212 constexpr type Id = 1;
213 constexpr type X = 2;
214 constexpr type Rz = 3;
215 constexpr type Cnot = 4;
216 constexpr type Sx = 5;
217 constexpr type Toffoli = 6;
219 //SVTODO this should remain private???
220 static const std::unordered_map<type, const char*> names = {
221 {Unknown, "Unknown"},
222 {Id, "Id"},
223 {X, "X"},
224 {Rz, "Rz"},
225 {Cnot, "Cnot"},
226 {Sx, "Sx"},
227 {Toffoli, "Toffoli"}
228 };
229
236 inline const char* ToString(type rt) {
237 auto it = names.find(rt);
238 if (it != names.end()) return it->second;
239 return "Unknown";
240 }
241 }
242
243
244}
245#endif //ENUMS_HPP
Enumerates chip types (CPU, GPU, etc.).
Enumerates all supported component types in sys-sage.
Enumerates directionality for DataPaths.
Enumerates orientation (directed/bidirectional) for DataPaths.
Enumerates types of DataPaths (logical, physical, etc.).
Enumerates quantum gate types.
Enumerates all supported relation types in sys-sage.
Enumerates subdivision types for components (e.g., GPU SMs).
constexpr type Any
Definition enums.hpp:156
int32_t type
Definition enums.hpp:154
constexpr type Default
Definition enums.hpp:157