1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace processor 5 { 6 // clang-format off 7 8 enum class ProcessorType{ 9 Invalid, 10 CPU, 11 GPU, 12 FPGA, 13 DSP, 14 Accelerator, 15 Core, 16 Thread, 17 OEM, 18 }; 19 20 enum class ProcessorMemoryType{ 21 Invalid, 22 L1Cache, 23 L2Cache, 24 L3Cache, 25 L4Cache, 26 L5Cache, 27 L6Cache, 28 L7Cache, 29 HBM1, 30 HBM2, 31 HBM3, 32 SGRAM, 33 GDDR, 34 GDDR2, 35 GDDR3, 36 GDDR4, 37 GDDR5, 38 GDDR5X, 39 GDDR6, 40 DDR, 41 DDR2, 42 DDR3, 43 DDR4, 44 DDR5, 45 SDRAM, 46 SRAM, 47 Flash, 48 OEM, 49 }; 50 51 enum class FpgaType{ 52 Invalid, 53 Integrated, 54 Discrete, 55 }; 56 57 enum class SystemInterfaceType{ 58 Invalid, 59 QPI, 60 UPI, 61 PCIe, 62 Ethernet, 63 AMBA, 64 CCIX, 65 CXL, 66 OEM, 67 }; 68 69 enum class TurboState{ 70 Invalid, 71 Enabled, 72 Disabled, 73 }; 74 75 enum class BaseSpeedPriorityState{ 76 Invalid, 77 Enabled, 78 Disabled, 79 }; 80 81 enum class ThrottleCause{ 82 Invalid, 83 PowerLimit, 84 ThermalLimit, 85 ClockLimit, 86 Unknown, 87 OEM, 88 }; 89 90 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorType, { 91 {ProcessorType::Invalid, "Invalid"}, 92 {ProcessorType::CPU, "CPU"}, 93 {ProcessorType::GPU, "GPU"}, 94 {ProcessorType::FPGA, "FPGA"}, 95 {ProcessorType::DSP, "DSP"}, 96 {ProcessorType::Accelerator, "Accelerator"}, 97 {ProcessorType::Core, "Core"}, 98 {ProcessorType::Thread, "Thread"}, 99 {ProcessorType::OEM, "OEM"}, 100 }); 101 102 NLOHMANN_JSON_SERIALIZE_ENUM(ProcessorMemoryType, { 103 {ProcessorMemoryType::Invalid, "Invalid"}, 104 {ProcessorMemoryType::L1Cache, "L1Cache"}, 105 {ProcessorMemoryType::L2Cache, "L2Cache"}, 106 {ProcessorMemoryType::L3Cache, "L3Cache"}, 107 {ProcessorMemoryType::L4Cache, "L4Cache"}, 108 {ProcessorMemoryType::L5Cache, "L5Cache"}, 109 {ProcessorMemoryType::L6Cache, "L6Cache"}, 110 {ProcessorMemoryType::L7Cache, "L7Cache"}, 111 {ProcessorMemoryType::HBM1, "HBM1"}, 112 {ProcessorMemoryType::HBM2, "HBM2"}, 113 {ProcessorMemoryType::HBM3, "HBM3"}, 114 {ProcessorMemoryType::SGRAM, "SGRAM"}, 115 {ProcessorMemoryType::GDDR, "GDDR"}, 116 {ProcessorMemoryType::GDDR2, "GDDR2"}, 117 {ProcessorMemoryType::GDDR3, "GDDR3"}, 118 {ProcessorMemoryType::GDDR4, "GDDR4"}, 119 {ProcessorMemoryType::GDDR5, "GDDR5"}, 120 {ProcessorMemoryType::GDDR5X, "GDDR5X"}, 121 {ProcessorMemoryType::GDDR6, "GDDR6"}, 122 {ProcessorMemoryType::DDR, "DDR"}, 123 {ProcessorMemoryType::DDR2, "DDR2"}, 124 {ProcessorMemoryType::DDR3, "DDR3"}, 125 {ProcessorMemoryType::DDR4, "DDR4"}, 126 {ProcessorMemoryType::DDR5, "DDR5"}, 127 {ProcessorMemoryType::SDRAM, "SDRAM"}, 128 {ProcessorMemoryType::SRAM, "SRAM"}, 129 {ProcessorMemoryType::Flash, "Flash"}, 130 {ProcessorMemoryType::OEM, "OEM"}, 131 }); 132 133 NLOHMANN_JSON_SERIALIZE_ENUM(FpgaType, { 134 {FpgaType::Invalid, "Invalid"}, 135 {FpgaType::Integrated, "Integrated"}, 136 {FpgaType::Discrete, "Discrete"}, 137 }); 138 139 NLOHMANN_JSON_SERIALIZE_ENUM(SystemInterfaceType, { 140 {SystemInterfaceType::Invalid, "Invalid"}, 141 {SystemInterfaceType::QPI, "QPI"}, 142 {SystemInterfaceType::UPI, "UPI"}, 143 {SystemInterfaceType::PCIe, "PCIe"}, 144 {SystemInterfaceType::Ethernet, "Ethernet"}, 145 {SystemInterfaceType::AMBA, "AMBA"}, 146 {SystemInterfaceType::CCIX, "CCIX"}, 147 {SystemInterfaceType::CXL, "CXL"}, 148 {SystemInterfaceType::OEM, "OEM"}, 149 }); 150 151 NLOHMANN_JSON_SERIALIZE_ENUM(TurboState, { 152 {TurboState::Invalid, "Invalid"}, 153 {TurboState::Enabled, "Enabled"}, 154 {TurboState::Disabled, "Disabled"}, 155 }); 156 157 NLOHMANN_JSON_SERIALIZE_ENUM(BaseSpeedPriorityState, { 158 {BaseSpeedPriorityState::Invalid, "Invalid"}, 159 {BaseSpeedPriorityState::Enabled, "Enabled"}, 160 {BaseSpeedPriorityState::Disabled, "Disabled"}, 161 }); 162 163 NLOHMANN_JSON_SERIALIZE_ENUM(ThrottleCause, { 164 {ThrottleCause::Invalid, "Invalid"}, 165 {ThrottleCause::PowerLimit, "PowerLimit"}, 166 {ThrottleCause::ThermalLimit, "ThermalLimit"}, 167 {ThrottleCause::ClockLimit, "ClockLimit"}, 168 {ThrottleCause::Unknown, "Unknown"}, 169 {ThrottleCause::OEM, "OEM"}, 170 }); 171 172 } 173 // clang-format on 174