Skip to content

Commit

Permalink
Buffer is an array of bytes so define it as such
Browse files Browse the repository at this point in the history
  • Loading branch information
jackun committed Apr 7, 2023
1 parent 328df38 commit 35f027e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amdgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ bool amdgpu_verify_metrics(const std::string& path)
#define IS_VALID_METRIC(FIELD) (FIELD != 0xffff)
void amdgpu_get_instant_metrics(struct amdgpu_common_metrics *metrics) {
FILE *f;
void *buf[MAX(sizeof(struct gpu_metrics_v1_3), sizeof(struct gpu_metrics_v2_3))/sizeof(void*)+1];
struct metrics_table_header* header = (metrics_table_header*)buf;
char buf[MAX(sizeof(struct gpu_metrics_v1_3), sizeof(struct gpu_metrics_v2_3))];
struct metrics_table_header* header = reinterpret_cast<metrics_table_header*>(buf);

f = fopen(metrics_path.c_str(), "rb");
if (!f)
Expand Down

0 comments on commit 35f027e

Please sign in to comment.