[SYCL] Reusable Events limitation for cross-context dependencies.#22639
Draft
slawekptak wants to merge 9 commits into
Draft
[SYCL] Reusable Events limitation for cross-context dependencies.#22639slawekptak 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.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SYCL Reusable Events extension to explicitly reject cross-context dependencies for enqueue_wait_event(s), aligning behavior with the current runtime limitation that cross-context waits may be queued behind host-task machinery.
Changes:
- Add context-matching validation to
enqueue_wait_event/enqueue_wait_events, throwingsycl::errc::invalidfor cross-context waits. - Update unit tests to expect the new exception behavior for cross-context waits (single and multiple events).
- Extend the scheduler-bypass limitation enforcement in
queue_impl::submit_barrier_direct_implto cover wait-only reusable-events calls (CallerNeedsEvent == false).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| sycl/unittests/Extensions/ReusableEvents.cpp | Adjusts tests to validate that cross-context waits are rejected, and adds a multi-event variant. |
| sycl/source/reusable_events.cpp | Adds explicit runtime checks to reject cross-context waits in the reusable-events API surface. |
| sycl/source/detail/queue_impl.cpp | Updates barrier submission control flow to enforce the scheduler-bypass limitation for wait-only reusable-events calls. |
the exception messages.
slawekptak
marked this pull request as draft
July 17, 2026 09:51
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
sycl/unittests/Extensions/ReusableEvents.cpp:531
- Typo in comment: "limiation" should be "limitation".
// Current limiation is that an event from different context
gmlueck
approved these changes
Jul 21, 2026
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.