Skip to content

[SYCL] Add raii handle for UR context and device #19062

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

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

igchor
Copy link
Member

@igchor igchor commented Jun 18, 2025

and fix context lifetime management in command_list_manager. There were two issues:

  • move ctor and assignment operators were declared as default but that was incorrect - they should set context on the moved-from command_list_manager to nullptr to avoid double free.
  • urContextRelease() was called in the desturctor, which means it context could have been released before other members. Thiss was a problem since zeCommandList was trying to return command_list to the context's cache in it's dtor.

@igchor igchor requested a review from a team as a code owner June 18, 2025 20:05
@igchor igchor temporarily deployed to WindowsCILock June 18, 2025 20:06 — with GitHub Actions Inactive
@igchor igchor temporarily deployed to WindowsCILock June 18, 2025 20:25 — with GitHub Actions Inactive
and fix context lifetime management in command_list_manager.
There were two issues:
- move ctor and assignment operators were declared as default
  but that was incorrect - they should set context on the moved-from
  command_list_manager to nullptr to avoid double free.
- urContextRelease() was called in the desturctor, which means
  it context could have been released before other members.
  Thiss was a problem since zeCommandList was trying to return
  command_list to the context's cache in it's dtor.
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.

1 participant