Go to the source code of this file.
◆ PAPI_ROCM_MAX_DEV_COUNT
| #define PAPI_ROCM_MAX_DEV_COUNT (32) |
◆ rocc_bitmap_t
◆ rocc_dev_get_map_cb
| typedef int(* rocc_dev_get_map_cb) (uint64_t event_id, int *dev_id) |
◆ rocc_dev_acquire()
Definition at line 93 of file roc_common.c.
94{
96
99 }
101
103}
static rocc_bitmap_t global_device_map
◆ rocc_dev_check()
Definition at line 187 of file roc_common.c.
188{
189 return (bitmap & (1ULL <<
i));
190}
◆ rocc_dev_get_agent_id()
| int rocc_dev_get_agent_id |
( |
hsa_agent_t |
agent, |
|
|
int * |
dev_id |
|
) |
| |
Definition at line 169 of file roc_common.c.
170{
173 break;
174 }
175 }
177}
device_table_t * device_table_p
hsa_agent_t devices[PAPI_ROCM_MAX_DEV_COUNT]
◆ rocc_dev_get_count()
Definition at line 121 of file roc_common.c.
122{
124}
static int dev_get_count(rocc_bitmap_t bitmap, int *num_devices)
◆ rocc_dev_get_id()
Definition at line 140 of file roc_common.c.
141{
143
145 if (dev_count >=
count) {
147 }
148
151 while (bitmap) {
152 lsb = bitmap & (~bitmap + 1);
153 bitmap -= lsb;
154 if (
count++ == dev_count) {
155 break;
156 }
157 }
158
159 *device_id = 0;
160 while (!(lsb & 0x1)) {
161 ++(*device_id);
162 lsb >>= 1;
163 }
164
166}
◆ rocc_dev_get_map()
Definition at line 74 of file roc_common.c.
75{
78
80 int dev_id;
83 }
84
85 device_map_acq |= (1 << dev_id);
86 }
87
88 *bitmap = device_map_acq;
90}
◆ rocc_dev_release()
◆ rocc_dev_set()
Definition at line 180 of file roc_common.c.
181{
182 *bitmap |= (1ULL <<
i);
184}
◆ rocc_err_get_last()
| int rocc_err_get_last |
( |
const char ** |
error_string | ) |
|
Definition at line 67 of file roc_common.c.
68{
71}
char error_string[PAPI_MAX_STR_LEN]
◆ rocc_init()
Definition at line 29 of file roc_common.c.
30{
33 goto fn_fail;
34 }
35
37 if (status != HSA_STATUS_SUCCESS) {
39 goto fn_fail;
40 }
41
44 (*hsa_shut_down_p)();
45 goto fn_fail;
46 }
47
50
51 fn_exit:
52 return papi_errno;
53 fn_fail:
55 goto fn_exit;
56}
static int unload_hsa_sym(void)
static int load_hsa_sym(void)
hsa_status_t(* hsa_init_p)(void)
static device_table_t device_table
static void init_thread_id_fn(void)
static int init_device_table(void)
◆ rocc_shutdown()
| int rocc_shutdown |
( |
void |
| ) |
|
Definition at line 59 of file roc_common.c.
60{
64}
hsa_status_t(* hsa_shut_down_p)(void)
◆ rocc_thread_get_id()
| int rocc_thread_get_id |
( |
unsigned long * |
tid | ) |
|
Definition at line 193 of file roc_common.c.
194{
197}
static unsigned long(* thread_id_fn)(void)
◆ device_table_p
◆ error_string
◆ hsa_agent_get_info_p
| hsa_status_t(* hsa_agent_get_info_p) (hsa_agent_t, hsa_agent_info_t, void *) |
( |
hsa_agent_t |
, |
|
|
hsa_agent_info_t |
, |
|
|
void * |
|
|
) |
| |
|
extern |
◆ hsa_init_p
| hsa_status_t(* hsa_init_p) (void) |
( |
void |
| ) |
|
|
extern |
◆ hsa_iterate_agents_p
| hsa_status_t(* hsa_iterate_agents_p) (hsa_status_t(*)(hsa_agent_t, void *), void *) |
( |
hsa_status_t(*)(hsa_agent_t, void *) |
, |
|
|
void * |
|
|
) |
| |
|
extern |
◆ hsa_queue_destroy_p
| hsa_status_t(* hsa_queue_destroy_p) (hsa_queue_t *) |
( |
hsa_queue_t * |
| ) |
|
|
extern |
◆ hsa_shut_down_p
| hsa_status_t(* hsa_shut_down_p) (void) |
( |
void |
| ) |
|
|
extern |
◆ hsa_status_string_p
| hsa_status_t(* hsa_status_string_p) (hsa_status_t, const char **) |
( |
hsa_status_t |
, |
|
|
const char ** |
|
|
) |
| |
|
extern |
◆ hsa_system_get_info_p
| hsa_status_t(* hsa_system_get_info_p) (hsa_system_info_t, void *) |
( |
hsa_system_info_t |
, |
|
|
void * |
|
|
) |
| |
|
extern |