pub struct PooledAllocator { /* private fields */ }Implementations§
Source§impl PooledAllocator
impl PooledAllocator
Sourcepub fn new(streams: Vec<Arc<CudaStream>>) -> Self
pub fn new(streams: Vec<Arc<CudaStream>>) -> Self
Construct a pool from a vector of pre-existing streams. All streams must belong to the same context.
Sourcepub fn with_size(ctx: &Arc<CudaContext>, count: usize) -> Self
pub fn with_size(ctx: &Arc<CudaContext>, count: usize) -> Self
Construct a pool by minting count fresh streams on ctx.
Panics with the ContextPoisoned tag if any stream creation
fails so the parent supervisor can restart the actor.
pub fn size(&self) -> usize
Trait Implementations§
Source§impl StreamAllocator for PooledAllocator
impl StreamAllocator for PooledAllocator
Source§fn acquire(&self, _hints: ActorHints) -> Arc<CudaStream>
fn acquire(&self, _hints: ActorHints) -> Arc<CudaStream>
Acquire a stream for a
KernelActor that’s just starting.Auto Trait Implementations§
impl !Freeze for PooledAllocator
impl !RefUnwindSafe for PooledAllocator
impl Send for PooledAllocator
impl Sync for PooledAllocator
impl Unpin for PooledAllocator
impl UnsafeUnpin for PooledAllocator
impl UnwindSafe for PooledAllocator
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