IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

gevm_kernel

def gevm_kernel[c_type: DType, a_type: DType, b_type: DType, *, tile_size: Int, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None] = None, accum_type: DType = get_accum_type[c_type](), pdl_level: PDLLevel = PDLLevel()](c: Pointer[Scalar[c_type], MutUnsafeAnyOrigin, _safe=False], a: Pointer[Scalar[a_type], ImmUnsafeAnyOrigin, _safe=False], b: Pointer[Scalar[b_type], ImmUnsafeAnyOrigin, _safe=False], m: Int, n: Int, k: Int)

GPU kernel for row-vector times matrix multiplication (GEVM).

Each CTA block computes tile_size // WARP_SIZE consecutive output elements. Threads in each warp collaboratively accumulate the dot product of the input row vector with columns of the matrix, then reduce through shared memory.

Parameters:

Args:

  • ​c (Pointer[Scalar[c_type], MutUnsafeAnyOrigin, _safe=False]): Output pointer of length n.
  • ​a (Pointer[Scalar[a_type], ImmUnsafeAnyOrigin, _safe=False]): Input row vector pointer of length k.
  • ​b (Pointer[Scalar[b_type], ImmUnsafeAnyOrigin, _safe=False]): Input matrix pointer of shape (k, n).
  • ​m (Int): Unused; retained for interface consistency.
  • ​n (Int): Number of output columns.
  • ​k (Int): Shared reduction dimension.