pub fn memory_planner(
schedule: &Schedule,
output_buffer_ids: &HashSet<u64>,
mode: PlannerMode,
) -> MemoryPlannerResultExpand description
Run memory planner on a schedule.
Analyzes buffer lifetimes and identifies opportunities for buffer reuse. Returns a mapping from logical buffers to physical buffers.
§Arguments
schedule- The execution schedule to optimizeoutput_buffer_ids- IDs of output buffers that must not be reusedmode- Selects the planner strategy.PlannerMode::Disabledreturns an empty result without analyzing the schedule.PlannerMode::Remapruns liveness-based pool reuse.PlannerMode::Arenaruns the tinygrad-style arena packing pass via [memory_plan_arena].
§Returns
MemoryPlannerResult containing buffer replacements and statistics.