For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
owned_tensor
Defines tensors that own their storage, with the storage supplied by an engine.
TileTensor borrows memory that something else owns. OwnedTensor is the
owner: it allocates its storage on construction and hands out TileTensor
views whose origin is tied to it. An OwnedTensorEngine decides what the
storage is and which TensorEngine its views use, so one OwnedTensor type
covers several kinds of memory. OwnedGPUEngine is the shared-memory engine,
and OwnedGPUTensor names an OwnedTensor that uses it.
comptime values
OwnedGPUTensor
comptime OwnedGPUTensor[dtype: DType, address_space: AddressSpace, LayoutType: TensorLayout, alignment: Int = align_of[dtype]()] = OwnedTensor[dtype, address_space, LayoutType, Engine=OwnedGPUEngine[alignment]]
Names an OwnedTensor whose storage comes from OwnedGPUEngine.
Parameters
- dtype (
DType): The element data type of the tensor. - address_space (
AddressSpace): The address space the storage resides in, such asAddressSpace.SHAREDorAddressSpace.LOCAL. - LayoutType (
TensorLayout): The layout of the tensor. - alignment (
Int): The alignment of the storage, in bytes, such as the width of the vector accesses that read it.
Structs
-
OwnedGPUEngine: Backs anOwnedTensorwith GPU shared memory. -
OwnedGPUStorage: Holds the elements of a compact layout in a GPU stack allocation. -
OwnedTensor: Owns the storage for a tensor whose layout is known at compile time.
Traits
-
OwnedTensorEngine: Supplies the storage behind anOwnedTensorand views of that storage.