Redesign declarative layout APIs
As part of the smart pointer/sparse tilings design process, it became clear that the tilings were collapsing two separate abstractions into one:
- a description of the data layout as it is folded into linear virtual addresses
- a description of how the data layout could be split into work units
As a first step towards a more flexible AML API, we should split these two abstractions and make building blocks out of it.
First building block: the layouts
A layout is the description of how data is folded into a linear address space. It is part of the descriptive building blocks, meaning it doesn't enforce anything, just describes an existing data structure. More precisely, it describes a generic (possibly sparse or strided) layout over a contiguous address range. We don't intend to support compact or indirect-pointer based layouts for now.
Data included in a layout:
- base pointer,
- number of dimensions,
- dimensions, in order of appearance in memory,
- cumulative pitches: distances between two elements, along a dimension (pitches is the element size),
- strides, in each dimension.
Operators for a layout:
- deref: access to underlying elements
- order: order of coordinates (column/row major) for other operators
- dims: dimensions
Second building block: redesigned tilings
The new tilings are only responsible for describing how to split a data layout into work units. While the previous version of the tiling API was a bit of a misnomer, this is closer to the community-accepted understanding of a tiling.
Data included in a tiling:
- layout pointer: the layout that is being tiled,
- dimensions: in layout elements, of the tile,
- strides, in each dimension,
- optional null element, to handle splits that don't line up perfectly.
Operators for a tiling:
- indexing: retrieving a sublayout based on tile index
- lookup: find & validate tile index based on layout
- tilespace information: retrieve the dimensions of the tiling, in tiles.
- order: order of coordinates for other operators
Connection to other building blocks
This redesign will impact APIs of DMAs and Scratchpads.