| 39 | // using namespace nvinfer1; |
| 40 | |
| 41 | CUDADriverWrapper::CUDADriverWrapper() |
| 42 | { |
| 43 | handle = dllOpen(CUDA_LIB_NAME); |
| 44 | // ASSERT(handle != nullptr); // TODO check |
| 45 | |
| 46 | auto load_sym = [](void* handle, const char* name) { |
| 47 | void* ret = dllGetSym(handle, name); |
| 48 | // ASSERT(ret != nullptr); // TODO check |
| 49 | return ret; |
| 50 | }; |
| 51 | |
| 52 | *(void**) (&_cuGetErrorName) = load_sym(handle, "cuGetErrorName"); |
| 53 | *(void**) (&_cuFuncSetAttribute) = load_sym(handle, "cuFuncSetAttribute"); |
| 54 | *(void**) (&_cuLinkComplete) = load_sym(handle, "cuLinkComplete"); |
| 55 | *(void**) (&_cuModuleUnload) = load_sym(handle, "cuModuleUnload"); |
| 56 | *(void**) (&_cuLinkDestroy) = load_sym(handle, "cuLinkDestroy"); |
| 57 | *(void**) (&_cuModuleLoadData) = load_sym(handle, "cuModuleLoadData"); |
| 58 | *(void**) (&_cuLinkCreate) = load_sym(handle, "cuLinkCreate_v2"); |
| 59 | *(void**) (&_cuModuleGetFunction) = load_sym(handle, "cuModuleGetFunction"); |
| 60 | *(void**) (&_cuLinkAddFile) = load_sym(handle, "cuLinkAddFile_v2"); |
| 61 | *(void**) (&_cuLinkAddData) = load_sym(handle, "cuLinkAddData_v2"); |
| 62 | *(void**) (&_cuLaunchCooperativeKernel) = load_sym(handle, "cuLaunchCooperativeKernel"); |
| 63 | *(void**) (&_cuLaunchKernel) = load_sym(handle, "cuLaunchKernel"); |
| 64 | } |
| 65 | |
| 66 | CUDADriverWrapper::~CUDADriverWrapper() |
| 67 | { |
nothing calls this directly
no outgoing calls
no test coverage detected