pub enum MemoryPoolConfig {
Exclusive {
max_alloc_size: MemorySize,
dealloc_period: Option<u64>,
},
Sliced {
page_size: MemorySize,
max_slice_size: Option<MemorySize>,
max_pool_size: Option<MemorySize>,
dealloc_period: Option<u64>,
},
}Expand description
One pool entry; mirrors MemoryPoolOptions
and PoolType.
Sizes are aligned up to the device alignment.
Variants§
Exclusive
Every allocation gets its own page
(PoolType::ExclusivePages).
Fields
§
max_alloc_size: MemorySizeLargest allocation this pool accepts. 0 is valid: it makes a pool
dedicated to zero-sized (sub-alignment) allocations.
Sliced
Allocations are slices of larger pages
(PoolType::SlicedPages).
Fields
§
page_size: MemorySizeSize of each page.
§
max_slice_size: Option<MemorySize>Largest slice this pool accepts. Defaults to page_size.
§
max_pool_size: Option<MemorySize>Hard cap on the pool’s total reserved bytes: exceeding it is an
error instead of silent growth. None grows unbounded. Note:
runtimes that create one memory management per stream (CUDA, HIP)
apply the cap per stream.
Trait Implementations§
Source§impl Clone for MemoryPoolConfig
impl Clone for MemoryPoolConfig
Source§fn clone(&self) -> MemoryPoolConfig
fn clone(&self) -> MemoryPoolConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryPoolConfig
impl Debug for MemoryPoolConfig
Source§impl PartialEq for MemoryPoolConfig
impl PartialEq for MemoryPoolConfig
impl StructuralPartialEq for MemoryPoolConfig
Auto Trait Implementations§
impl Freeze for MemoryPoolConfig
impl RefUnwindSafe for MemoryPoolConfig
impl Send for MemoryPoolConfig
impl Sync for MemoryPoolConfig
impl Unpin for MemoryPoolConfig
impl UnsafeUnpin for MemoryPoolConfig
impl UnwindSafe for MemoryPoolConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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