pub struct MemoryPropertyTable { /* private fields */ }Expand description
A queried memory-property table for one device.
Implementations§
Source§impl MemoryPropertyTable
impl MemoryPropertyTable
Sourcepub fn new(ordinals: Vec<MemoryOrdinalInfo>) -> Self
pub fn new(ordinals: Vec<MemoryOrdinalInfo>) -> Self
Build a table from a list of ordinal records.
Sourcepub fn ordinals(&self) -> &[MemoryOrdinalInfo]
pub fn ordinals(&self) -> &[MemoryOrdinalInfo]
All ordinals, in driver-reported order.
Sourcepub fn select_device_ordinal(&self, bytes: u64) -> LevelZeroResult<u32>
pub fn select_device_ordinal(&self, bytes: u64) -> LevelZeroResult<u32>
Select the device-memory ordinal best suited for a bytes-sized
allocation.
Strategy: among ordinals with enough capacity, prefer the one with the highest reported bandwidth (ties broken by larger capacity, then lower ordinal index). This routes large tensors to HBM on Ponte Vecchio while falling back to whatever fits on memory-constrained parts.
Returns LevelZeroError::OutOfMemory when no ordinal can hold bytes,
or LevelZeroError::NoSuitableDevice when the table is empty.
Sourcepub fn total_capacity(&self) -> u64
pub fn total_capacity(&self) -> u64
Total capacity across all reported memory ordinals.
Trait Implementations§
Source§impl Clone for MemoryPropertyTable
impl Clone for MemoryPropertyTable
Source§fn clone(&self) -> MemoryPropertyTable
fn clone(&self) -> MemoryPropertyTable
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 MemoryPropertyTable
impl Debug for MemoryPropertyTable
Source§impl Default for MemoryPropertyTable
impl Default for MemoryPropertyTable
Source§fn default() -> MemoryPropertyTable
fn default() -> MemoryPropertyTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryPropertyTable
impl RefUnwindSafe for MemoryPropertyTable
impl Send for MemoryPropertyTable
impl Sync for MemoryPropertyTable
impl Unpin for MemoryPropertyTable
impl UnsafeUnpin for MemoryPropertyTable
impl UnwindSafe for MemoryPropertyTable
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