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

apple_gemv

def apple_gemv[*, b_packed: Bool, 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](c: TileTensor[Storage=c.Storage, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, linear_idx_type=b.linear_idx_type], ctx: Optional[DeviceContext] = None)

Performs a parallelized and vectorized GEMV for the M=1 case on Apple CPUs.

Used as an alternative to apple_matmul when M=1 and the Apple Accelerate cblas_sgemm path exhibits suboptimal performance for single-row inputs. Iterates over columns of B using SIMD FMA and optional parallelism.

Parameters:

Args:

Was this page helpful?