pub enum PoolType {
ExclusivePages {
max_alloc_size: u64,
},
Direct {
reclaim_at: Option<u64>,
},
SlicedPages {
page_size: u64,
max_slice_size: u64,
max_pool_size: Option<u64>,
},
}Expand description
The type of memory pool to use.
Variants§
ExclusivePages
Use a memory where every allocation is a separate page.
Direct
Give every allocation its own device allocation, sized to the request and reused by exact size.
No carving at all, so it wastes only alignment padding. Worth it where
padding matters more than allocation count — under a
DryRun, where unresolved reservations never
reach the driver at all, or on a device the workload barely fits.
Fields
SlicedPages
Use a memory where each allocation is a slice of a bigger allocation.
Fields
max_pool_size: Option<u64>Hard cap on the total bytes of pages this pool may hold.
The effective cap is floor(max_pool_size / page_size) whole pages.
If max_pool_size < page_size, the page size is shrunk to the
(alignment-rounded) cap so the budget is honored with a single page.
When the cap is reached and no free slice fits after coalescing,
reserving returns IoError
PoolCapacityExceeded instead of silently growing. None (the
previous behavior) keeps unbounded growth.
Note: runtimes that create one memory management per stream (CUDA, HIP) apply the cap per stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolType
impl RefUnwindSafe for PoolType
impl Send for PoolType
impl Sync for PoolType
impl Unpin for PoolType
impl UnsafeUnpin for PoolType
impl UnwindSafe for PoolType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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