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

gemv_kernel_vector

def gemv_kernel_vector[c_type: DType, a_type: DType, b_type: DType, c_layout: TensorLayout, a_layout: TensorLayout, b_layout: TensorLayout, c_storage: TensorStorage, a_storage: TensorStorage, b_storage: TensorStorage, *, simd_width: Int, transpose_b: Bool = False, 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](), check_bounds: Bool = True, pdl_level: PDLLevel = PDLLevel()](c: TileTensor[c_type, c_layout, MutAnyOrigin, Storage=c_storage], a: TileTensor[a_type, a_layout, ImmutAnyOrigin, Storage=a_storage], b: TileTensor[b_type, b_layout, ImmutAnyOrigin, Storage=b_storage], m: Int, n: Int, k: Int)

GPU kernel for matrix-vector multiplication using vectorized warp-level loads.

Each warp processes one output row. Threads collaborate to load simd_width-wide vectors from A and B, accumulate dot products locally, then reduce across the warp.

Parameters:

Args:

Was this page helpful?