MCPcopy Create free account
hub / github.com/NVIDIA/DALI / LoadLibrary

Method LoadLibrary

dali/plugin/plugin_manager.cc:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace dali {
25
26void PluginManager::LoadLibrary(const std::string& lib_path, bool global_symbols, bool allow_fail) {
27 // dlopen is thread safe
28 int flags = global_symbols ? RTLD_GLOBAL : RTLD_LOCAL;
29 flags |= RTLD_LAZY;
30 LOG_LINE << "Loading " << lib_path << "\n";
31 auto handle = dlopen(lib_path.c_str(), flags);
32 if (handle == nullptr) {
33 std::string err_msg =
34 std::string("Failed to load library ") + lib_path + ": " + std::string(dlerror());
35 if (allow_fail) {
36 std::cerr << err_msg << "\n";
37 } else {
38 DALI_FAIL(err_msg);
39 }
40 }
41}
42
43inline const std::string& DefaultPluginPath() {
44 static const std::string path = [&]() -> std::string {

Callers 1

load_libraryFunction · 0.80

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected