Deeploy.TilingExtension.TilingCodegen.computeTileHyperRectangles

Deeploy.TilingExtension.TilingCodegen.computeTileHyperRectangles(memoryTransfer: MemoryTransfer) List[HyperRectangle]

Compute hyperrectangle tiles for a memory transfer operation.

Generates a list of hyperrectangle tiles that partition the source tensor into smaller chunks that fit within the destination memory constraints. This is fundamental for tiled execution where large tensors are processed in smaller, memory-efficient pieces.

Parameters:

memoryTransfer (MemoryTransfer) – The memory transfer operation defining source and destination constraints.

Returns:

A list of hyperrectangle tiles that cover the entire source tensor, each fitting within the destination memory constraints.

Return type:

List[HyperRectangle]

Raises:

AssertionError – If source or destination shapes are undefined, if they have different numbers of dimensions, or if any destination dimension is larger than the corresponding source dimension.

Notes

The tiling algorithm generates non-overlapping tiles that completely cover the source tensor. Each tile is sized to fit within the destination memory constraints, with edge tiles potentially being smaller to fit exactly within the source tensor boundaries.

The tiles are generated in row-major order, iterating through dimensions from outermost to innermost.