pub struct CudaStream(/* private fields */);Expand description
A CUDA stream handle.
Wraps the raw CUstream handle from the driver API. The stream is
not automatically destroyed when dropped — call stream_destroy
explicitly or use the stream within its creating context lifetime.
Use CudaStream::DEFAULT to obtain the special legacy-default
stream sentinel.
Implementations§
Source§impl CudaStream
impl CudaStream
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The legacy default CUDA stream (cudaStreamDefault = 0).
Operations on the default stream block all other streams in the context.
Sourcepub const PER_THREAD: Self
pub const PER_THREAD: Self
Per-thread default stream (cudaStreamPerThread).
Equivalent to passing cudaStreamPerThread in the Runtime API.
The value 0x2 is the canonical sentinel used by the CUDA Runtime.
Sourcepub const unsafe fn from_raw(raw: CUstream) -> Self
pub const unsafe fn from_raw(raw: CUstream) -> Self
Construct a CudaStream from a raw driver handle.
§Safety
The caller must ensure the handle is valid and not used after the associated context is destroyed.
Sourcepub fn is_default(self) -> bool
pub fn is_default(self) -> bool
Returns true if this is the legacy default stream.
Trait Implementations§
Source§impl Clone for CudaStream
impl Clone for CudaStream
Source§fn clone(&self) -> CudaStream
fn clone(&self) -> CudaStream
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more