> For the complete Mojo documentation index, see [llms.txt](/llms.txt).
> Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

# Layout library

<!-- here only for Listing component -->

Provides layout and layout tensor types, which abstract memory layout for multidimensional data.

- The [`Layout`](/docs/layout/layout/Layout) type represents a mapping
  between a set of logical coordinates and a linear index. It can be used, for
  example, to map logical tensor coordinates to a memory address, or to map GPU
  threads to tiles of data.

- The [`LayoutTensor`](/docs/layout/layout_tensor/LayoutTensor) type is a
  high-performance tensor with explicit memory layout via a `Layout`.

## Modules

* [`coord`](https://mojolang.org/docs/layout/coord.md): Subpackage exposing `std.utils.coord` as `layout.coord` for kernel imports.
* [`copy`](https://mojolang.org/docs/layout/copy.md): Provides copy policy traits and utilities for layout memory operations.
* [`element`](https://mojolang.org/docs/layout/element.md): Provides element-based access to memory using layout-driven vectorization.
* [`int_tuple`](https://mojolang.org/docs/layout/int_tuple.md): Hierarchical integer tuple data structures for high-performance tensor operations.
* [`layout`](https://mojolang.org/docs/layout/layout.md): Provides a high-performance tensor layout system for memory mapping and indexing.
* [`layout_tensor`](https://mojolang.org/docs/layout/layout_tensor.md): Provides the `LayoutTensor` type for representing multidimensional data.
* [`math`](https://mojolang.org/docs/layout/math.md): Implements math methods that work on layout tensors.
* [`runtime_layout`](https://mojolang.org/docs/layout/runtime_layout.md): Provides the `RuntimeLayout` type and functions for working with it. You can use `RuntimeLayout` to define a layout where the dimensions are not known at compile time.
* [`runtime_tuple`](https://mojolang.org/docs/layout/runtime_tuple.md): Provides the `RuntimeTuple` data structure and related utility functions for handling tuple-like data with both compile-time and runtime elements. `RuntimeTuple` is designed for high-performance tensor operations, supporting efficient manipulation of multi-dimensional data structures like shapes, indices, and coordinates.
* [`swizzle`](https://mojolang.org/docs/layout/swizzle.md): Defines swizzle layouts for optimizing memory access patterns.
* [`tensor_core`](https://mojolang.org/docs/layout/tensor_core.md): Tensor Core Module for High-Performance Matrix Operations.
* [`tensor_core_async`](https://mojolang.org/docs/layout/tensor_core_async.md): Tensor Core Async Module.
* [`tile_io`](https://mojolang.org/docs/layout/tile_io.md): Trait and utilities for copying data between `TileTensor`s.
* [`tile_layout`](https://mojolang.org/docs/layout/tile_layout.md): Provides a mixed compile-time/runtime layout system for tensor memory mapping.
* [`tile_tensor`](https://mojolang.org/docs/layout/tile_tensor.md): TileTensor type for structured memory access with compile-time layout information.
* [`tma_async`](https://mojolang.org/docs/layout/tma_async.md): Tensor Memory Accelerator (TMA) Asynchronous Operations Module.

