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 struct

SharedToGenericTileCopier

struct SharedToGenericTileCopier[thread_layout: Layout[thread_layout.shape_types, thread_layout.stride_types], *, swizzle: Optional[Swizzle] = None, num_threads: Int = thread_layout.size()]

A TileCopier that moves a tile from shared memory into generic memory.

The swizzle parameter is a property of the shared-memory tile being read and must match the swizzle used when that tile was written; passing a mismatched (or None) swizzle produces incorrect data.

Parameters​

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, TileCopier

comptime members​

dst_address_space​

comptime dst_address_space = AddressSpace.GENERIC

Destination AddressSpace this copier writes to.

src_address_space​

comptime src_address_space = AddressSpace.SHARED

Source AddressSpace this copier reads from.

Methods​

copy​

def copy(self, dst: TileTensor[Storage=dst.Storage, 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 shared memory into dst in generic memory.

The non-swizzled path uses TileTensor.copy, which widens to SIMD stores when the layouts permit. The swizzled path walks per-thread elements explicitly and applies the swizzle to the source fragment offsets.

Masked bounds checking, fp32 -> half precision downcast, and binary_op fusion are not supported.

Args:

Was this page helpful?