Skip to content

Commit

Permalink
minors
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Nov 4, 2021
1 parent 347f18a commit de5fd06
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,15 @@ void initGPU() {

int * getGpuList(int *num) {
int * gpuList;
unsigned int nDevices;
int i, count = 0;
nvmlReturn_t result;

result = nvmlInit();
if (NVML_SUCCESS != result)
error("Failed to initialize NVML: %s", nvmlErrorString(result));

result = nvmlDeviceGetCount_v2(&nDevices);
if (NVML_SUCCESS != result)
error("Failed to get device count: %s", nvmlErrorString(result));

gpuList = (int *) malloc(nDevices * sizeof(int));
for (i = 0; i < nDevices; ++i) {
gpuList = (int *) malloc(num_total_gpus * sizeof(int));
for (i = 0; i < num_total_gpus; ++i) {
nvmlMemory_t mem;
nvmlDevice_t dev;
result = nvmlDeviceGetHandleByIndex_v2(i, &dev);
Expand Down

0 comments on commit de5fd06

Please sign in to comment.