IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 as AddressSpace.SHARED or AddressSpace.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​

Traits​

Was this page helpful?