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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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)
Sourcefn 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 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
Sourcefn default_stream(&self, device: &Device) -> StreamHandle
fn default_stream(&self, device: &Device) -> StreamHandle
Get default stream for device
Sourcefn 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 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
Sourcefn 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,
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