#include <ucontext.h>
#include <dlfcn.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <papi.h>
#include <monitor.h>
#include <cuda_runtime_api.h>
#include <cupti.h>
#include <lib/prof-lean/spinlock.h>
#include <hpcrun/thread_data.h>
#include <messages/messages.h>
#include <hpcrun/sample_event.h>
#include <hpcrun/safe-sampling.h>
#include <hpcrun/sample_sources_all.h>
#include <sample-sources/common.h>
#include <sample-sources/ss-obj-name.h>
#include "papi-c.h"
#include "papi-c-extended-info.h"
Go to the source code of this file.
◆ Chk_dlopen
#define Chk_dlopen |
( |
|
v, |
|
|
|
lib, |
|
|
|
flags |
|
) |
| |
Value:void* v = monitor_real_dlopen(lib, flags); \
if (! v) { \
fprintf(stderr, "gpu dlopen %s failed\n", lib); \
return; \
} \
Definition at line 62 of file papi-c-cupti.c.
◆ Chk_dlsym
#define Chk_dlsym |
( |
|
h, |
|
|
|
fn |
|
) |
| |
Value:{ \
dlerror(); \
d ## fn = dlsym(h, #fn); \
char* e = dlerror(); \
if (e) { \
fprintf(stderr, "dlsym(%s) fails w '%s'\n", #fn, e); \
return; \
} \
}
Definition at line 69 of file papi-c-cupti.c.
◆ Cupti_call
#define Cupti_call |
( |
|
fn, |
|
|
|
... |
|
) |
| |
Value:{ \
int ret = fn(__VA_ARGS__); \
if (ret != CUPTI_SUCCESS) { \
const char* errstr; \
dcuptiGetResultString(ret, &errstr); \
hpcrun_abort("error: CUDA/CUPTI API " \
#fn " failed w error code %d ==> '%s'\n", \
ret, errstr); \
} \
}
Definition at line 45 of file papi-c-cupti.c.
◆ Cupti_call_silent
#define Cupti_call_silent |
( |
|
fn, |
|
|
|
... |
|
) |
| |
Value:{ \
(void) fn(__VA_ARGS__); \
}
Definition at line 57 of file papi-c-cupti.c.
◆ CUPTI_LAUNCH_CALLBACK_DEPTH
#define CUPTI_LAUNCH_CALLBACK_DEPTH 7 |
◆ cuda_callback_t
◆ dlgpu()
static void dlgpu |
( |
void |
| ) |
|
|
static |
◆ hpcrun_cuda_kernel_callback()
static void CUPTIAPI hpcrun_cuda_kernel_callback |
( |
void * |
userdata, |
|
|
CUpti_CallbackDomain |
domain, |
|
|
CUpti_CallbackId |
cbid, |
|
|
const CUpti_CallbackData * |
cbInfo |
|
) |
| |
|
static |
◆ is_papi_c_cuda()
static bool is_papi_c_cuda |
( |
const char * |
name | ) |
|
|
static |
◆ papi_c_cupti()
◆ papi_c_cupti_add_event()
int papi_c_cupti_add_event |
( |
int |
ev_s, |
|
|
int |
ev |
|
) |
| |
◆ papi_c_cupti_finalize_event_set()
void papi_c_cupti_finalize_event_set |
( |
void |
| ) |
|
◆ papi_c_cupti_get_event_set()
void papi_c_cupti_get_event_set |
( |
int * |
ev_s | ) |
|
◆ papi_c_cupti_setup()
static void papi_c_cupti_setup |
( |
void |
| ) |
|
|
static |
◆ papi_c_cupti_teardown()
static void papi_c_cupti_teardown |
( |
void |
| ) |
|
|
static |
◆ papi_c_no_action()
static void papi_c_no_action |
( |
void |
| ) |
|
|
static |
◆ cuda_component
Initial value:= {
.process_only = true,
}
static void papi_c_no_action(void)
static void papi_c_cupti_teardown(void)
static void papi_c_cupti_setup(void)
void papi_c_cupti_get_event_set(int *ev_s)
int papi_c_cupti_add_event(int ev_s, int ev)
void papi_c_cupti_finalize_event_set(void)
static bool is_papi_c_cuda(const char *name)
Definition at line 367 of file papi-c-cupti.c.
◆ cupti_lock
◆ dcudaThreadSynchronize
cudaError_t(* dcudaThreadSynchronize) (void) |
◆ dcuptiEnableCallback
CUptiResult(* dcuptiEnableCallback) (uint32_t enable, CUpti_SubscriberHandle subscriber, CUpti_CallbackDomain domain, CUpti_CallbackId cbid) |
◆ dcuptiGetResultString
CUptiResult(* dcuptiGetResultString) (CUptiResult result, const char **str) |
◆ dcuptiSubscribe
CUptiResult(* dcuptiSubscribe) (CUpti_SubscriberHandle *subscriber, CUpti_CallbackFunc callback, void *userdata) |
◆ dcuptiUnsubscribe
CUptiResult(* dcuptiUnsubscribe) (CUpti_SubscriberHandle subscriber) |
◆ event_set_created
bool event_set_created = false |
|
static |
◆ event_set_finalized
bool event_set_finalized = false |
|
static |
◆ local
◆ setup_lock
◆ subscriber
CUpti_SubscriberHandle subscriber |
|
static |