cuda::experimental::host_launch
Defined in include/cuda/experimental/__launch/host_launch.cuh
-
template<typename _Callable, typename ..._Args>
void cuda::experimental::host_launch(stream_ref __stream, ::cuda::std::reference_wrapper<_Callable> __callable) Launches a host callable to be executed in stream order on the provided stream.
Callable will be called using the supplied reference. If the callable was destroyed or moved by the time it is asynchronously called the behavior is undefined.
Callable can’t take any arguments, if some additional state is required a lambda can be used to capture it.
Callable must not call any APIs from cuda, thrust or cub namespaces. It must not call into CUDA Runtime or Driver APIs. It also can’t depend on another thread that might block on any asynchronous CUDA work.
- Parameters
__stream – Stream to launch the host function on
__callable – A reference to a host function or callable object to call in stream order