Skip to main content

Module managed_hints

Module managed_hints 

Source
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

§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§

ManagedMemoryHints
Builder-style API for applying memory hints to a unified memory region.
PrefetchEntry
An entry in a PrefetchPlan recording a single prefetch operation.
PrefetchPlan
Batch multiple prefetch operations into a single plan.

Enums§

MigrationPolicy
Declarative migration policy for unified memory regions.

Functions§

apply_migration_policy
Applies a MigrationPolicy to a raw unified memory region.