#[non_exhaustive]pub enum StreamBinding {
Default(Arc<Context>),
Borrowed(BorrowedStream),
}Expand description
An explicit CUDA stream selection with its retained context.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default(Arc<Context>)
Selects the legacy default stream in the retained context.
Borrowed(BorrowedStream)
Selects a borrowed stream and its associated context.
Implementations§
Source§impl StreamBinding
impl StreamBinding
Sourcepub fn sync_scope<R, E>(
&self,
f: impl FnOnce() -> StdResult<R, E>,
) -> StdResult<R, E>
pub fn sync_scope<R, E>( &self, f: impl FnOnce() -> StdResult<R, E>, ) -> StdResult<R, E>
Completes borrowed work on this stream before returning or unwinding.
Capture is rejected before calling f.
Default and externally borrowed streams use the same completion contract as owned streams.
If completion cannot be established, the process aborts before releasing borrowed storage.
§Errors
Converts capture-query, context binding, capture rejection, and stream synchronization errors into E.
Errors returned by f pass through after cleanup drains the stream and take precedence over a synchronization error if both occur.
Source§impl StreamBinding
impl StreamBinding
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns whether this binding uses the Self::Default variant.
Trait Implementations§
Source§impl AsStream for StreamBinding
impl AsStream for StreamBinding
Source§fn as_raw(&self) -> cudaStream_t
fn as_raw(&self) -> cudaStream_t
Source§fn synchronize(&self) -> Result<()>
fn synchronize(&self) -> Result<()>
Source§fn synchronize_or_abort(&self)
fn synchronize_or_abort(&self)
Source§fn capture_status(&self) -> Result<StreamCaptureStatus>
fn capture_status(&self) -> Result<StreamCaptureStatus>
Source§fn ensure_not_capturing(&self) -> Result<()>
fn ensure_not_capturing(&self) -> Result<()>
Source§fn wait_event(&self, event: &Event, flags: EventWaitFlags) -> Result<()>
fn wait_event(&self, event: &Event, flags: EventWaitFlags) -> Result<()>
event. Read more