-//! This function is documented in the header file
-void free_gpu_info(const gmx_gpu_info_t gmx_unused *gpu_info)
-{
- if (gpu_info == nullptr)
- {
- return;
- }
-
- sfree(gpu_info->gpu_dev);
-}
-
-//! This function is documented in the header file
-std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info)
-{
- // Possible minor over-allocation here, but not important for anything
- std::vector<int> compatibleGpus;
- compatibleGpus.reserve(gpu_info.n_dev);
- for (int i = 0; i < gpu_info.n_dev; i++)
- {
- assert(gpu_info.gpu_dev);
- if (gpu_info.gpu_dev[i].stat == egpuCompatible)
- {
- compatibleGpus.push_back(i);
- }
- }
- return compatibleGpus;
-}
-
-//! This function is documented in the header file
-const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &gpu_info,
- int index)
-{
- return (index >= gpu_info.n_dev ?
- gpu_detect_res_str[egpuNonexistent] :
- gpu_detect_res_str[gpu_info.gpu_dev[index].stat]);
-}
-