For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
tile_layout_k_major
def tile_layout_k_major[dtype: DType, BM: Int, BK: Int, swizzle_mode: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_NONE, page_dense: Bool = False]() -> Layout
Creates a K-major layout for tensor core operations.
Constructs a layout optimized for K-major access patterns in tensor core operations, with optional swizzling for improved memory access patterns.
Parameters:
- dtype (
DType): Element data type of the tensor. - BM (
Int): Size of the M dimension in the tile. - BK (
Int): Size of the K dimension in the tile. - swizzle_mode (
TensorMapSwizzle): Memory access pattern swizzling mode (default: SWIZZLE_NONE). - page_dense (
Bool): WhenTrue, return the native chunk-inner (row-major atoms) k-major layout instead of the default chunk-outer form. The two are byte-distinct whenBKspans more than one swizzle atom (num_chunks >= 2); the chunk-inner form lays each page contiguously so one TMA fills it (the SM100 row-major page-fold path, K-side analog of thetile_layout_mn_majorpage_densebranch). SWIZZLE_128B only.
Returns:
Layout: Layout - A K-major layout configured for the specified dimensions and swizzle mode.