From 065b156454202f86fbe4f52407ac25334fce65bd Mon Sep 17 00:00:00 2001 From: Anustuv Pal Date: Thu, 19 Oct 2023 20:13:53 +0000 Subject: [PATCH] cuda: Fix papi_command_line segfault when passed non-existent event name --- src/components/cuda/cupti_profiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/cuda/cupti_profiler.c b/src/components/cuda/cupti_profiler.c index 4e18ccdb6..97cfd72f2 100644 --- a/src/components/cuda/cupti_profiler.c +++ b/src/components/cuda/cupti_profiler.c @@ -1438,11 +1438,11 @@ int cuptip_control_create(cuptiu_event_table_t *event_names, cuptic_info_t thr_i if (papi_errno != PAPI_OK) { goto fn_exit; } - papi_errno = add_events_per_gpu(state, event_names); + papi_errno = nvpw_cuda_metricscontext_create(state); if (papi_errno != PAPI_OK) { goto fn_exit; } - papi_errno = nvpw_cuda_metricscontext_create(state); + papi_errno = add_events_per_gpu(state, event_names); if (papi_errno != PAPI_OK) { goto fn_exit; }