Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Aug 27, 2024
1 parent f580ea7 commit 6aaf715
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static bool enter_pstate(unsigned int i, unsigned int pstateId) {
state->pstateId = pstateId;

// Print the current GPU state
printf("GPU %d entered performance state %d\n", i, state->pstateId);
printf("GPU %u entered performance state %u\n", i, state->pstateId);

// Return true to indicate success
return true;
Expand Down Expand Up @@ -270,13 +270,13 @@ int main(int argc, char *argv[]) {
}

// Mark the GPU as managed
gpuStates[id]->managed = true;
&gpuStates[id]->managed = true;
}
} else {
// Iterate through each GPU
for (unsigned int i = 0; i < deviceCount; i++) {
// Mark the GPU as managed
gpuStates[i]->managed = true;
&gpuStates[i]->managed = true;
}
}

Expand All @@ -286,7 +286,7 @@ int main(int argc, char *argv[]) {
// Iterate through each GPU
for (unsigned int i = 0; i < deviceCount; i++) {
// If GPU is managed
if (gpuStates[i]->managed) {
if (&gpuStates[i]->managed) {
// Update flag
hasManagedGpus = true;
}
Expand All @@ -302,7 +302,11 @@ int main(int argc, char *argv[]) {
}

// Print the number of GPUs being managed
printf("Managing %d GPUs...\n", idsCount == 0 ? deviceCount : idsCount);
if (idsCount == 0) {
printf("Managing %u GPUs...\n", deviceCount);
} else {
printf("Managing %zu GPUs...\n", idsCount);
}

// Iterate through each GPU
for (unsigned int i = 0; i < deviceCount; i++) {
Expand Down

0 comments on commit 6aaf715

Please sign in to comment.