Skip to content

[SYCL] Reusable Events limitation for cross-context dependencies.#22639

Draft
slawekptak wants to merge 9 commits into
intel:syclfrom
slawekptak:ext_reusable_events_impl_limit_cross_context_wait
Draft

[SYCL] Reusable Events limitation for cross-context dependencies.#22639
slawekptak wants to merge 9 commits into
intel:syclfrom
slawekptak:ext_reusable_events_impl_limit_cross_context_wait

Conversation

@slawekptak

Copy link
Copy Markdown
Contributor

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.

@slawekptak
slawekptak requested a review from a team as a code owner July 15, 2026 09:08
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.
Comment thread sycl/source/reusable_events.cpp Outdated
Comment thread sycl/unittests/Extensions/ReusableEvents.cpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, throwing sycl::errc::invalid for 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_impl to 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.

Comment thread sycl/unittests/Extensions/ReusableEvents.cpp Outdated
Comment thread sycl/unittests/Extensions/ReusableEvents.cpp Outdated
Comment thread sycl/source/reusable_events.cpp
Comment thread sycl/source/reusable_events.cpp Outdated
Comment thread sycl/source/detail/queue_impl.cpp Outdated
@slawekptak
slawekptak marked this pull request as draft July 17, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread sycl/source/reusable_events.cpp Outdated
Comment thread sycl/source/queue.cpp Outdated
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.

4 participants