File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ ur_result_t mock_urPlatformGetInfo(void *pParams) {
2929 }
3030
3131 if (*params.ppropName == UR_PLATFORM_INFO_NAME) {
32- const char mock_platform_name[] = " UR_PLATFORM_MOCK " ;
32+ const char mock_platform_name[] = " Mock Platform " ;
3333 if (*params.ppPropSizeRet ) {
3434 **params.ppPropSizeRet = sizeof (mock_platform_name);
3535 }
Original file line number Diff line number Diff line change @@ -19,14 +19,18 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {
1919 logger::error (
2020 " Failed to unload the library with the handle at address {}" ,
2121 handle);
22+ } else {
23+ logger::info (" unloaded adapter 0x{}" , handle);
2224 }
2325 }
2426}
2527
2628std::unique_ptr<HMODULE, LibLoader::lib_dtor>
2729LibLoader::loadAdapterLibrary (const char *name) {
28- return std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
30+ auto handle = std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
2931 LoadLibraryExA (name, nullptr , 0 ));
32+ logger::info (" loaded adapter 0x{} ({})" , handle, name);
33+ return handle;
3034}
3135
3236void *LibLoader::getFunctionPtr (HMODULE handle, const char *func_name) {
Original file line number Diff line number Diff line change @@ -188,10 +188,9 @@ class AdapterRegistry {
188188 adaptersLoadPaths.clear ();
189189
190190 std::vector<fs::path> loadPaths;
191- auto adapterNamePathOpt = getAdapterNameAsPath ( mockAdapterName) ;
191+ auto adapterNamePath = fs::path{ mockAdapterName} ;
192192 auto loaderLibPathOpt = getLoaderLibPath ();
193- if (adapterNamePathOpt.has_value () && loaderLibPathOpt.has_value ()) {
194- const auto &adapterNamePath = adapterNamePathOpt.value ();
193+ if (loaderLibPathOpt.has_value ()) {
195194 const auto &loaderLibPath = loaderLibPathOpt.value ();
196195 loadPaths.emplace_back (loaderLibPath / adapterNamePath);
197196 }
Original file line number Diff line number Diff line change 11<TEST>[INFO]: urLoaderInit succeeded.
22<TEST>[INFO]: urPlatformGet found 1 platforms
3- <TEST>[INFO]: Found UR_PLATFORM_MOCK
3+ <TEST>[INFO]: Found Mock Platform
You can’t perform that action at this time.
0 commit comments