General Restrictions
When managing physical memories at different levels, Ascend C uses an abstract logical position (TPosition) to express storage at each level, replacing on-chip physical storage and hiding the hardware architecture. TPosition types include VECIN, VECOUT, VECCALC, A1, A2, B1, B2, CO1 and CO2. For details, see TPosition. Table 1 describes the mapping between TPosition and physical memory.
TPosition |
Physical Memory |
|---|---|
GM |
Global Memory |
VECIN |
Unified Buffer |
VECCALC |
Unified Buffer |
VECOUT |
Unified Buffer |
A1 |
L1 Buffer |
A2 |
L0A Buffer |
B1 |
L1 Buffer |
B2 |
L0B Buffer |
C1 |
|
C2 |
|
CO1 |
L0C Buffer |
CO2 |
|
TSCM |
L1 Buffer |
SPM |
|
C2PIPE2GM |
The Ascend C memory management module aligns the start address during memory allocation. Table 2 describes the alignment requirements for different types of memory units.
To call the Ascend C APIs for data compute and transfer, the destination and source operands must meet the address offset alignment restrictions specified in Table 2. The start address alignment restrictions specified by an Ascend C instruction API apply in the case of restriction inconsistency.