pub struct StreamScope<'scope, 'env> { /* private fields */ }Expand description
A borrowed stream scope that drains queued work before borrowed storage can be released.
Constructed by Stream::sync_scope.
Cleanup also drains during unwinding and aborts the process if completion cannot be established.
Implementations§
Source§impl<'scope> StreamScope<'scope, '_>
impl<'scope> StreamScope<'scope, '_>
Sourcepub unsafe fn enqueue<T>(
&self,
accesses: &[Access],
enqueue: impl FnOnce() -> Result<T>,
) -> Result<T>
pub unsafe fn enqueue<T>( &self, accesses: &[Access], enqueue: impl FnOnce() -> Result<T>, ) -> Result<T>
Enqueues work on the scope’s stream after declaring the accesses it makes.
The declared accesses order the work after conflicting tracked work and make later tracked work wait for it.
Wrapper _scoped functions use this to record their operands’ accesses.
§Safety
enqueue must only enqueue work on Self::stream that touches the declared accesses, in the declared modes.
Borrowed operands must be 'env borrows, which the scope keeps alive until it drains.
§Errors
Propagates access-tracking, dependency-ordering, and completion-event errors, and errors returned by enqueue.
Trait Implementations§
Source§impl AsStream for StreamScope<'_, '_>
impl AsStream for StreamScope<'_, '_>
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