-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL] Avoid releasing UR objects on sycl destruction on windows #15182
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
[SYCL] Avoid releasing UR objects on sycl destruction on windows #15182
Conversation
65a9843
to
bb59a3f
Compare
840c74e
to
c711d7b
Compare
c711d7b
to
030abe2
Compare
030abe2
to
2e6d997
Compare
2e6d997
to
7423b42
Compare
7423b42
to
8b20f94
Compare
8b20f94
to
429bb3d
Compare
429bb3d
to
639b76e
Compare
639b76e
to
f6468ca
Compare
c3e7b46
to
565fb13
Compare
565fb13
to
436ec4f
Compare
436ec4f
to
498c7b6
Compare
#ifdef _WIN32 | ||
if (!sycl::detail::GlobalHandler::instance().isUrTearDowned) { | ||
const PluginPtr &Plugin = getSyclObjImpl(MContext)->getPlugin(); | ||
Plugin->call(urProgramRelease, MProgram); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible for the call function to internally check isUrTearDowned
and return some 'unitinitalized' value (or just ignore it)? That way, we generically workaround this issue in one place, rather than doing in on a case-by-case basis.
This would be redundant as a mechanism already exist for tracking URAdapterRelease call |
SYCL-RT depends currently on the call to
DLLMain
to begin its destruction on windows. However, when sycl-rtDLLMain
is called, UR have already began its destruction on another thread and in case of level_zero, level_zero_loader.dll also began its destruction far before that, this would lead to race condition and access violations. as when release of UR objects begin either level_zero loader/UR adapter/UR loader have been unloaded already.So, this PR is a guard for that to not call UR objects release when sycl-rt began its destruction.