#[repr(u32)]pub enum MemAdvice {
SetReadMostly = 1,
UnsetReadMostly = 2,
SetPreferredLocation = 3,
UnsetPreferredLocation = 4,
SetAccessedBy = 5,
UnsetAccessedBy = 6,
}Expand description
Memory advice hints for unified (managed) memory.
These hints guide the CUDA runtime’s page migration and caching decisions for unified memory allocations. Providing accurate hints can significantly improve performance by reducing unnecessary page migrations.
Variants§
SetReadMostly = 1
Mark the memory region as read-mostly. This creates read-only copies on accessing processors, reducing migration overhead.
UnsetReadMostly = 2
Undo a previous SetReadMostly hint.
SetPreferredLocation = 3
Set the preferred location for the memory region. The data will preferably reside on the specified device.
UnsetPreferredLocation = 4
Undo a previous SetPreferredLocation hint.
SetAccessedBy = 5
Indicate that the specified device will access this memory region. This can cause the driver to create a mapping on that device.
UnsetAccessedBy = 6
Undo a previous SetAccessedBy hint.
Trait Implementations§
impl Copy for MemAdvice
impl Eq for MemAdvice
impl StructuralPartialEq for MemAdvice
Auto Trait Implementations§
impl Freeze for MemAdvice
impl RefUnwindSafe for MemAdvice
impl Send for MemAdvice
impl Sync for MemAdvice
impl Unpin for MemAdvice
impl UnsafeUnpin for MemAdvice
impl UnwindSafe for MemAdvice
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