PAPI 7.1.0.0
Loading...
Searching...
No Matches
cupti_dispatch.c File Reference
Include dependency graph for cupti_dispatch.c:

Go to the source code of this file.

Functions

int cuptid_shutdown (void)
 
void cuptid_disabled_reason_get (const char **msg)
 
int cuptid_init (void)
 
int cuptid_thread_info_create (cuptid_info_t *info)
 
int cuptid_thread_info_destroy (cuptid_info_t *info)
 
int cuptid_control_create (ntv_event_table_t event_names, cuptid_info_t info, cuptid_ctl_t *pcupti_ctl)
 
int cuptid_control_destroy (cuptid_ctl_t *pcupti_ctl)
 
int cuptid_control_start (cuptid_ctl_t cupti_ctl)
 
int cuptid_control_stop (cuptid_ctl_t cupti_ctl)
 
int cuptid_control_read (cuptid_ctl_t cupti_ctl, long long *values)
 
int cuptid_control_reset (cuptid_ctl_t cupti_ctl)
 
int cuptid_event_enum (cuptiu_event_table_t *all_evt_names)
 
int cuptid_event_name_to_descr (char *evt_name, char *descr)
 
void cuptid_event_table_destroy (ntv_event_table_t *evt_table)
 
int cuptid_event_table_create (ntv_event_table_t *evt_table)
 
int cuptid_event_table_select_by_idx (ntv_event_table_t evt_table, int count, int *idcs, ntv_event_table_t *pevt_names)
 
int cuptid_event_table_find_name (ntv_event_table_t evt_table, const char *evt_name, ntv_event_t *found_rec)
 
int cuptid_event_table_insert_record (ntv_event_table_t evt_table, const char *evt_name, unsigned int evt_code, int evt_pos)
 
int cuptid_event_table_get_item (ntv_event_table_t evt_table, unsigned int evt_idx, ntv_event_t *record)
 

Detailed Description

Function Documentation

◆ cuptid_control_create()

int cuptid_control_create ( ntv_event_table_t  event_names,
cuptid_info_t  info,
cuptid_ctl_t pcupti_ctl 
)

Definition at line 96 of file cupti_dispatch.c.

97{
99
100#if defined(API_PERFWORKS)
101 return cuptip_control_create(event_names, (cuptic_info_t) info, (cuptip_control_t *) pcupti_ctl);
102#endif
103
104 } else if (cuptic_is_runtime_events_api()) {
105
106#if defined (API_EVENTS)
107 return cuptie_control_create(event_names, (cuptic_info_t) info, (cuptie_control_t *) pcupti_ctl);
108#endif
109
110 }
111 return PAPI_ECMP;
112}
static const char * event_names[2]
Definition: Gamum.c:27
int cuptic_is_runtime_perfworks_api(void)
Definition: cupti_common.c:447
int cuptic_is_runtime_events_api(void)
Definition: cupti_common.c:488
int cuptie_control_create(cuptiu_event_table_t *event_names, void *thr_info, cuptie_control_t *pctl)
Definition: cupti_events.c:23
void * cuptie_control_t
Definition: cupti_events.h:12
int cuptip_control_create(cuptiu_event_table_t *event_names, cuptic_info_t thr_info, cuptip_control_t *pstate)
#define PAPI_ECMP
Definition: f90papi.h:214
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_control_destroy()

int cuptid_control_destroy ( cuptid_ctl_t pcupti_ctl)

Definition at line 114 of file cupti_dispatch.c.

115{
117
118#if defined(API_PERFWORKS)
119 return cuptip_control_destroy((cuptip_control_t *) pcupti_ctl);
120#endif
121
122 } else if (cuptic_is_runtime_events_api()) {
123
124#if defined(API_EVENTS)
125 return cuptie_control_destroy((cuptie_control_t *) pcupti_ctl);
126#endif
127
128 }
129 return PAPI_ECMP;
130}
int cuptie_control_destroy(cuptie_control_t *pctl)
Definition: cupti_events.c:28
int cuptip_control_destroy(cuptip_control_t *pstate)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_control_read()

int cuptid_control_read ( cuptid_ctl_t  cupti_ctl,
long long values 
)

Definition at line 168 of file cupti_dispatch.c.

169{
171
172#if defined(API_PERFWORKS)
173 return cuptip_control_read((cuptip_control_t) cupti_ctl, values);
174#endif
175
176 } else if (cuptic_is_runtime_events_api()) {
177
178#if defined(API_EVENTS)
179 return cuptie_control_read((cuptie_control_t) cupti_ctl, values);
180#endif
181
182 }
183 return PAPI_ECMP;
184}
int cuptie_control_read(cuptie_control_t ctl, long long *values)
Definition: cupti_events.c:43
int cuptip_control_read(cuptip_control_t state, long long *values)
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_control_reset()

