Skip to main content

scale_c_row

Function scale_c_row 

Source
pub unsafe fn scale_c_row(row: u32, alpha: f32, scratch: u8)
Expand description

Broadcast alpha into f[scratch], then scale the PS register pair for row.

Convenience wrapper: calls broadcast_ps(alpha, scratch) then fmul_ps_row(row, scratch). The broadcast is repeated on every call; when scaling multiple rows with the same alpha, call broadcast_ps once and fmul_ps_row for each row instead.

Pass PS_SCRATCH_DEFAULT (28) for scratch when the C tile has at most 14 rows. For full 16-row tiles, see the module-level doc for the spill/restore pattern.

ยงSafety

Call tensor_wait(TensorEvent::Fma) before this function; the tensor co-processor must have finished writing the FP register file.