Skip to content

Commit b3eb341

Browse files
authored
Merge pull request #1891 from kbenzie/benie/pi2ur-windows-detach-order
Introduce more loader logging
2 parents 78e2ae5 + 6d014cb commit b3eb341

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

source/common/linux/ur_lib_loader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
2323
logger::error(
2424
"Failed to unload the library with the handle at address {}",
2525
handle);
26+
} else {
27+
logger::info("unloaded adapter 0x{}", handle);
2628
}
2729
}
2830
}
@@ -42,8 +44,9 @@ LibLoader::loadAdapterLibrary(const char *name) {
4244
mode |= RTLD_DEEPBIND;
4345
}
4446
#endif
45-
46-
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(dlopen(name, mode));
47+
HMODULE handle = dlopen(name, mode);
48+
logger::info("loaded adapter 0x{} ({})", handle, name);
49+
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(handle);
4750
}
4851

4952
void *LibLoader::getFunctionPtr(HMODULE handle, const char *func_name) {

source/loader/ur_lib.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ ur_result_t urLoaderTearDown() {
212212
delete context;
213213
});
214214

215-
return ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED;
215+
ur_result_t result =
216+
ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED;
217+
logger::info("---> urLoaderTearDown() -> {}", result);
218+
return result;
216219
}
217220

218221
ur_result_t

0 commit comments

Comments
 (0)