#[non_exhaustive]pub struct MemoryBudget {
pub device_bytes: u64,
pub allow_ooc: bool,
pub abort_on_exceed: bool,
}Expand description
GPU memory budget configuration.
Use MemoryBudget::default() or the builder methods (MemoryBudget::from_device_memory,
MemoryBudget::with_limit, MemoryBudget::with_ooc) to construct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.device_bytes: u64Maximum device memory to use in bytes
allow_ooc: boolAllow out-of-core execution (spill to host)
abort_on_exceed: boolAbort on memory budget exceeded (vs try to continue)
Implementations§
Source§impl MemoryBudget
impl MemoryBudget
Sourcepub fn from_device_memory(total_bytes: u64) -> Self
pub fn from_device_memory(total_bytes: u64) -> Self
Create a budget using 80% of available device memory
Sourcepub fn with_limit(device_bytes: u64) -> Self
pub fn with_limit(device_bytes: u64) -> Self
Create a budget with explicit byte limit
Trait Implementations§
Source§impl Clone for MemoryBudget
impl Clone for MemoryBudget
Source§fn clone(&self) -> MemoryBudget
fn clone(&self) -> MemoryBudget
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 MemoryBudget
impl Debug for MemoryBudget
Auto Trait Implementations§
impl Freeze for MemoryBudget
impl RefUnwindSafe for MemoryBudget
impl Send for MemoryBudget
impl Sync for MemoryBudget
impl Unpin for MemoryBudget
impl UnsafeUnpin for MemoryBudget
impl UnwindSafe for MemoryBudget
Blanket Implementations§
impl<T> Allocation for T
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