int cuptid_control_reset ( cuptid_ctl_t  cupti_ctl)

Definition at line 186 of file cupti_dispatch.c.

187{
189
190#if defined(API_PERFWORKS)
191 return cuptip_control_reset((cuptip_control_t) cupti_ctl);
192#endif
193
194 } else if (cuptic_is_runtime_events_api()) {
195
196#if defined(API_EVENTS)
197 return cuptie_control_reset((cuptie_control_t) cupti_ctl);
198#endif
199
200 }
201 return PAPI_ECMP;
202}
int cuptie_control_reset(cuptie_control_t ctl)
Definition: cupti_events.c:48
int cuptip_control_reset(cuptip_control_t state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_control_start()

int cuptid_control_start ( cuptid_ctl_t  cupti_ctl)

Definition at line 132 of file cupti_dispatch.c.

133{
135
136#if defined(API_PERFWORKS)
137 return cuptip_control_start((cuptip_control_t) cupti_ctl);
138#endif
139
140 } else if (cuptic_is_runtime_events_api()) {
141
142#if defined(API_EVENTS)
143 return cuptie_control_start((cuptie_control_t) cupti_ctl);
144#endif
145
146 }
147 return PAPI_ECMP;
148}
int cuptie_control_start(cuptie_control_t ctl)
Definition: cupti_events.c:33
int cuptip_control_start(cuptip_control_t state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_control_stop()

int cuptid_control_stop ( cuptid_ctl_t  cupti_ctl)

Definition at line 150 of file cupti_dispatch.c.

151{
153
154#if defined(API_PERFWORKS)
155 return cuptip_control_stop((cuptip_control_t) cupti_ctl);
156#endif
157
158 } else if (cuptic_is_runtime_events_api()) {
159
160#if defined(API_EVENTS)
161 return cuptie_control_stop((cuptie_control_t) cupti_ctl);
162#endif
163
164 }
165 return PAPI_ECMP;
166}
int cuptie_control_stop(cuptie_control_t ctl)
Definition: cupti_events.c:38
int cuptip_control_stop(cuptip_control_t state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_disabled_reason_get()

void cuptid_disabled_reason_get ( const char **  msg)

Definition at line 46 of file cupti_dispatch.c.

47{
49}
void cuptic_disabled_reason_get(const char **pmsg)
Definition: cupti_common.c:390
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_enum()

int cuptid_event_enum ( cuptiu_event_table_t all_evt_names)

Definition at line 204 of file cupti_dispatch.c.

205{
207
208#if defined(API_PERFWORKS)
209 return cuptip_event_enum(all_evt_names);
210#endif
211
212 } else if (cuptic_is_runtime_events_api()) {
213
214#if defined(API_EVENTS)
215 return cuptie_event_enum(all_evt_names);
216#endif
217
218 }
219 return PAPI_ECMP;
220}
int cuptie_event_enum(cuptiu_event_table_t *all_evt_names)
Definition: cupti_events.c:53
int cuptip_event_enum(cuptiu_event_table_t *all_evt_names)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_name_to_descr()

int cuptid_event_name_to_descr ( char *  evt_name,
char *  descr 
)

Definition at line 222 of file cupti_dispatch.c.

223{
225
226#if defined(API_PERFWORKS)
228#endif
229
230 } else if (cuptic_is_runtime_events_api()) {
231
232#if defined(API_EVENTS)
234#endif
235
236 }
237 return PAPI_ECMP;
238}
int cuptie_event_name_to_descr(const char *evt_name, char *description)
Definition: cupti_events.c:58
int cuptip_event_name_to_descr(const char *evt_name, char *description)
char * evt_name(evstock *stock, int index)
Definition: eventstock.c:193
char * descr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_create()

int cuptid_event_table_create ( ntv_event_table_t evt_table)

Definition at line 245 of file cupti_dispatch.c.

246{
247 return cuptiu_event_table_create(sizeof(cuptiu_event_t), evt_table);
248}
int cuptiu_event_table_create(int sizeof_rec, cuptiu_event_table_t **pevt_table)
Definition: cupti_utils.c:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_destroy()

void cuptid_event_table_destroy ( ntv_event_table_t evt_table)

Definition at line 240 of file cupti_dispatch.c.

241{
243}
void cuptiu_event_table_destroy(cuptiu_event_table_t **pevt_table)
Definition: cupti_utils.c:159
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_find_name()

int cuptid_event_table_find_name ( ntv_event_table_t  evt_table,
const char *  evt_name,
ntv_event_t found_rec 
)

Definition at line 255 of file cupti_dispatch.c.

