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 module
apple_accelerate
Wraps the Apple Accelerate cblas_sgemm routine to provide single-precision matmul, GEMV, and batched matmul kernels for Apple CPUs.
comptime valuesβ
APPLE_ACCELERATEβ
comptime APPLE_ACCELERATE = _Global[StringSlice("APPLE_ACCELERATE"), _init_dylib, _on_error_msg]
Process-global lazily loaded handle to the Accelerate dynamic library.
cblas_gemm_typeβ
comptime cblas_gemm_type = def(_CBLASOrder, _CBLASTranspose, _CBLASTranspose, Int32, Int32, Int32, Float32, Pointer[Float32, ImmutAnyOrigin, _safe=False], Int32, Pointer[Float32, ImmutAnyOrigin, _safe=False], Int32, Float32, Pointer[Float32, MutAnyOrigin, _safe=False], Int32) thin -> None
Function type matching the Accelerate cblas_sgemm C signature.
LIB_ACC_PATHβ
comptime LIB_ACC_PATH = "/System/Library/Frameworks/Accelerate.framework/Accelerate"
Filesystem path to the Apple Accelerate framework dynamic library.
Functionsβ
- β
apple_batched_matmul: Performs a batched single-precision matmul via the Apple Accelerate library. - β
apple_gemv: Performs a parallelized and vectorized GEMV for the M=1 case on Apple CPUs. - β
apple_matmul: Performs a single-precision matmul via a pre-loadedcblas_sgemmfunction pointer. - β
get_cblas_f32_function: Loads and returns thecblas_sgemmfunction pointer from the Apple Accelerate library. - β
use_apple_accelerate_lib: Returns whether the Apple Accelerate CBLAS library should be used for this dtype combination.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!