strided_out_extent_elems

Function strided_out_extent_elems 

Source
pub fn strided_out_extent_elems(m_pad: u32, ldc: u32, n: u32) -> usize
Expand description

Last element written by a cuBLASLt GEMM whose output rows are ldc elements apart — SSOT for every strided call site’s bounds check.

The D operand is a column-major [N, M] with leading dimension ldc, i.e. a row-major [M, N] at row pitch ldc. The library writes n elements of each of the m_pad columns, so the extent is (m_pad - 1) * ldc + n ELEMENTS — NOT m_pad * ldc, which would count a gap the GEMM never touches, and NOT m_pad * n, which would ignore the pitch entirely.

m_pad, not m: cublas_fp8_proj_prequant hands cuBLASLt ceil16(M) and the phantom rows ARE written. With a contiguous output they land past the live rows in the same buffer; with a STRIDED one they land in decode slots m..m_pad, which belong to sequences that are not in this step. That is in-bounds and harmless — those slots are re-projected before anything reads them — but only while the buffer actually HAS m_pad slots, which is exactly what this extent is used to check.