MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / set_loader_lib_path

Method set_loader_lib_path

lite/src/global.cpp:141–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void lite::set_loader_lib_path(const std::string& loader_path) {
142 const char* lib_path = loader_path.c_str();
143 LITE_LOG("load a device loader of path %s.", lib_path);
144 auto handle = dlopen(lib_path, RTLD_LAZY);
145 LITE_ASSERT(handle, "failed to open c opr lib %s: %s", lib_path, dlerror());
146 const char* entry = MGB_C_OPR_INIT_FUNC_STR;
147 auto func = dlsym(handle, entry);
148 LITE_ASSERT(func, "can not resolve %s: %s", entry, dlerror());
149 typedef void (*entry_f_t)(void*);
150 reinterpret_cast<entry_f_t>(func)(
151 reinterpret_cast<void*>(&mgb_get_extern_c_opr_api_versioned));
152}
153
154void lite::set_persistent_cache(const std::string& cache_path, bool always_sync) {
155 LITE_LOCK_GUARD(cache_control.cache_mutex);

Callers

nothing calls this directly

Calls 3

dlopenFunction · 0.70
dlerrorFunction · 0.70
dlsymFunction · 0.70

Tested by

no test coverage detected