pub trait StreamTrait: StreamTraitConst {
// Required method
fn as_raw_mut_Stream(&mut self) -> *mut c_void;
// Provided methods
fn wait_for_completion(&mut self) -> Result<()> { ... }
fn wait_event(&mut self, event: &impl EventTraitConst) -> Result<()> { ... }
fn enqueue_host_callback(
&mut self,
callback: Stream_StreamCallback,
) -> Result<()> { ... }
}
Expand description
Mutable methods for core::Stream
Required Methods§
fn as_raw_mut_Stream(&mut self) -> *mut c_void
Provided Methods§
Sourcefn wait_for_completion(&mut self) -> Result<()>
fn wait_for_completion(&mut self) -> Result<()>
Blocks the current CPU thread until all operations in the stream are complete.
Sourcefn wait_event(&mut self, event: &impl EventTraitConst) -> Result<()>
fn wait_event(&mut self, event: &impl EventTraitConst) -> Result<()>
Makes a compute stream wait on an event.
Sourcefn enqueue_host_callback(
&mut self,
callback: Stream_StreamCallback,
) -> Result<()>
fn enqueue_host_callback( &mut self, callback: Stream_StreamCallback, ) -> Result<()>
Adds a callback to be called on the host after all currently enqueued items in the stream have completed.
Note: Callbacks must not make any CUDA API calls. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.