[v0.25] Add option to print all GPUs as requested in #33

This commit is contained in:
Dr-Noob
2022-12-03 18:04:50 +01:00
parent 06dc50b6a5
commit 774550307c
4 changed files with 41 additions and 27 deletions

View File

@@ -81,15 +81,6 @@ int get_num_gpus_available(struct gpu_list* list) {
return list->num_gpus;
}
bool gpu_idx_valid(int idx) {
if(idx < 0) {
printErr("Specified GPU index is out of range: %d. ", idx);
printf("Run gpufetch with the --%s option to check out valid GPU indexes\n", args_str[ARG_LIST]);
return false;
}
return true;
}
struct gpu_info* get_gpu_info(struct gpu_list* list, int idx) {
if(idx >= list->num_gpus || idx < 0) {
printErr("Specified GPU index is out of range: %d", idx);