Skip to content

Commit

Permalink
Fix logic bug in cache_nvidia_string_value_update() (#2022)
Browse files Browse the repository at this point in the history
* Update nvidia.cc

Made a suggested change in logic from issue #1177

* Update nvidia.cc

Made a suggested change in logic from issue #1178

* Update nvidia.cc

Made a suggested change in logic from issue #1178
  • Loading branch information
w0j0pl authored Aug 29, 2024
1 parent c428663 commit 03711ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nvidia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,12 @@ void cache_nvidia_string_value_update(nvidia_c_string *ac_string, char *token,
ac_string[gid].memTransferRatemax < 0) {
ac_string[gid].memTransferRatemax = *value;

} else if (strcmp(token, (char *)"perf") == 0 &&
ac_string[gid].memTransferRatemax < 0) {
if (search == SEARCH_MIN) {
} else if (strcmp(token, (char *)"perf") == 0) {
if (search == SEARCH_MIN &&
ac_string[gid].perfmin < 0) {
ac_string[gid].perfmin = *value;
} else if (search == SEARCH_MAX) {
} else if (search == SEARCH_MAX &&
ac_string[gid].perfmax < 0) {
ac_string[gid].perfmax = *value;
}
}
Expand Down

0 comments on commit 03711ea

Please sign in to comment.