Go to the source code of this file.
|
| int | rocs_init (void) |
| |
| int | rocs_shutdown (void) |
| |
| int | rocs_evt_enum (unsigned int *event_code, int modifier) |
| |
| int | rocs_evt_code_to_descr (unsigned int event_code, char *descr, int len) |
| |
| int | rocs_evt_name_to_code (const char *name, unsigned int *event_code) |
| |
| int | rocs_evt_code_to_name (unsigned int event_code, char *name, int len) |
| |
| int | rocs_err_get_last (const char **err_string) |
| |
| int | rocs_ctx_open (unsigned int *event_ids, int num_events, rocs_ctx_t *ctx) |
| |
| int | rocs_ctx_close (rocs_ctx_t ctx) |
| |
| int | rocs_ctx_start (rocs_ctx_t ctx) |
| |
| int | rocs_ctx_stop (rocs_ctx_t ctx) |
| |
| int | rocs_ctx_read (rocs_ctx_t ctx, long long **counts) |
| |
| int | rocs_ctx_write (rocs_ctx_t ctx, long long *counts) |
| |
| int | rocs_ctx_reset (rocs_ctx_t ctx) |
| |
◆ ROCS_EVENTS_OPENED
| #define ROCS_EVENTS_OPENED (0x1) |
Definition at line 4 of file rocs.h.
◆ ROCS_EVENTS_RUNNING
| #define ROCS_EVENTS_RUNNING (0x2) |
Definition at line 5 of file rocs.h.
◆ rocs_ctx_close()
| int rocs_ctx_close |
( |
rocs_ctx_t |
ctx | ) |
|
Definition at line 519 of file rocs.c.
520{
522
524
530 goto fn_fail;
531 }
532 }
533
537
538 fn_exit:
540 return papi_errno;
541 fn_fail:
542 goto fn_exit;
543}
static int release_devices(int32_t *)
static ntv_event_table_t * ntv_table_p
unsigned int _rocm_smi_lock
close_function_f close_func_p
inline_static int _papi_hwi_lock(int lck)
inline_static int _papi_hwi_unlock(int lck)
◆ rocs_ctx_open()
| int rocs_ctx_open |
( |
unsigned int * |
event_ids, |
|
|
int |
num_events, |
|
|
rocs_ctx_t * |
ctx |
|
) |
| |
Definition at line 461 of file rocs.c.
462{
464 int64_t *counters = NULL;
466
468
469 int32_t bitmask;
472 goto fn_fail;
473 }
474
478 goto fn_fail;
479 }
480
482 if (counters == NULL) {
484 goto fn_fail;
485 }
486
491 goto fn_fail;
492 }
493 }
494
498 (*rocs_ctx)->counters = counters;
499 (*rocs_ctx)->device_mask = bitmask;
500
501 fn_exit:
503 return papi_errno;
504 fn_fail:
505 for (j = 0; j <
i; ++j) {
508 }
509 if (counters) {
511 }
514 }
515 goto fn_exit;
516}
#define papi_calloc(a, b)
static int acquire_devices(unsigned int *, int, int32_t *)
#define ROCS_EVENTS_OPENED
open_function_f open_func_p
◆ rocs_ctx_read()
| int rocs_ctx_read |
( |
rocs_ctx_t |
ctx, |
|
|
long long ** |
counts |
|
) |
| |
Definition at line 605 of file rocs.c.
606{
608
614 return papi_errno;
615 }
617 }
619
620 return papi_errno;
621}
access_function_f access_func_p
◆ rocs_ctx_reset()
| int rocs_ctx_reset |
( |
rocs_ctx_t |
ctx | ) |
|
◆ rocs_ctx_start()
| int rocs_ctx_start |
( |
rocs_ctx_t |
ctx | ) |
|
Definition at line 546 of file rocs.c.
547{
549
552 }
553
556 }
557
563 goto fn_fail;
564 }
565 }
566
568
569 fn_exit:
570 return papi_errno;
571 fn_fail:
572 for (j = 0; j <
i; ++j) {
575 }
576 goto fn_exit;
577}
#define ROCS_EVENTS_RUNNING
stop_function_f stop_func_p
start_function_f start_func_p
◆ rocs_ctx_stop()
| int rocs_ctx_stop |
( |
rocs_ctx_t |
ctx | ) |
|
Definition at line 580 of file rocs.c.
581{
584 }
585
588 }
589
595 return papi_errno;
596 }
597 }
598
600
602}
◆ rocs_ctx_write()
| int rocs_ctx_write |
( |
rocs_ctx_t |
ctx, |
|
|
long long * |
counts |
|
) |
| |
Definition at line 624 of file rocs.c.
625{
627
634 return papi_errno;
635 }
636 }
637
638 return papi_errno;
639}
@ ROCS_ACCESS_MODE__WRITE
◆ rocs_err_get_last()
| int rocs_err_get_last |
( |
const char ** |
err_string | ) |
|
Definition at line 450 of file rocs.c.
451{
454}
static char error_string[PAPI_MAX_STR_LEN+1]
◆ rocs_evt_code_to_descr()
| int rocs_evt_code_to_descr |
( |
unsigned int |
event_code, |
|
|
char * |
descr, |
|
|
int |
len |
|
) |
| |
◆ rocs_evt_code_to_name()
| int rocs_evt_code_to_name |
( |
unsigned int |
event_code, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
◆ rocs_evt_enum()
| int rocs_evt_enum |
( |
unsigned int * |
event_code, |
|
|
int |
modifier |
|
) |
| |
Definition at line 384 of file rocs.c.
385{
387
388 switch(modifier) {
392 }
393 *event_code = 0;
394 break;
397 ++(*event_code);
398 } else {
400 }
401 break;
402 default:
404 }
405
406 return papi_errno;
407}
◆ rocs_evt_name_to_code()
| int rocs_evt_name_to_code |
( |
const char * |
name, |
|
|
unsigned int * |
event_code |
|
) |
| |
Definition at line 421 of file rocs.c.
422{
424 int htable_errno;
425
431 goto fn_exit;
432 }
433 *event_code = event->id;
434
435 fn_exit:
436 return papi_errno;
437}
static int htable_find(void *handle, const char *key, void **out)
◆ rocs_init()
Definition at line 333 of file rocs.c.
334{
335 int papi_errno;
336
339 return papi_errno;
340 }
341
343 if (status != RSMI_STATUS_SUCCESS) {
344 const char *status_string = NULL;
348 }
349
351
353 if (status != RSMI_STATUS_SUCCESS) {
354 sprintf(
error_string,
"Error while counting available devices.");
356 goto fn_fail;
357 }
358
361 sprintf(
error_string,
"Error while initializing device tables.");
362 goto fn_fail;
363 }
364
367 sprintf(
error_string,
"Error while initializing the native event table.");
368 goto fn_fail;
369 }
370
372
373 fn_exit:
374 return papi_errno;
375 fn_fail:
380 goto fn_exit;
381}
static int htable_shutdown(void *handle)
static int htable_init(void **handle)
static rsmi_status_t(* rsmi_num_monitor_dev_p)(uint32_t *)
static ntv_event_table_t ntv_table
static int load_rsmi_sym(void)
static rsmi_status_t(* rsmi_shut_down_p)(void)
static int shutdown_device_table(void)
static rsmi_status_t(* rsmi_init_p)(uint64_t)
static int init_device_table(void)
static int init_event_table(void)
static int shutdown_event_table(void)
static int32_t device_count
static rsmi_status_t(* rsmi_status_string_p)(rsmi_status_t, const char **)
◆ rocs_shutdown()
| int rocs_shutdown |
( |
void |
| ) |
|
Definition at line 655 of file rocs.c.
656{
662}
static int unload_rsmi_sym(void)