Skip to content

Commit

Permalink
Revert changes to ROCm component to only count the basename for papi_…
Browse files Browse the repository at this point in the history
…component_avail. This will be the default choice for components with qualifiers.
  • Loading branch information
Treece Burgess authored and Treece Burgess committed Aug 22, 2024
1 parent 4c77a75 commit 17d6f7c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 46 deletions.
6 changes: 0 additions & 6 deletions src/components/rocm/roc_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ rocd_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info)
return rocp_evt_code_to_info(event_code, info);
}

int
rocd_get_num_qualified_evts(int *count, uint64_t event_code)
{
return rocp_get_num_qualified_evts(count, event_code);
}

int
rocd_err_get_last(const char **error_str)
{
Expand Down
1 change: 0 additions & 1 deletion src/components/rocm/roc_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ int rocd_evt_code_to_descr(uint64_t event_code, char *descr, int len);
int rocd_evt_name_to_code(const char *name, uint64_t *event_code);
int rocd_evt_code_to_name(uint64_t event_code, char *name, int len);
int rocd_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info);
int rocd_get_num_qualified_evts(int *count, uint64_t event_code);

/* error handling interfaces */
int rocd_err_get_last(const char **error_str);
Expand Down
29 changes: 0 additions & 29 deletions src/components/rocm/roc_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,35 +385,6 @@ rocp_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info)
return papi_errno;
}

/* rocp_get_num_qualified_evts - get number of events with a common basename */
int
rocp_get_num_qualified_evts(int *count, uint64_t event_code) {

int papi_errno;
int insts;
int subcount = 0;

event_info_t inf;
papi_errno = evt_id_to_info(event_code, &inf);
if (papi_errno != PAPI_OK) {
return papi_errno;
}

/* If there are no instances, only count the basename.
* Otherwise, count each instance. */
insts = ntv_table_p->events[inf.nameid].instances;
if( insts < 1 ) {
++subcount;
} else {
subcount += ntv_table_p->events[inf.nameid].instances;
}

/* Account for all devices. */
*count += subcount * (device_table_p->count);

return PAPI_OK;
}

/* rocp_ctx_open - open a profiling context for the requested events */
int
rocp_ctx_open(uint64_t *events_id, int num_events, rocp_ctx_t *rocp_ctx)
Expand Down
1 change: 0 additions & 1 deletion src/components/rocm/roc_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ int rocp_evt_code_to_descr(uint64_t event_code, char *descr, int len);
int rocp_evt_name_to_code(const char *name, uint64_t *event_code);
int rocp_evt_code_to_name(uint64_t event_code, char *name, int len);
int rocp_evt_code_to_info(uint64_t event_code, PAPI_event_info_t *info);
int rocp_get_num_qualified_evts(int *count, uint64_t event_code);

/* profiling context handling interfaces */
int rocp_ctx_open(uint64_t *events_id, int num_events, rocp_ctx_t *ctx);
Expand Down
11 changes: 2 additions & 9 deletions src/components/rocm/rocm.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,12 @@ static int
evt_get_count(int *count)
{
uint64_t event_code = 0;
int papi_errno;

if (rocd_evt_enum(&event_code, PAPI_ENUM_FIRST) == PAPI_OK) {
papi_errno = rocd_get_num_qualified_evts(count, event_code);
if (papi_errno != PAPI_OK) {
return papi_errno;
}
++(*count);
}
while (rocd_evt_enum(&event_code, PAPI_ENUM_EVENTS) == PAPI_OK) {
papi_errno = rocd_get_num_qualified_evts(count, event_code);
if (papi_errno != PAPI_OK) {
return papi_errno;
}
++(*count);
}

return PAPI_OK;
Expand Down

0 comments on commit 17d6f7c

Please sign in to comment.