-
Notifications
You must be signed in to change notification settings - Fork 164
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
[Extension] Improve Interoperability with other asynchronous libraries #181
Comments
MPI communication and long-running I/O routines are exactly what I face every day, yes! Just a minor comment that probably works with this proposal: for the user-provided test function, there are some cases such as |
Thanks for the hint! I would expect that an implementation of |
That's a good constrain, thanks! |
Added a concept for callbacks. |
Based on a twitter discussion with @ax3l, we should investigate improving the interoperability of SYCL implementations with other asynchronous libraries (such as MPI or some async IO library).
This issue serves to track possible approaches and to discuss the specific requirements for users, so feedback is appreciated :)
At the moment I am thinking in particular of two new features:
1. Specifying command group dependencies on some external events
I think external events could best be implemented on top of the explicit synchronization mechanism that is part of the Intel USM proposal which introduces
sycl::handler::depends_on(sycl::event evt)
, e.g.:In analogy, we could introduce an overload
sycl::handler::depends_on(sycl::external_event evt)
, with a new classexternal_event
:2. Add callback mechanisms
Probably what would be most consistent with SYCL would be adding a function
handler::callback(std::function<void ()>)
to specify callbacks for a given command group handler. Combined with external events, this could lool like this:single_task
kernel running on the host device that depends on the given kernel. However, a callback shall be executed by the SYCL implementation at its earliest covenience, whereas a regular kernel may be delayed in execution (e.g., because of kernel reordering for better overlap of compute/data transfers, waiting for more kernels for batched kernel submission etc).depends_on()
, the location of the function call tocallback()
inside the command group is irrelevant.callback()
calls inside a command group all will be invoked even if some of them are called with the same callback lambda or function object. The order in which they will be executed is implementation defined and not guaranteed to be deterministic.The text was updated successfully, but these errors were encountered: