Skip to main content

compact_rows

Function compact_rows 

Source
pub fn compact_rows(input: &Matrix, mask: &Matrix) -> Result<CompactRowsResult>
Expand description

Compact the selected rows of input on device without host readback.

input is [T, D] FP32 and mask is [T] FP32; one workgroup runs the donor chunked prefix scan so row_map, count, and dispatch_args stay device-resident, matching OA C++ FnMatrix::compactRows. values keeps fixed [T, D] capacity with unselected slots zeroed.

ยงErrors

Returns an error when input is not rank-two FP32, mask is not FP32 with T elements, an extent exceeds the shader ABI, allocation fails, or runtime recording fails.