Automatic Memory Planning
Description
Automatic memory planning is part of the ptoas compilation process and is intended to reduce the burden of manually specifying local addresses: the compiler allocates local offsets based on the address space, size, alignment, and usage interval of tiles, and reuses storage without changing program semantics.
When using automatic memory planning, you can focus primarily on tile semantics without explicitly specifying all local addresses.
Related Parameters
Automatic memory planning is controlled by --enable-plan-memory, which is enabled by default and cannot be disabled in the current version: the compilation process plans addresses for pto.alloc_tile without explicit addresses.
--enable-plan-memoryMaster switch for automatic memory planning. Currently, it must be enabled and cannot be disabled.--plan-memory-order-by-sizeDisabled by default. It affects only the planning order within the same address space: when disabled, tiles are planned in their declaration order (the order in whichpto.alloc_tileappears in the source program); when enabled,ptoasprioritizes planning larger local buffers within the same address space, and then applies the basic memory reuse strategy.
Default Recommendations
If you need to verify program semantics first, you can use the default automatic memory planning method.
Observable Effects
With automatic memory planning, you can typically:
- Reduce explicit local address configuration.
- Simplify the input program.
- Reduce the complexity of address configuration during the example and feature verification phases.
Troubleshooting
If address-related behavior does not meet expectations, you are advised to:
- Check the current automatic memory planning parameters.