256{
257 return cuptiu_event_table_find_name(evt_table, evt_name, found_rec);
258}
int cuptiu_event_table_find_name(cuptiu_event_table_t *evt_table, const char *evt_name, cuptiu_event_t **found_rec)
Definition: cupti_utils.c:147
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_get_item()

int cuptid_event_table_get_item ( ntv_event_table_t  evt_table,
unsigned int  evt_idx,
ntv_event_t record 
)

Definition at line 265 of file cupti_dispatch.c.

266{
267 return cuptiu_event_table_get_item(evt_table, evt_idx, record);
268}
int cuptiu_event_table_get_item(cuptiu_event_table_t *evt_table, int evt_idx, cuptiu_event_t **record)
Definition: cupti_utils.c:47
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_insert_record()

int cuptid_event_table_insert_record ( ntv_event_table_t  evt_table,
const char *  evt_name,
unsigned int  evt_code,
int  evt_pos 
)

Definition at line 260 of file cupti_dispatch.c.

261{
262 return cuptiu_event_table_insert_record(evt_table, evt_name, evt_code, evt_pos);
263}
int cuptiu_event_table_insert_record(cuptiu_event_table_t *evt_table, const char *evt_name, unsigned int evt_code, int evt_pos)
Definition: cupti_utils.c:88
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_event_table_select_by_idx()

int cuptid_event_table_select_by_idx ( ntv_event_table_t  evt_table,
int  count,
int idcs,
ntv_event_table_t pevt_names 
)

Definition at line 250 of file cupti_dispatch.c.

251{
252 return cuptiu_event_table_select_by_idx(evt_table, count, idcs, pevt_names);
253}
static long count
int cuptiu_event_table_select_by_idx(cuptiu_event_table_t *src, int count, int *idcs, cuptiu_event_table_t **pevt_names)
Definition: cupti_utils.c:113
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_init()

int cuptid_init ( void  )

Definition at line 51 of file cupti_dispatch.c.

52{
53 int papi_errno;
54 papi_errno = cuptic_init();
55 if (papi_errno != PAPI_OK) {
56 goto fn_exit;
57 }
58
60
61#if defined(API_PERFWORKS)
62 papi_errno = cuptip_init();
63#else
64 cuptic_disabled_reason_set("PAPI not built with NVIDIA profiler API support.");
65 papi_errno = PAPI_ECMP;
66 goto fn_exit;
67#endif
68
69 } else if (cuptic_is_runtime_events_api()) {
70
71#if defined(API_EVENTS)
72 papi_errno = cuptie_init();
73#else
74 cuptic_disabled_reason_set("Unknown events API problem.");
75 papi_errno = PAPI_ECMP;
76#endif
77
78 } else {
79 cuptic_disabled_reason_set("CUDA configuration not supported.");
80 papi_errno = PAPI_ECMP;
81 }
82fn_exit:
83 return papi_errno;
84}
void cuptic_disabled_reason_set(const char *msg)
Definition: cupti_common.c:385
int cuptic_init(void)
Definition: cupti_common.c:417
int cuptie_init(void)
Definition: cupti_events.c:17
int cuptip_init(void)
#define PAPI_OK
Definition: f90papi.h:73
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_shutdown()

int cuptid_shutdown ( void  )

Definition at line 20 of file cupti_dispatch.c.

21{
22 int papi_errno;
24
25#if defined(API_PERFWORKS)
26 papi_errno = cuptip_shutdown();
27 if (papi_errno != PAPI_OK) {
28 return papi_errno;
29 }
30#endif
31
32 } else if (cuptic_is_runtime_events_api()) {
33
34#if defined(API_EVENTS)
35 papi_errno = cuptie_shutdown();
36 if (papi_errno != PAPI_OK) {
37 return papi_errno;
38 }
39#endif
40
41 }
42
43 return cuptic_shutdown();
44}
int cuptic_shutdown(void)
Definition: cupti_common.c:280
int cuptie_shutdown(void)
Definition: cupti_events.c:63
int cuptip_shutdown(void)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_thread_info_create()

int cuptid_thread_info_create ( cuptid_info_t info)

Definition at line 86 of file cupti_dispatch.c.

87{
88 return cuptic_ctxarr_create((cuptic_info_t *) info);
89}
int cuptic_ctxarr_create(cuptic_info_t *pinfo)
Definition: cupti_common.c:520
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cuptid_thread_info_destroy()

int cuptid_thread_info_destroy ( cuptid_info_t info)

Definition at line 91 of file cupti_dispatch.c.

92{
93 return cuptic_ctxarr_destroy((cuptic_info_t *) info);
94}
int cuptic_ctxarr_destroy(cuptic_info_t *pinfo)
Definition: cupti_common.c:572
Here is the call graph for this function:
Here is the caller graph for this function: