transpose_tile

void ckernel::transpose_init(uint32_t icb, uint32_t call_line = __builtin_LINE())

Paired init function for transpose_tile. 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. transpose_init() then reconfigures the unpacker/math pipeline for the transpose op and is the function to call before transpose_tile() (including when switching to transpose from another op). For general information on init functions refer to any_init.

Argument

Description

Type

Valid Range

Required

icb

The identifier of the circular buffer (CB) containing input

uint32_t

0 to 31

True

void ckernel::transpose_tile(uint32_t icb, uint32_t itile, uint32_t idst)

Performs a 32x32 transpose operation B[w,h] = A[h,w] on a tile in the CB at a given index and writes the result to the DST register at index dst_tile_index. 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

Type

Valid Range

Required

in_cb_id

The identifier of the circular buffer (CB) containing A

uint32_t

0 to 31

True

in_tile_index

The index of tile A within the first CB

uint32_t

Must be less than the size of the CB

True

dst_tile_index

The index of the tile in DST REG for the result B

uint32_t

Must be less than the acquired size of DST REG

True

void ckernel::transpose_block(uint32_t icb, uint32_t start_itile, uint32_t start_idst, uint32_t ntiles)

Performs a 32x32 transpose operation B[w,h] = A[h,w] on ntiles consecutive tiles from the input CB, writing each result to a consecutive DST register slot. This is the uniform block entry point for the transpose op group: its body is a simple loop over transpose_tile, so it inherits transpose_tile’s semantics and requires the same initialization (transpose_init, preceded once by compute_kernel_hw_startup(icb, ocb)) to have been called first. 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.

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

Return value: None

Argument

Description

Type

Valid Range

Required

icb

The identifier of the circular buffer (CB) containing A

uint32_t

0 to 31

True

start_itile

The index of the first tile A within the CB

uint32_t

Must be less than the size of the CB

True

start_idst

The index of the first destination tile in DST REG

uint32_t

Must be less than the acquired size of DST REG

True

ntiles

The number of consecutive tiles to transpose

uint32_t

start_idst + ntiles <= acquired DST REG size

True