Reputation: 655
I have a collection of thousands of SYCL kernels to execute. Once each of these kernels has finished, I need to execute a function on a cl::sycl::buffer
written to by said kernel.
The methods I'm aware of for achieving this are:
cl::sycl::buffer
cl::sycl::accessor
(with cl::sycl::access::target::host_buffer
)Both of these methods are synchronous and blocking. Is it possible to instead attach an asynchronous callback/continuation when submitting kernels to a cl::sycl::queue
that executes as soon as the kernel has finished? Or even better, can the same functionality be achieved with C++2a coroutines? If not, is such a feature planned for SYCL?
Upvotes: 2
Views: 331
Reputation: 795
The feature to attach callbacks or execute on the host from a SYCL queue did not make the cut for SYCL 1.2.1.
There are some proposals being discussed at the moment to bring that feature into the next version of the standard, but everything is still internal to the SYCL group.
In the meantime, if you use ComputeCpp, you can use the host_handler extension, which allows you to execute a lambda on the host based on dependencies from the device. The open source compiler doesn't have that feature yet that I've seen.
Upvotes: 3