Dense Linear Algebra
AppleAccelerate forwards BLAS and LAPACK calls to Apple's Accelerate framework via Julia's libblastrampoline (LBT) mechanism. This happens automatically when the package is loaded.
How it works
On __init__, AppleAccelerate loads both LP64 and ILP64 BLAS/LAPACK interfaces from Accelerate. OpenBLAS remains as a fallback for operations not provided by Accelerate (e.g., gemmt).
Since Accelerate provides a full BLAS and LAPACK implementation, all standard Julia LinearAlgebra operations are accelerated transparently. This includes:
Factorizations: lu, qr, cholesky, svd, eigen, schur, ldlt, hessenberg, and their in-place ! variants
Solvers: \, ldiv!, rdiv!
Matrix operations: mul!, *, det, tr, inv, pinv, rank, norm, cond, opnorm
BLAS routines: All Level 1 (vector), Level 2 (matrix-vector), and Level 3 (matrix-matrix) operations via LinearAlgebra.BLAS
For the complete list of available operations, see the Julia LinearAlgebra documentation.
Loading
using AppleAccelerate| Function | Description |
|---|---|
load_accelerate | Load Accelerate BLAS/LAPACK via LBT |
Threading
On macOS 26+, you can control BLAS threading:
| Function | Description |
|---|---|
set_num_threads | Set the number of Accelerate BLAS threads |
get_num_threads | Get the number of Accelerate BLAS threads |
Utilities
| Function | Description |
|---|---|
get_macos_version | Return the current macOS version |
AppleAccelerate.load_accelerate — Function
load_accelerate(; clear = false, verbose = false, load_ilp64 = true)Load Accelerate, replacing the current LBT forwarding tables if clear is true. clear is false by default to allow for OpenBLAS to act as a fallback for operations missing from Accelerate, such as gemmt. Attempts to load the ILP64 symbols if load_ilp64 is true, and errors out if unable.
AppleAccelerate.set_num_threads — Function
set_num_threads(n::Integer) -> BlasIntSet the number of threads used by Accelerate BLAS. If n == 1, use single-threaded mode; if n > 1, use multi-threaded mode. Returns the resulting thread count (from get_num_threads). On macOS < 15 where the threading API is unavailable, warns and returns 1.
AppleAccelerate.get_num_threads — Function
get_num_threads() -> BlasIntReturn the number of threads used by Accelerate BLAS. Returns 1 for single-threaded mode, or the actual thread count for multi-threaded mode. On macOS < 15 where the threading API is unavailable, warns and returns 1.
AppleAccelerate.get_macos_version — Function
get_macos_version()Return the current macOS version as a VersionNumber. Returns nothing on non-Apple platforms or if the version cannot be determined.
AppleAccelerate._read_macos_version — Function
_read_macos_version()Read the macOS version from the system plist and return it as a VersionNumber. Early macOS Tahoe betas reported version 16.x before Apple finalized the version numbering as 26.x; this function normalizes 16.x → 26.x for correct comparisons. Returns nothing on non-Apple platforms or if the version cannot be determined.