Skip to content

[SYCL][L0] Gracefully handle the case that L0 was already unloaded when we do cleanup #8948

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

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

smaslov-intel
Copy link
Contributor

No description provided.

@smaslov-intel smaslov-intel requested review from a team as code owners April 4, 2023 23:09
@smaslov-intel smaslov-intel temporarily deployed to aws April 4, 2023 23:36 — with GitHub Actions Inactive
@@ -97,6 +97,8 @@ _PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_ADAPTER_INTEL, -1098)
_PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_SURFACE_INTEL, -1099)
_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL, -1100)
_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL, -1101)
// backend is lost, e.g. it was already unloaded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: UNITIALIZED seems suitable for other scenarios as well, like backend is not found, or a library is not system.

@smaslov-intel smaslov-intel temporarily deployed to aws April 5, 2023 00:30 — with GitHub Actions Inactive
…en we do cleanup

Signed-off-by: Sergey V Maslov <sergey.v.maslov@intel.com>
@smaslov-intel smaslov-intel temporarily deployed to aws April 5, 2023 19:36 — with GitHub Actions Inactive
@smaslov-intel smaslov-intel temporarily deployed to aws April 5, 2023 21:08 — with GitHub Actions Inactive
Comment on lines +627 to +630
auto ZeResult = ZE_CALL_NOCHECK(zeEventDestroy, (Event->ZeEvent));
// Gracefully handle the case that L0 was already unloaded.
if (ZeResult && ZeResult != ZE_RESULT_ERROR_UNINITIALIZED)
return mapError(ZeResult);
Copy link
Contributor

@againull againull Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Does it make sense to create another macro like ZE_CALL/ZE_CALL_NOCHECK which will not fail in case of ZE_RESULT_ERROR_UNINITIALIZED to use it in finalize/release functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, it's very limited in number of uses and there are cases where you still need to do smth besides destroying L0 handles, e.g. https://github.com/intel/llvm/pull/8948/files#diff-15dd1eb076d2164bd9e87d9057f05f652a716498e8cdf5975e564c65309a0985R7438

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@againull againull self-requested a review April 5, 2023 22:29
@againull againull merged commit 928a919 into intel:sycl Apr 5, 2023
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
…en we do cleanup (intel#8948)

Signed-off-by: Sergey V Maslov <sergey.v.maslov@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants