You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Don't use legacy ANSI-only Windows API for loading plugins (#10943)
Currently to load PI plugins we use legacy ANSI-only versions of Windows
API like GetModuleFileNameA, PathRemoveFileSpecA etc. Problem is that if
path containing PI plugins has any non-ANSI symbols then PI plugins are
not found and not loaded.
In this patch get rid of legacy API calls, for example, use
GetModuleFileName instead of GetModuleFileNameA. GetModuleFileName is an
alias which automatically selects the ANSI or Unicode version of this
function.
Another difference is that GetModuleFileName and other similar aliases
work with wchar_t to be able to handle unicode on Windows (in contrast
to legacy GetModuleFileNameA which works with char_t).
So, use std::filesystem:path to work with library paths for convenience
(instead of storing path in std::string or std::wstring) because it
allows to handle paths without caring about format, can be constructed
from string/wstring/.. and can be converted to string/wstring ...
DPCPP is supported on some linux systems where default compiler is gcc
7.5 which doesn't provide `<filesystem>` support. On Windows, minimal
supported version of Visual Studio is 2019 where `<filesystem`> is
available (supported since Visual Studio 2017 version 15.7).
That's why use filesystem::path only on Windows for now, added TODO to
do the same on Linux when matrix support changes.
0 commit comments