Skip to content

Commit

Permalink
Merge pull request icl-utk-edu#139 from gcongiu/2023.12.14_rocm-quali…
Browse files Browse the repository at this point in the history
…fier-fixes

Minor fixes for ROCm component qualifiers
  • Loading branch information
gcongiu authored Dec 18, 2023
2 parents c36490e + 06a9185 commit 29ed6f2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/rocm/roc_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,20 @@ rocp_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info)
sprintf(info->long_descr, "%s", ntv_table_p->events[inf.nameid].descr);
break;
case (DEVICE_FLAG | INSTAN_FLAG):
{
int i;
char devices[PAPI_MAX_STR_LEN] = { 0 };
for (i = 0; i < device_table_p->count; ++i) {
if (rocc_dev_check(ntv_table_p->events[inf.nameid].device_map, i)) {
sprintf(devices + strlen(devices), "%i,", i);
}
}
*(devices + strlen(devices) - 1) = 0;
sprintf(info->symbol, "%s:device=%i:instance=%i", ntv_table_p->events[inf.nameid].name, inf.device, inf.instance);
sprintf(info->long_descr, "%s", ntv_table_p->events[inf.nameid].descr);
sprintf(info->long_descr, "%s, masks:Mandatory device qualifier [%s]:Mandatory instance qualifier in range [0-%i]",
ntv_table_p->events[inf.nameid].descr, devices, ntv_table_p->events[inf.nameid].instances - 1);
break;
}
case DEVICE_FLAG:
{
int i;
Expand All @@ -358,13 +369,13 @@ rocp_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info)
}
*(devices + strlen(devices) - 1) = 0;
sprintf(info->symbol, "%s:device=%i", ntv_table_p->events[inf.nameid].name, inf.device);
sprintf(info->long_descr, "%s masks:Mandatory device qualifier [%s]",
sprintf(info->long_descr, "%s, masks:Mandatory device qualifier [%s]",
ntv_table_p->events[inf.nameid].descr, devices);
break;
}
case INSTAN_FLAG:
sprintf(info->symbol, "%s:instance=%i", ntv_table_p->events[inf.nameid].name, inf.instance);
sprintf(info->long_descr, "%s masks:Mandatory instance qualifier in range [0-%i]",
sprintf(info->long_descr, "%s, masks:Mandatory instance qualifier in range [0-%i]",
ntv_table_p->events[inf.nameid].descr, ntv_table_p->events[inf.nameid].instances - 1);
break;
default:
Expand Down

0 comments on commit 29ed6f2

Please sign in to comment.