[SYCL] Reusable Events limitation for cross-context dependencies.#22690
Open
slawekptak wants to merge 9 commits into
Open
[SYCL] Reusable Events limitation for cross-context dependencies.#22690slawekptak wants to merge 9 commits into
slawekptak wants to merge 9 commits into
Conversation
Currently, cross-context dependencies are not supported for the Reusable Events APIs. Cross-context dependencies use host tasks internally, so the event wait might be queued behind the host task in the runtime, which is currently not supported by the extension APIs.
the exception messages.
slawekptak
requested review from
KseniyaTikhomirova and
Copilot
and removed request for
KseniyaTikhomirova
July 20, 2026 15:45
Contributor
There was a problem hiding this comment.
Pull request overview
This PR formalizes and tests a current limitation of the SYCL Reusable Events extension APIs: waiting on reusable events across different contexts is not supported, and should fail deterministically with an errc::invalid exception rather than attempting to form cross-context dependencies.
Changes:
- Add explicit validation in
enqueue_wait_event(s)to reject host events and cross-context event waits with a clearerrc::invalidexception. - Update unit tests to assert the new cross-context wait failure behavior (single event + multiple events cases).
- Extend the scheduler-bypass limitation error in
queue_implto cover both signaling and waiting paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sycl/unittests/Extensions/ReusableEvents.cpp | Updates tests to assert cross-context wait is rejected; adds new multi-event coverage. |
| sycl/source/reusable_events.cpp | Adds host-event and cross-context validation for reusable-event wait APIs (and host-event validation for signaling). |
| sycl/source/detail/queue_impl.cpp | Broadens the scheduler-bypass limitation throw to include wait paths, not just signaling. |
Contributor
Author
|
@KseniyaTikhomirova This is a new version of #22639. The previous one will most likely be closed. |
| return RetEvent; | ||
| } | ||
|
|
||
| static void CheckEventAndThrow(detail::event_impl &EventImpl, |
Contributor
There was a problem hiding this comment.
BTW may be const ref would be better
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, cross-context dependencies are not supported for the Reusable Events APIs.
Cross-context dependencies use host tasks internally, so the event wait might be queued behind the host task in the runtime, which is currently not supported by the extension APIs.