Skip to content
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

Clarify blocking behavior of queue::submit #354

Merged

Conversation

psalz
Copy link
Member

@psalz psalz commented Feb 2, 2023

Clarify that the CGF provided to queue::submit is invoked in the calling thread.

Resolves #307.

<<command-group-function-object>> (as described in
<<sec:command-groups-exec-order>>) in the calling thread, thereby scheduling a
<<command-group>> for asynchronous execution. Any error in the submission of a
<<command-group>> is handled by throwing a synchronous SYCL exceptions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<<command-group>> is handled by throwing a synchronous SYCL exceptions.
<<command-group>> is handled by throwing a synchronous SYCL exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, thanks.

<<sec:command-groups-exec-order>>) in the calling thread, thereby scheduling a
<<command-group>> for asynchronous execution. Any error in the submission of a
<<command-group>> is handled by throwing a synchronous SYCL exceptions.
Any exceptions from the <<command-group>> after it has
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Any exceptions from the <<command-group>> after it has
Any errors from the <<command-group>> after it has

I think we mean errors more generally here, right? For example, an error from the underlying backend could cause the asynchronous error handler to be called. An exception from the application's host task could also cause the asynchronous error handler to be called, but we say that in the definition of host tasks.

Notably, exceptions in other commands are not guaranteed to call the asynchronous error handler (because exception are not allowed in device code).

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Not really related to this PR but I guess we can do a drive-by clarification :)

@psalz psalz force-pushed the clarify-blocking-queue-submit branch from 7758819 to faf4526 Compare February 2, 2023 16:34
@fraggamuffin
Copy link

will wait, need more time
need to access same TLS vars in outside scope
submit calls fn object (factory fn) is synchronous to control scope of how command group is constructed
LGTM

@keryell keryell merged commit a74bce6 into KhronosGroup:SYCL-2020/master Feb 16, 2023
@psalz psalz deleted the clarify-blocking-queue-submit branch February 17, 2023 12:49
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.

Clarify blocking behavior of queue::submit
6 participants