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:
- βc_type (
DType): Output element type. - βa_type (
DType): Input vector (row) element type. - βb_type (
DType): Input matrix element type. - βtile_size (
Int): Total threads per block; must be a multiple of WARP_SIZE. - βelementwise_lambda_fn (
Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None]): Optional epilogue applied to each output element. - βaccum_type (
DType): Accumulation precision type. - βpdl_level (
PDLLevel): Programmatic dependent launch level.
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.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!