copy_tile
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_init(std::uint32_t cbid, std::uint32_t transpose = 0, std::uint32_t transpose_within_16x16_face = false, std::uint32_t call_line = __builtin_LINE())
-
Paired init function for copy_tile / copy_block_matmul_partials. Must be preceded - exactly once, at the very top of the kernel - by compute_kernel_hw_startup(icb, ocb), which performs the one-time hardware configuration. copy_init() then reconfigures the unpacker/math pipeline for the copy op and is the function to call before copy_tile() (including when switching to copy from another op). It does not reconfigure the unpacker data types. Eltwise-unary / SFPU kernels use this same init: compute_kernel_hw_startup(icb, ocb) once, then copy_init(icb).
Numerics: the copy preserves bf16 -0.0 and denormal inputs (it keeps the Src zero-substitution flag disabled), so sign-sensitive SFPU ops such as signbit / copysign read the exact value back out of DST. Matmul and eltwise-binary re-establish the format-driven default themselves, so this preservation never leaks into them.
Return value: None
Argument Description
cbid The identifier of the input circular buffer (CB)
transpose Flag to perform transpose on SrcA
transpose_within_16x16_face Flag to perform transpose within 16x16 face
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_tile_init(std::uint32_t cbid, std::uint32_t call_line = __builtin_LINE())
-
Perform a init for the copy tile operation.
Return value: None
Argument Description
cbid The identifier of the input circular buffer (CB)
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_tile(std::uint32_t in_cb_id, std::uint32_t in_tile_index, std::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
in_cb_id The identifier of the source circular buffer (CB)
in_tile_index The index of the tile to copy from the input CB
dst_tile_index The index of the tile in the DST register
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_block(std::uint32_t in_cb_id, std::uint32_t start_in_tile_index, std::uint32_t start_dst_tile_index, std::uint32_t ntiles)
-
Copies a block of
ntilesconsecutive 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 ascopy_tile(copy_init). The DST register buffer must be in acquired state via acquire_dst call, andcb_wait_front(n)must have made at leaststart_in_tile_index + ntilestiles 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
in_cb_id The identifier of the source circular buffer (CB)
start_in_tile_index The index of the first tile to copy from the input CB
start_dst_tile_index The index of the first destination tile in the DST register
ntiles The number of consecutive tiles to copy
-
void ckernel::copy_block_matmul_partials(std::uint32_t in_cb_id, std::uint32_t start_in_tile_index, std::uint32_t start_dst_tile_index, std::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
in_cb_id The identifier of the source circular buffer (CB)
start_in_tile_index The index of the first tile to copy from the input CB
start_dst_tile_index The index of the first destination tile in the DST register
ntiles The number of consecutive tiles to copy
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_tile_to_dst_init_short_with_dt(std::uint32_t old_cbid, std::uint32_t new_cbid, std::uint32_t transpose = 0)
-
Reconfigures SrcA to the new operand’s data format and re-inits the copy op.
Return value: None
Argument Description
old_cbid The identifier of the previous input circular buffer (CB) to SrcA
new_cbid The identifier of the new input circular buffer (CB) to SrcA
transpose Flag to perform transpose on SrcA
-
template<bool is_fp32_dest_acc_en = DST_ACCUM_MODE>
void ckernel::copy_tile_to_dst_init_short(std::uint32_t cbid, std::uint32_t transpose = 0, std::uint32_t transpose_within_16x16_face = false, std::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
cbid The identifier of the input circular buffer (CB)
transpose Flag to perform transpose on SrcA
transpose_within_16x16_face Flag to perform transpose within 16x16 face