For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
zero_output
def zero_output[c_type: DType, *, output_tile_shape: IndexList[Int(2)], c_stride: Int, c_N: Int](c_ptr: Pointer[Scalar[c_type], MutAnyOrigin, _safe=False], coord: Tuple[UInt32, UInt32], group_end_idx: UInt32)
Zero-fills an output tile for skipped or invalid expert assignments.
Each thread stores a SIMD vector of zeros per row across the output tile width, masking out threads and rows that fall outside the valid tile or group boundary.
Parameters:
- βc_type (
DType): Element type of the C output tensor. - βoutput_tile_shape (
IndexList[Int(2)]): Tile shape[rows, cols]of the output region to zero-fill, where index 0 bounds the row count and index 1 bounds the column count. - βc_stride (
Int): Row stride of the C output tensor in elements; the store pointer advances by this amount per row. - βc_N (
Int): Total width of the C output tensor in elements; bounds the column offsetcoord[0]to mask out-of-bound stores.
Args:
- βc_ptr (
Pointer[Scalar[c_type], MutAnyOrigin, _safe=False]): Base pointer to the C output tensor in global memory. - βcoord (
Tuple[UInt32, UInt32]):(m, n)element coordinates of the output tile origin, wherecoord[0]is the column offset andcoord[1]is the row offset. - βgroup_end_idx (
UInt32): Exclusive end of the current group's valid row range; bounds the number of rows zeroed.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!