Skip to content

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

Open
slawekptak wants to merge 9 commits into
intel:syclfrom
slawekptak:ext_reusable_events_impl_limit_cross_context_wait_v2
Open

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

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.

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 20, 2026 15:45
@slawekptak
slawekptak requested review from KseniyaTikhomirova and Copilot and removed request for KseniyaTikhomirova July 20, 2026 15:45

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 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 clear errc::invalid exception.
  • 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_impl to 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.

Comment thread sycl/unittests/Extensions/ReusableEvents.cpp Outdated
Comment thread sycl/unittests/Extensions/ReusableEvents.cpp Outdated
Comment thread sycl/source/reusable_events.cpp
@slawekptak

Copy link
Copy Markdown
Contributor Author

@KseniyaTikhomirova This is a new version of #22639. The previous one will most likely be closed.

Comment thread sycl/source/reusable_events.cpp Outdated
Comment thread sycl/unittests/Extensions/ReusableEvents.cpp Outdated
Comment thread sycl/source/reusable_events.cpp Outdated
Comment thread sycl/source/reusable_events.cpp Outdated

@KseniyaTikhomirova KseniyaTikhomirova 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.

LGTM

return RetEvent;
}

static void CheckEventAndThrow(detail::event_impl &EventImpl,

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.

BTW may be const ref would be better

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