7#ifndef __CUPTI_COMMON_H__
8#define __CUPTI_COMMON_H__
26extern CUresult ( *
cuCtxCreatePtr ) (CUcontext *pctx,
unsigned int flags, CUdevice dev);
52#define DLSYM_AND_CHECK( dllib, name ) dlsym( dllib, name ); \
53 if (dlerror() != NULL) { \
54 ERRDBG("A CUDA required function '%s' was not found in lib '%s'.\n", name, #dllib); \
58#define CUDA_CALL( call, handleerror ) \
60 CUresult _status = (call); \
61 LOGCUDACALL("\t" #call "\n"); \
62 if (_status != CUDA_SUCCESS) { \
63 ERRDBG("CUDA Error %d: Error in call to " #call "\n", _status); \
68#define CUDART_CALL( call, handleerror ) \
70 cudaError_t _status = (call); \
71 LOGCUDACALL("\t" #call "\n"); \
72 if (_status != cudaSuccess) { \
73 ERRDBG("CUDART Error %d: Error in call to " #call "\n", _status); \
78#define CUPTI_CALL( call, handleerror ) \
80 CUptiResult _status = (call); \
81 LOGCUPTICALL("\t" #call "\n"); \
82 if (_status != CUPTI_SUCCESS) { \
83 ERRDBG("CUPTI Error %d: Error in call to " #call "\n", _status); \
CUresult(* cuCtxGetDevicePtr)(CUdevice *)
void * cuptic_load_dynamic_syms(const char *parent_path, const char *dlname, const char *search_subpaths[])
CUresult(* cuGetErrorStringPtr)(CUresult error, const char **pStr)
void cuptic_disabled_reason_set(const char *msg)
int cuptic_is_runtime_perfworks_api(void)
cudaError_t(* cudaFreePtr)(void *)
void cuptic_disabled_reason_get(const char **pmsg)
CUresult(* cuDeviceGetCountPtr)(int *)
CUresult(* cuCtxSetCurrentPtr)(CUcontext)
int cuptic_ctxarr_create(cuptic_info_t *pinfo)
int cuptic_device_release(cuptiu_event_table_t *evt_table)
cudaError_t(* cudaDriverGetVersionPtr)(int *)
CUresult(* cuDeviceGetAttributePtr)(int *, CUdevice_attribute, CUdevice)
CUresult(* cuDevicePrimaryCtxRetainPtr)(CUcontext *pctx, CUdevice)
CUptiResult(* cuptiGetVersionPtr)(uint32_t *)
int cuptic_ctxarr_get_ctx(cuptic_info_t info, int gpu_idx, CUcontext *ctx)
int cuptic_ctxarr_destroy(cuptic_info_t *pinfo)
int cuptic_is_runtime_events_api(void)
CUresult(* cuDeviceGetPtr)(CUdevice *, int)
CUresult(* cuCtxPopCurrentPtr)(CUcontext *pctx)
int cuptic_ctxarr_update_current(cuptic_info_t info)
int cuptic_device_get_count(int *num_gpus)
CUresult(* cuCtxCreatePtr)(CUcontext *pctx, unsigned int flags, CUdevice dev)
CUresult(* cuDeviceGetNamePtr)(char *, int, CUdevice)
CUresult(* cuCtxDestroyPtr)(CUcontext)
cudaError_t(* cudaGetDeviceCountPtr)(int *)
cudaError_t(* cudaDeviceGetAttributePtr)(int *value, enum cudaDeviceAttr attr, int device)
const char * linked_cudart_path
CUresult(* cuCtxGetCurrentPtr)(CUcontext *)
cudaError_t(* cudaGetDevicePropertiesPtr)(struct cudaDeviceProp *prop, int device)
CUresult(* cuInitPtr)(unsigned int)
cudaError_t(* cudaRuntimeGetVersionPtr)(int *)
cudaError_t(* cudaGetDevicePtr)(int *)
int cuptic_device_acquire(cuptiu_event_table_t *evt_table)
CUresult(* cuCtxSynchronizePtr)()
cudaError_t(* cudaSetDevicePtr)(int)
CUresult(* cuCtxPushCurrentPtr)(CUcontext pctx)
CUresult(* cuDevicePrimaryCtxReleasePtr)(CUdevice)
int cuptic_shutdown(void)