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 struct
LocalToSharedTileCopier
struct LocalToSharedTileCopier[thread_layout: Layout[thread_layout.shape_types, thread_layout.stride_types], *, swizzle: Optional[Swizzle] = None, num_threads: Int = thread_layout.size(), thread_scope: ThreadScope = ThreadScope.BLOCK]
A TileCopier that moves a tile from registers into shared memory.
The AMD row_major prefetch pattern and fp32 -> half precision
downcast are not supported.
Parametersβ
- βthread_layout (
Layout[thread_layout.shape_types, thread_layout.stride_types]): Layout describing how threads are organized over the copy. - βswizzle (
Optional[Swizzle]): Optional swizzle applied to the shared-memory destination; the same swizzle must be used by any subsequent reader of the tile. - βnum_threads (
Int): Total number of threads in the thread block. Threads beyondthread_layout.size()do not participate. - βthread_scope (
ThreadScope): Scope at which thread operations are performed.
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
TileCopier
comptime membersβ
dst_address_spaceβ
comptime dst_address_space = AddressSpace.SHARED
Destination AddressSpace this copier writes to.
src_address_spaceβ
comptime src_address_space = AddressSpace.LOCAL
Source AddressSpace this copier reads from.
Methodsβ
copyβ
def copy(self, dst: TileTensor[Storage=dst.Storage, address_space=Self.dst_address_space, linear_idx_type=dst.linear_idx_type], src: TileTensor[Storage=src.Storage, address_space=Self.src_address_space, linear_idx_type=src.linear_idx_type])
Copies src in local memory into dst in shared memory.
Args:
- βdst (
TileTensor[Storage=dst.Storage, address_space=Self.dst_address_space, linear_idx_type=dst.linear_idx_type]): Destination tile in shared memory. - βsrc (
TileTensor[Storage=src.Storage, address_space=Self.src_address_space, linear_idx_type=src.linear_idx_type]): Source tile in local memory.