13 #ifndef _VT_CUDARTWRAP_H_
14 #define _VT_CUDARTWRAP_H_
17 # define EXTERN extern "C"
19 # define EXTERN extern
23 #include "vt_libwrap.h"
25 #include "vt_cuda_runtime_api.h"
37 EXTERN
void vt_cudartwrap_init(
void);
40 EXTERN uint8_t vt_cudart_trace_enabled;
43 EXTERN uint8_t vt_cudart_initialized;
45 EXTERN
void vt_cudartwrap_finalize(
void);
48 #if (defined(VT_MT) || defined(VT_HYB))
49 EXTERN VTThrdMutex* VTThrdMutexCudart;
50 # define CUDARTWRAP_LOCK() VTThrd_lock(&VTThrdMutexCudart)
51 # define CUDARTWRAP_UNLOCK() VTThrd_unlock(&VTThrdMutexCudart)
53 # define CUDARTWRAP_LOCK()
54 # define CUDARTWRAP_UNLOCK()
59 #define CUDARTWRAP_FUNC_INIT(_lw, _lwattr, _func, _rettype, _argtypes, _file, \
61 VT_LIBWRAP_FUNC_INIT(_lw, _lwattr, _func, _rettype, _argtypes, _file, \
64 if(!vt_cudart_initialized){ \
66 if(!vt_cudart_initialized){ \
67 vt_cudartwrap_init(); \
69 CUDARTWRAP_UNLOCK(); \
72 #define CUDARTWRAP_FUNC_START(_lw) \
73 if(vt_cudart_trace_enabled){ \
74 VT_LIBWRAP_FUNC_START(_lw); \
77 #define CUDARTWRAP_FUNC_END(_lw) \
78 if(vt_cudart_trace_enabled) VT_LIBWRAP_FUNC_END(_lw)
Definition: vt_libwrap.c:43
Definition: vt_libwrap.h:96