MCPcopy Create free account
hub / github.com/NVIDIA/cccl / load

Method load

c/parallel/src/hostjit/loader.cpp:110–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110bool DynamicLibrary::load(const std::string& library_path)
111{
112 unload();
113
114#ifdef _WIN32
115 SetLastError(0);
116 handle_ = static_cast<void*>(LoadLibraryA(library_path.c_str()));
117
118 if (!handle_)
119 {
120 last_error_ = getWindowsError();
121 if (last_error_.empty())
122 {
123 last_error_ = "Unknown LoadLibrary error";
124 }
125 return false;
126 }
127
128 // The DLL is linked with /NOENTRY (no CRT startup), so C++ static
129 // constructors (e.g. CUDA fatbin registration) haven't run yet.
130 runStaticInitializers(static_cast<HMODULE>(handle_));
131#else
132 dlerror();
133 handle_ = dlopen(library_path.c_str(), RTLD_LAZY | RTLD_LOCAL);
134
135 if (!handle_)
136 {
137 const char* error = dlerror();
138 last_error_ = error ? error : "Unknown dlopen error";
139 return false;
140 }
141#endif
142
143 last_error_.clear();
144 return true;
145}
146
147void* DynamicLibrary::getSymbol(const std::string& symbol_name)
148{

Callers 15

codegenMethod · 0.80
cacherFunction · 0.80
_unpack_state_arraysFunction · 0.80
codegenFunction · 0.80
operator()Method · 0.80
performMethod · 0.80
performMethod · 0.80
performMethod · 0.80
performMethod · 0.80
initializeMethod · 0.80
validateMethod · 0.80

Calls 4

getWindowsErrorFunction · 0.85
runStaticInitializersFunction · 0.85
emptyMethod · 0.45
clearMethod · 0.45

Tested by 15

operator()Method · 0.64
performMethod · 0.64
performMethod · 0.64
performMethod · 0.64
performMethod · 0.64
initializeMethod · 0.64
validateMethod · 0.64
initializeMethod · 0.64
validateMethod · 0.64
initializeMethod · 0.64
validateMethod · 0.64
initializeMethod · 0.64