Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Aug 27, 2024
1 parent 6aaf715 commit afd3788
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,20 @@ int main(int argc, char *argv[]) {
continue;
}

// Get the current state of the GPU
gpuState * state = &gpuStates[id];

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

// Mark the GPU as managed
&gpuStates[i]->managed = true;
gpuState->managed = true;
}
}

Expand All @@ -285,8 +291,11 @@ int main(int argc, char *argv[]) {

// Iterate through each GPU
for (unsigned int i = 0; i < deviceCount; i++) {
// Get the current state of the GPU
gpuState * state = &gpuStates[i];

// If GPU is managed
if (&gpuStates[i]->managed) {
if (gpuState->managed) {
// Update flag
hasManagedGpus = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool parse_ulong(const char *arg, unsigned long *value) {
return true;
}

bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long *values, size_t *count) {
bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long **values, size_t *count) {
// Check if the input or output argument is invalid
if (arg == NULL || values == NULL || count == NULL) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
/***** ***** ***** ***** ***** FUNCTIONS ***** ***** ***** ***** *****/

bool parse_ulong(const char *arg, unsigned long *value);
bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long *values, size_t *count);
bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long **values, size_t *count);

0 comments on commit afd3788

Please sign in to comment.