Skip to main content

StreamManager

Trait StreamManager 

Source
pub trait StreamManager: Send + Sync {
    // Required methods
    fn create_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        device: &'life1 Device,
    ) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn destroy_stream<'life0, 'async_trait>(
        &'life0 self,
        stream: StreamHandle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn synchronize_stream<'life0, 'async_trait>(
        &'life0 self,
        stream: StreamHandle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_stream_ready<'life0, 'async_trait>(
        &'life0 self,
        stream: StreamHandle,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn default_stream(&self, device: &Device) -> StreamHandle;
    fn record_event<'life0, 'async_trait>(
        &'life0 self,
        stream: StreamHandle,
    ) -> Pin<Box<dyn Future<Output = Result<EventHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn wait_event<'life0, 'async_trait>(
        &'life0 self,
        stream: StreamHandle,
        event: EventHandle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Stream manager for asynchronous operations

Required Methods§

Source

fn create_stream<'life0, 'life1, 'async_trait>( &'life0 self, device: &'life1 Device, ) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create new compute stream

Source

fn destroy_stream<'life0, 'async_trait>( &'life0 self, stream: StreamHandle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Destroy stream

Source

fn synchronize_stream<'life0, 'async_trait>( &'life0 self, stream: StreamHandle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Synchronize stream (wait for all operations to complete)

Source

fn is_stream_ready<'life0, 'async_trait>( &'life0 self, stream: StreamHandle, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if stream operations are complete

Source

fn default_stream(&self, device: &Device) -> StreamHandle

Get default stream for device

Source

fn record_event<'life0, 'async_trait>( &'life0 self, stream: StreamHandle, ) -> Pin<Box<dyn Future<Output = Result<EventHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record synchronization point

Source

fn wait_event<'life0, 'async_trait>( &'life0 self, stream: StreamHandle, event: EventHandle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait for event on stream

Implementors§