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_gpu
def gemv_gpu[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, pdl_level: PDLLevel = PDLLevel.ON](c: TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, address_space=b.address_space, linear_idx_type=b.linear_idx_type], ctx: DeviceContext)
Selects and dispatches the appropriate GPU GEMV kernel based on shape and hardware.
Examines runtime dimensions M, N, K and static shape information to choose among GEMV_KERNEL, GEMV_KERNEL_VECTOR, GEMV_SPLIT_K, GEVM_KERNEL, and MATMUL_NAIVE variants.
Parameters:
- βtranspose_b (
Bool): When True, B is treated as transposed (N, K) row-major. - β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 element-wise to each output. - βpdl_level (
PDLLevel): Programmatic dependent launch level for PDL barriers.
Args:
- βc (
TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type]): Rank-2 output TileTensor. - βa (
TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type]): Rank-2 input matrix TileTensor. - βb (
TileTensor[Storage=b.Storage, address_space=b.address_space, linear_idx_type=b.linear_idx_type]): Rank-2 input vector or matrix TileTensor. - βctx (
DeviceContext): Device context for kernel launch.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!