Browse Source

nvml: add missing ifdef for vendors

master
Tanguy Pruvot 10 years ago
parent
commit
aa271104c1
  1. 5
      cuda.cpp

5
cuda.cpp

@ -75,14 +75,15 @@ void cuda_devicenames()
free(device_name[i]); free(device_name[i]);
device_name[i] = NULL; device_name[i] = NULL;
} }
#ifdef USE_WRAPNVML
if (gpu_vendor(props.pciBusID, vendorname) > 0 && strlen(vendorname)) { if (gpu_vendor((uint8_t)props.pciBusID, vendorname) > 0 && strlen(vendorname)) {
device_name[i] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2); device_name[i] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2);
if (!strncmp(props.name, "GeForce ", 8)) if (!strncmp(props.name, "GeForce ", 8))
sprintf(device_name[i], "%s %s", vendorname, &props.name[8]); sprintf(device_name[i], "%s %s", vendorname, &props.name[8]);
else else
sprintf(device_name[i], "%s %s", vendorname, props.name); sprintf(device_name[i], "%s %s", vendorname, props.name);
} else } else
#endif
device_name[i] = strdup(props.name); device_name[i] = strdup(props.name);
} }
} }

Loading…
Cancel
Save