Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce more loader logging #1891

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/common/linux/ur_lib_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
logger::error(
"Failed to unload the library with the handle at address {}",
handle);
} else {
logger::info("unloaded adapter 0x{}", handle);
}
}
}
Expand All @@ -42,8 +44,9 @@ LibLoader::loadAdapterLibrary(const char *name) {
mode |= RTLD_DEEPBIND;
}
#endif

return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(dlopen(name, mode));
HMODULE handle = dlopen(name, mode);
logger::info("loaded adapter 0x{} ({})", handle, name);
return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(handle);
}

void *LibLoader::getFunctionPtr(HMODULE handle, const char *func_name) {
Expand Down
5 changes: 4 additions & 1 deletion source/loader/ur_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ ur_result_t urLoaderTearDown() {
delete context;
});

return ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED;
ur_result_t result =
ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED;
logger::info("---> urLoaderTearDown() -> {}", result);
return result;
}

ur_result_t
Expand Down