pub struct CudaStreamManager { /* private fields */ }Expand description
CUDA stream manager
Implementations§
Source§impl CudaStreamManager
impl CudaStreamManager
pub fn new(config: CudaStreamConfig) -> Self
Sourcepub fn create_stream(&mut self, priority: Option<i32>) -> Result<u32, CudaError>
pub fn create_stream(&mut self, priority: Option<i32>) -> Result<u32, CudaError>
Create new stream
Reuses a previously Self::destroy_streamd stream from
stream_pool when one is available (its operation queue is cleared
and it is given a fresh ID) instead of always allocating a new one.
Sourcepub fn destroy_stream(&mut self, stream_id: u32) -> Result<(), CudaError>
pub fn destroy_stream(&mut self, stream_id: u32) -> Result<(), CudaError>
Destroy stream
Returns the stream to stream_pool for Self::create_stream to
reuse instead of dropping it outright.
Sourcepub fn add_operation(
&mut self,
stream_id: u32,
operation: CudaOperation,
) -> Result<(), CudaError>
pub fn add_operation( &mut self, stream_id: u32, operation: CudaOperation, ) -> Result<(), CudaError>
Add operation to stream
Auto Trait Implementations§
impl !Send for CudaStreamManager
impl !Sync for CudaStreamManager
impl Freeze for CudaStreamManager
impl RefUnwindSafe for CudaStreamManager
impl Unpin for CudaStreamManager
impl UnsafeUnpin for CudaStreamManager
impl UnwindSafe for CudaStreamManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more