pub struct DeviceLayerWindow { /* private fields */ }Expand description
Deterministic controller for a bounded ordered device-layer window.
Implementations§
Source§impl DeviceLayerWindow
impl DeviceLayerWindow
Sourcepub fn new(
units: impl IntoIterator<Item = OffloadUnitId>,
depth: usize,
) -> Result<Self, ResidencyWindowError>
pub fn new( units: impl IntoIterator<Item = OffloadUnitId>, depth: usize, ) -> Result<Self, ResidencyWindowError>
Creates a controller for a non-empty, duplicate-free unit sequence.
Sourcepub const fn depth(&self) -> usize
pub const fn depth(&self) -> usize
Returns the maximum number of ordered units kept on the device.
Sourcepub fn units(&self) -> &[OffloadUnitId]
pub fn units(&self) -> &[OffloadUnitId]
Returns units in execution order.
Sourcepub fn desired(
&self,
current: usize,
) -> Result<&[OffloadUnitId], ResidencyWindowError>
pub fn desired( &self, current: usize, ) -> Result<&[OffloadUnitId], ResidencyWindowError>
Returns the desired window beginning at current.
Sourcepub fn prepare<M: ResidencyWindowManager>(
&self,
manager: &M,
current: usize,
) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, M::Error>
pub fn prepare<M: ResidencyWindowManager>( &self, manager: &M, current: usize, ) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, M::Error>
Prepares and trims the default window beginning at current.
Sourcepub fn trim_to<M: ResidencyWindowManager>(
&self,
manager: &M,
desired: &[OffloadUnitId],
) -> Result<(), M::Error>
pub fn trim_to<M: ResidencyWindowManager>( &self, manager: &M, desired: &[OffloadUnitId], ) -> Result<(), M::Error>
Explicitly evicts every managed device copy outside desired.
Trait Implementations§
Source§impl Clone for DeviceLayerWindow
impl Clone for DeviceLayerWindow
Source§fn clone(&self) -> DeviceLayerWindow
fn clone(&self) -> DeviceLayerWindow
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 moreAuto Trait Implementations§
impl Freeze for DeviceLayerWindow
impl RefUnwindSafe for DeviceLayerWindow
impl Send for DeviceLayerWindow
impl Sync for DeviceLayerWindow
impl Unpin for DeviceLayerWindow
impl UnsafeUnpin for DeviceLayerWindow
impl UnwindSafe for DeviceLayerWindow
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