Added definition GPU_SUPPORT to toggle GPU related code

This commit is contained in:
aristocratos
2023-11-25 20:44:45 +01:00
parent 975525d38f
commit b87772611c
11 changed files with 198 additions and 34 deletions

View File

@@ -271,11 +271,18 @@ namespace Input {
}
else if (key.size() == 1 and isint(key)) {
auto intKey = stoi(key);
#ifdef GPU_SUPPORT
static const array<string, 10> boxes = {"gpu5", "cpu", "mem", "net", "proc", "gpu0", "gpu1", "gpu2", "gpu3", "gpu4"};
if ((intKey == 0 and Gpu::gpu_names.size() < 5) or (intKey >= 5 and std::cmp_less(Gpu::gpu_names.size(), intKey - 4)))
return;
#else
static const array<string, 10> boxes = {"", "cpu", "mem", "net", "proc"};
if (intKey == 0 or intKey > 4)
return;
#endif
atomic_wait(Runner::active);
Config::current_preset = -1;
static const array<string, 10> boxes = {"gpu5", "cpu", "mem", "net", "proc", "gpu0", "gpu1", "gpu2", "gpu3", "gpu4"};
Config::toggle_box(boxes.at(intKey));
Draw::calcSizes();
Runner::run("all", false, true);