-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][UR] Use Windows proxy loader for UR (#15262)
The issues with DLLs and teardown of global objects on Windows is well documented, and was the reason for the use of the `pi_win_proxy_loader` library in SYCL-RT. When we ported from PI to UR, we ported this library (it's now called `ur_win_proxy_loader`), but it was not actually fully utilized. SYCL-RT still linked with `ur_loader.dll` and still experienced issues with race conditions in the teardown of SYCL-RT and Unified Runtime. See #14768. This PR reintroduces the proxy loader as it was previously used with PI. The UR loader (`ur_loader.dll`) is loaded via `LoadLibraryEx` at initialization, and is therefore not cleaned up too early for normal teardown to occur. This necessitates changing the signature of `Plugin->call` to look like it did with PI, taking an enum template argument to specify which UR entry point to call. On Windows, when each plugin (which is a wrapper over a UR adapter) is loaded, it populates a table of function pointers to each API entry point in the UR loader. When UR entry points are called, the function pointer is retrieved from the table. This is more or less equivalent to the previous PI implementation. On Linux, the UR loader is dynamically linked as before. The `Plugin->call` methods just use the regular UR functions rather than programmatically looking up the symbols. For the unittest executables, the UR loader is still dynamically linked as before to avoid having to introduce noisy changes to the tests, and since we aren't concerned about teardown issues there. The implementation of these changes in the runtime should avoid as much overhead as possible (and be no worse than PI), but suggestions on how to improve and tidy things are more than welcome. Associated UR change: oneapi-src/unified-runtime#2045
- Loading branch information
1 parent
e0e7b50
commit 39cd4f3
Showing
56 changed files
with
1,275 additions
and
1,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.