copy_tile

void ckernel::copy_tile_init(uint32_t cbid, uint32_t call_line = __builtin_LINE())

Perform a init for the copy tile operation. This calls the short init function and initializes packer dst offset registers.

void ckernel::copy_tile(uint32_t in_cb_id, uint32_t in_tile_index, uint32_t dst_tile_index)

Copies a single tile from the specified input CB and writes the result to DST at a specified index. The function will employ unpacker to first unpack into SRC registers and then perform move into DST registers, at a specified index. For the in_tile_index to be valid for this call, cb_wait_front(n) had to be previously called to ensure that at least some number n>0 of tiles are available in the input CB. The CB index 0 then references the first tile in the received section of the CB, up to index n-1 (in a FIFO order). The DST register buffer must be in acquired state via acquire_dst call. This call is blocking and is only available on the compute engine.

Return value: None

Argument

Description

Data type

Valid range

required

in_cb_id

The identifier of the source circular buffer (CB)

uint32_t

0 to 31

True

in_tile_index

The index of the tile to copy from the input CB

uint32_t

Must be less than the size of the CB

True

dst_tile_index

The index of the tile in the DST register

uint32_t

Must be less than the size of the DST register (16)

True

void ckernel::copy_block(uint32_t in_cb_id, uint32_t start_in_tile_index, uint32_t start_dst_tile_index, uint32_t ntiles)

Copies a block of ntiles consecutive tiles from the specified input CB into consecutive DST register slots. This is the uniform block entry point for the copy/datacopy op group. It uses the block unpack/datacopy llk paths and requires the same initialization as copy_tile (copy_tile_init / copy_tile_to_dst_init_short). The DST register buffer must be in acquired state via acquire_dst call, and cb_wait_front(n) must have made at least start_in_tile_index + ntiles tiles available in the input CB. This call is blocking and is only available on the compute engine.

NOTE: In the future the blocking must be folded further into a hardware MOP / REPLAY buffer (as is being done for Quasar) inside llk-lib, so the whole block issues as a single packed op, without changing this signature. Tracked under the Compute API Split effort (tt-metal#35739); the per-op push-down lands in tt-metal#47485.

Return value: None

Argument

Description

Data type

Valid range

required

in_cb_id

The identifier of the source circular buffer (CB)

uint32_t

0 to 31

True

start_in_tile_index

The index of the first tile to copy from the input CB

uint32_t

Must be less than the size of the CB

True

start_dst_tile_index

The index of the first destination tile in the DST register

uint32_t

Must be less than the size of the DST register (16)

True

ntiles

The number of consecutive tiles to copy

uint32_t

start_dst_tile_index + ntiles <= DST register size

True

void ckernel::copy_block_matmul_partials(uint32_t in_cb_id, uint32_t start_in_tile_index, uint32_t start_dst_tile_index, uint32_t ntiles)

Deprecated:

Use copy_block(), which is functionally equivalent (same block unpack/datacopy paths). This forwarding shim is retained only for backwards compatibility and will be removed after August 15th, 2026 (see .github/deprecations.json).

Return value: None

Argument

Description

Data type

Valid range

required

in_cb_id

The identifier of the source circular buffer (CB)

uint32_t

0 to 31

True

start_in_tile_index

The index of the first tile to copy from the input CB

uint32_t

Must be less than the size of the CB

True

start_dst_tile_index

The index of the first destination tile in the DST register

uint32_t

Must be less than the size of the DST register (16)

True

ntiles

The number of consecutive tiles to copy

uint32_t

start_dst_tile_index + ntiles <= DST register size

True

void ckernel::copy_tile_to_dst_init_short_with_dt(uint32_t old_cbid, uint32_t new_cbid, uint32_t transpose = 0)

Return value: None

Argument

Description

Type

Valid Range

Required

old_cbid

The identifier of the previous input circular buffer (CB) to SrcA

uint32_t

0 to 31

True

new_cbid

The identifier of the new input circular buffer (CB) to SrcA

uint32_t

0 to 31

True

transpose

Flag to perform transpose on SrcA

uint32_t

Any positive value will indicate transpose is set

False

void ckernel::copy_tile_to_dst_init_short(uint32_t cbid, uint32_t transpose = 0, uint32_t transpose_within_16x16_face = false, uint32_t call_line = __builtin_LINE())

Perform the init short for copy tile. This does not reconfigure the unpacker data types. Return value: None

Argument

Description

Type

Valid Range

Required

cbid

The identifier of the input circular buffer (CB)

uint32_t

0 to 31

False

transpose

Flag to perform transpose on SrcA

uint32_t

Any positive value will indicate transpose is set

False

transpose_within_16x16_face

Flag to perform transpose within 16x16 face

uint32_t

Any positive value will indicate transpose within 16x16 face is set

False