pub struct StreamGuard(/* private fields */);Expand description
Keeps a CudaStream alive for the lifetime of an allocation record.
Implementations§
Source§impl StreamGuard
impl StreamGuard
pub fn new(stream: CudaStream) -> Self
Methods from Deref<Target = CudaStream>§
Sourcepub fn as_raw(&self) -> cudaStream_t
pub fn as_raw(&self) -> cudaStream_t
Get the raw CUDA stream handle.
Sourcepub fn synchronize(&self) -> Result<(), CudaError>
pub fn synchronize(&self) -> Result<(), CudaError>
Synchronize this stream.
Sourcepub fn to_host_sync(&self) -> Result<(), CudaError>
pub fn to_host_sync(&self) -> Result<(), CudaError>
Record a per-stream event and synchronize to complete all pending D2H copies. Uses event-based sync rather than cudaStreamSynchronize because this waits only for work up to the event point, allowing future selective sync patterns (e.g., wait for a specific copy without draining the entire stream).
Trait Implementations§
Source§impl Clone for StreamGuard
impl Clone for StreamGuard
Source§fn clone(&self) -> StreamGuard
fn clone(&self) -> StreamGuard
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamGuard
impl Debug for StreamGuard
Source§impl Deref for StreamGuard
impl Deref for StreamGuard
Source§type Target = CudaStream
type Target = CudaStream
The resulting type after dereferencing.
Source§fn deref(&self) -> &CudaStream
fn deref(&self) -> &CudaStream
Dereferences the value.
impl Eq for StreamGuard
Auto Trait Implementations§
impl Freeze for StreamGuard
impl RefUnwindSafe for StreamGuard
impl Send for StreamGuard
impl Sync for StreamGuard
impl Unpin for StreamGuard
impl UnsafeUnpin for StreamGuard
impl UnwindSafe for StreamGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more