pub struct MemoryAdviseState { /* private fields */ }Expand description
Accumulates memory-advise hints for a single USM range.
Applying a set hint records it; applying the matching clear hint removes
it. BiasCached / BiasUncached are mutually exclusive — the most recent
wins. This lets a planner fold a sequence of advise calls into the minimal
effective set before touching the driver.
Implementations§
Source§impl MemoryAdviseState
impl MemoryAdviseState
Sourcepub fn apply(&mut self, advice: MemoryAdvice)
pub fn apply(&mut self, advice: MemoryAdvice)
Apply one advice hint, folding it into the effective state.
Sourcepub fn is_read_mostly(&self) -> bool
pub fn is_read_mostly(&self) -> bool
true when SetReadMostly is currently in effect.
Sourcepub fn is_preferred_location(&self) -> bool
pub fn is_preferred_location(&self) -> bool
true when the range is pinned to its preferred device location.
Sourcepub fn is_accessed_by_device(&self) -> bool
pub fn is_accessed_by_device(&self) -> bool
true when the device is marked as an accessor of this range.
Sourcepub fn cache_bias(&self) -> Option<bool>
pub fn cache_bias(&self) -> Option<bool>
The cache bias: Some(true) cached, Some(false) uncached, None
driver-default.
Sourcepub fn effective_advice(&self) -> Vec<MemoryAdvice>
pub fn effective_advice(&self) -> Vec<MemoryAdvice>
The minimal sequence of advise calls that reproduces this state from a freshly-allocated range. Used to replay folded hints to the driver.
Trait Implementations§
Source§impl Clone for MemoryAdviseState
impl Clone for MemoryAdviseState
Source§fn clone(&self) -> MemoryAdviseState
fn clone(&self) -> MemoryAdviseState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more