[v0.20] Print help message when no GPU is detected to help people understand whats going on

This commit is contained in:
Dr-Noob
2021-12-21 17:02:08 +01:00
parent 3e9f72fcf0
commit a20e93f4db
6 changed files with 70 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
#include <cstdlib>
#include <cstdio>
#include "colors.hpp"
#include "master.hpp"
#include "../cuda/cuda.hpp"
#include "../intel/intel.hpp"
@@ -56,6 +57,27 @@ bool print_gpus_list(struct gpu_list* list) {
return true;
}
void print_enabled_backends() {
printf("- CUDA backend: ");
#ifdef BACKEND_CUDA
printf("%sON%s\n", C_FG_GREEN, C_RESET);
#else
printf("%sOFF%s\n", C_FG_RED, C_RESET);
#endif
printf("- Intel backend: ");
#ifdef BACKEND_INTEL
printf("%sON%s\n", C_FG_GREEN, C_RESET);
#else
printf("%sOFF%s\n", C_FG_RED, C_RESET);
#endif
}
int get_num_gpus_available(struct gpu_list* list) {
return list->num_gpus;
}
struct gpu_info* get_gpu_info(struct gpu_list* list, int idx) {
return list->gpus[idx];
}