From 05869059c1e3c29edc5913acca9242ee78789370 Mon Sep 17 00:00:00 2001 From: Giuseppe Congiu Date: Fri, 17 Nov 2023 14:02:19 +0000 Subject: [PATCH 1/2] rocm: fix bug introduced by commit 4991e1614 --- src/components/rocm/roc_profiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/rocm/roc_profiler.c b/src/components/rocm/roc_profiler.c index 09beb5877..d91bd73db 100644 --- a/src/components/rocm/roc_profiler.c +++ b/src/components/rocm/roc_profiler.c @@ -1981,7 +1981,7 @@ get_context_counters(unsigned int dev_id, cb_context_node_t *n, rocp_ctx_t rocp_ break; } } - if (j < rocp_ctx->u.intercept.feature_count) { + if (j >= rocp_ctx->u.intercept.feature_count) { return PAPI_ECMP; } rocp_ctx->u.intercept.counters[j] += n->counters[i]; From 291f51398a803387d7fde2fbfb894359c1e7cb48 Mon Sep 17 00:00:00 2001 From: Giuseppe Congiu Date: Fri, 17 Nov 2023 14:04:42 +0000 Subject: [PATCH 2/2] rocm: fix bug in intercept mode reset function --- src/components/rocm/roc_profiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/rocm/roc_profiler.c b/src/components/rocm/roc_profiler.c index d91bd73db..872271aa8 100644 --- a/src/components/rocm/roc_profiler.c +++ b/src/components/rocm/roc_profiler.c @@ -1374,7 +1374,7 @@ intercept_ctx_reset(rocp_ctx_t rocp_ctx) { int i; - for (i = 0; i < INTERCEPT_ROCP_FEATURE_COUNT; ++i) { + for (i = 0; i < rocp_ctx->u.intercept.feature_count; ++i) { rocp_ctx->u.intercept.counters[i] = 0; }