pub struct Stream { /* private fields */ }
Expand description
Represents an NPP stream.
An NPP stream is a thin wrapper around a normal CUDA stream (async_cuda_core::Stream
). It
manages some additional context information required in NPP to statelessly execute on a
user-provided stream.
This struct implements Deref
such that it can be used as a normal async_cuda_core::Stream
as well.
§Usage
If the caller wants to use a stream context for mixed NPP and non-NPP operations, they should
create an NPP stream and pass it as CUDA stream when desired. This should work out-of-the-box
since Stream
dereferences to async_cuda_core::Stream
.
Implementations§
Methods from Deref<Target = Stream>§
Sourcepub async fn synchronize(&self) -> Result<(), Error>
pub async fn synchronize(&self) -> Result<(), Error>
Synchronize stream. This future will only return once all currently enqueued work on the stream is done.
§Behavior
In constrast to most of the API, this future does not become ready eagerly. Instead, a callback is pushed onto the given stream that will be invoked to make the future ready once all work on the stream that was previously queued asynchroneously is completed.
Internally, the future uses cudaStreamAddCallback
to schedule the callback on the stream.