9 static bool initialized =
false;
10 static uint32_t current_gpu_id = 0;
11 uint32_t new_gpu_id = config.
GetGpuId();
12 if (!initialized || new_gpu_id != current_gpu_id)
17 if (device_count == 0)
21 else if (device_count <= new_gpu_id)
23 Logger::log(Logger::INFO,
24 "[Info] Device %d not found! Changing to %d...",
30 current_gpu_id = new_gpu_id;
Config & SetGpuId(const uint8_t gpu_id)
Set the ID of the GPU used.
uint8_t GetGpuId() const
Return the ID of the GPU used.
This is the top-level namespace of the project.
void Init(genie::Config &config)
Config class holds all user configurable settings of GENIE.
#define CUDA_CHECK_ERROR(err)