#[non_exhaustive]pub enum Residency {
Host,
Device(BackendId),
Unified(BackendId),
}Expand description
Where an operation’s data physically lives.
Device preference says where to run; residency says where the bytes already are. Routing needs both: a GPU-resident batch is cheap to run on the GPU and expensive to run on the CPU, and the reverse holds for a host-resident one. Without this, a planner cannot see a transfer that dominates the operation it is scheduling.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Host
Host (CPU) memory.
Device(BackendId)
Memory owned by the named device.
Unified(BackendId)
Host-visible memory shared with the named device; no copy is needed.
Implementations§
Source§impl Residency
impl Residency
Sourcepub fn is_local_to(self, backend: BackendId) -> bool
pub fn is_local_to(self, backend: BackendId) -> bool
Whether backend can read this data without a host/device transfer.
Sourcepub const fn is_host_readable(self) -> bool
pub const fn is_host_readable(self) -> bool
Whether the host can read this data without a transfer.
Trait Implementations§
impl Copy for Residency
impl Eq for Residency
impl StructuralPartialEq for Residency
Auto Trait Implementations§
impl Freeze for Residency
impl RefUnwindSafe for Residency
impl Send for Residency
impl Sync for Residency
impl Unpin for Residency
impl UnwindSafe for Residency
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