Expand description
Ergonomic managed memory hints API.
This module builds on the raw crate::memory_info::mem_advise
and crate::memory_info::mem_prefetch functions to provide
a higher-level, builder-style API for controlling unified memory migration
behaviour.
§Key types
MigrationPolicy— declarative policy for common migration patterns.ManagedMemoryHints— builder for applying hints to a memory region.PrefetchPlan— batch multiple prefetch operations into one plan.
§Example
// Assume `buf` is a UnifiedBuffer<f32> and `dev`/`stream` are valid.
// let hints = ManagedMemoryHints::from_unified(&buf);
// hints.set_read_mostly(&dev)?;
// hints.prefetch_to(&dev, &stream)?;Structs§
- Managed
Memory Hints - Builder-style API for applying memory hints to a unified memory region.
- Prefetch
Entry - An entry in a
PrefetchPlanrecording a single prefetch operation. - Prefetch
Plan - Batch multiple prefetch operations into a single plan.
Enums§
- Migration
Policy - Declarative migration policy for unified memory regions.
Functions§
- apply_
migration_ policy - Applies a
MigrationPolicyto a raw unified memory region.