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 function

copy_sram_to_local

def copy_sram_to_local[src_warp_layout: Layout, axis: Optional[Int] = None](dst: LayoutTensor[address_space=dst.address_space, element_layout=dst.element_layout, layout_int_type=dst.layout_int_type, linear_idx_type=dst.linear_idx_type, masked=dst.masked, alignment=dst.alignment], src: LayoutTensor[address_space=src.address_space, element_layout=src.element_layout, layout_int_type=src.layout_int_type, linear_idx_type=src.linear_idx_type, masked=src.masked, alignment=src.alignment])

Synchronously copy data from SRAM (shared memory) to local memory.

This function performs a synchronous memory transfer from SRAM (shared memory) to local memory (registers) using the specified thread layout for workload distribution.

Performance:

  • Distributes the copy workload across multiple threads for parallel execution.
  • Optimized for transferring data from shared memory to registers.
  • Supports optional axis-specific distribution for specialized access patterns.

Constraints:

  • The source tensor must be in SHARED address space (SRAM).
  • The destination tensor must be in LOCAL address space (registers).
  • Both tensors must have the same data type.

Parameters:

  • ​src_warp_layout (Layout): Layout defining how threads are organized for the source tensor. This determines how the workload is distributed among threads.
  • ​axis (Optional[Int]): Optional parameter specifying which axis to distribute along. When provided, distribution happens along the specified axis. When None (default), distribution uses the standard layout pattern.

Args:

Was this page helpful?