18 #include <cuda_runtime_api.h>
57 std::string lib_extension;
59 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \
61 lib_extension =
"lib";
63 lib_extension =
"dylib";
67 #error "Unknown compiler"
81 std::string lib_base_name =
"libcudart";
84 std::ostringstream oss;
85 oss << lib_base_name <<
"." << lib_extension;
89 std::string lib_name = oss.str();
111 const char* symbol_name =
"cudaEventCreate";
114 dynamic_loading::load_symbol<cudaEventCreate_type>(
135 const char* symbol_name =
"cudaEventDestroy";
138 dynamic_loading::load_symbol<cudaEventDestroy_type>(
162 const char* symbol_name =
"cudaEventElapsedTime";
165 dynamic_loading::load_symbol<cudaEventElapsedTime_type>(
186 const char* symbol_name =
"cudaEventRecord";
189 dynamic_loading::load_symbol<cudaEventRecord_type>(
210 const char* symbol_name =
"cudaEventSynchronize";
213 dynamic_loading::load_symbol<cudaEventSynchronize_type>(
234 const char* symbol_name =
"cudaGetDevice";
237 dynamic_loading::load_symbol<cudaGetDevice_type>(
258 const char* symbol_name =
"cudaGetDeviceCount";
261 dynamic_loading::load_symbol<cudaGetDeviceCount_type>(
278 cudaDeviceProp* prop,
284 const char* symbol_name =
"cudaGetDeviceProperties";
287 dynamic_loading::load_symbol<cudaGetDeviceProperties_type>(
308 const char* symbol_name =
"cudaFree";
331 const char* symbol_name =
"cudaMalloc";
334 dynamic_loading::load_symbol<cudaMalloc_type>(
359 const char* symbol_name =
"cudaMemcpy";
362 dynamic_loading::load_symbol<cudaMemcpy_type>(
383 const char* symbol_name =
"cudaSetDevice";
386 dynamic_loading::load_symbol<cudaSetDevice_type>(
407 const char* symbol_name =
"__cudaRegisterFatBinary";
410 dynamic_loading::load_symbol<__cudaRegisterFatBinary_type>(
431 const char* symbol_name =
"__cudaRegisterFatBinaryEnd";
434 dynamic_loading::load_symbol<__cudaRegisterFatBinaryEnd_type>(
455 const char* symbol_name =
"__cudaUnregisterFatBinary";
458 dynamic_loading::load_symbol<__cudaUnregisterFatBinary_type>(
static cudaEventCreate_type cudaEventCreate
static cudaEventSynchronize_type cudaEventSynchronize
static __cudaRegisterFatBinaryEnd_type __cudaRegisterFatBinaryEnd
static __cudaUnregisterFatBinary_type __cudaUnregisterFatBinary
static cudaMalloc_type cudaMalloc
static cudaMemcpy_type cudaMemcpy
static __cudaRegisterFatBinary_type __cudaRegisterFatBinary
static cudaGetDevice_type cudaGetDevice
static cudaEventRecord_type cudaEventRecord
static cudaEventDestroy_type cudaEventDestroy
static cudaGetDeviceCount_type cudaGetDeviceCount
static std::string get_lib_name()
Returns the name of cudart shared library.
static cudaSetDevice_type cudaSetDevice
static cudaFree_type cudaFree
static cudaEventElapsedTime_type cudaEventElapsedTime
static cudaGetDeviceProperties_type cudaGetDeviceProperties
cudaError_t cudaEventSynchronize(cudaEvent_t event)
Definition of CUDA's cudaEventSynchronize function using dynamically loaded cudart library.
void ** __cudaRegisterFatBinary(void *fatCubin)
Definition of CUDA's __cudaRegisterFatBinary function using dynamically loaded cudart library.
cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end)
Definition of CUDA's cudaEventElapsedTime function using dynamically loaded cudart library.
cudaError_t cudaGetDevice(int *device)
Definition of CUDA's cudaGetDevice function using dynamically loaded cudart library.
cudaError_t cudaEventCreate(cudaEvent_t *event)
Definition of CUDA's cudaEventCreate function using dynamically loaded cudart library.
cudaError_t cudaSetDevice(int device)
Definition of CUDA's cudaSetDevice function using dynamically loaded cudart library.
void __cudaRegisterFatBinaryEnd(void **fatCubinHandle)
Definition of CUDA's __cudaRegisterFatBinaryEnd function using dynamically loaded cudart library.
cudaError_t cudaEventDestroy(cudaEvent_t event)
Definition of CUDA's cudaEventDestroy function using dynamically loaded cudart library.
cudaError_t cudaGetDeviceCount(int *count)
Definition of CUDA's cudaGetDeviceCount function using dynamically loaded cudart library.
cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream)
Definition of CUDA's cudaEventRecord function using dynamically loaded cudart library.
cudaError_t cudaFree(void *devPtr)
Definition of CUDA's cudaFree function using dynamically loaded cudart library.
cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, cudaMemcpyKind kind)
Definition of CUDA's cudaMemcpy function using dynamically loaded cudart library.
cudaError_t cudaMalloc(void **devPtr, size_t size)
Definition of CUDA's cudaMalloc function using dynamically loaded cudart library.
void __cudaUnregisterFatBinary(void **fatCubinHandle)
Definition of CUDA's __cudaUnregisterFatBinary function using dynamically loaded cudart library.
cudaError_t cudaGetDeviceProperties(cudaDeviceProp *prop, int device)
Definition of CUDA's cudaGetDeviceProperties function using dynamically loaded cudart library.
void(* __cudaRegisterFatBinaryEnd_type)(void **fatCubinHandle)
cudaError_t(* cudaGetDeviceCount_type)(int *count)
cudaError_t(* cudaEventSynchronize_type)(cudaEvent_t event)
cudaError_t(* cudaGetDevice_type)(int *device)
cudaError_t(* cudaSetDevice_type)(int device)
cudaError_t(* cudaEventRecord_type)(cudaEvent_t event, cudaStream_t stream)
cudaError_t(* cudaFree_type)(void *devPtr)
cudaError_t(* cudaGetDeviceProperties_type)(cudaDeviceProp *prop, int device)
void **(* __cudaRegisterFatBinary_type)(void *fatCubin)
void(* __cudaUnregisterFatBinary_type)(void **fatCubinHandle)
cudaError_t(* cudaEventDestroy_type)(cudaEvent_t event)
cudaError_t(* cudaEventCreate_type)(cudaEvent_t *event)
cudaError_t(* cudaMemcpy_type)(void *dst, const void *src, size_t count, cudaMemcpyKind kind)
cudaError_t(* cudaMalloc_type)(void **devPtr, size_t size)
cudaError_t(* cudaEventElapsedTime_type)(float *ms, cudaEvent_t start, cudaEvent_t end)