From 6aaf71506ef5d06486547d99b46f12df74baa3b1 Mon Sep 17 00:00:00 2001 From: sasha0552 Date: Tue, 27 Aug 2024 19:11:40 +0000 Subject: [PATCH] Fixes --- src/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 196a0b2..26e21ee 100644 --- a/src/main.c +++ b/src/main.c @@ -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; @@ -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; } } @@ -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; } @@ -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++) {