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
FunctionDescription
load_accelerateLoad Accelerate BLAS/LAPACK via LBT

Threading

On macOS 26+, you can control BLAS threading:

FunctionDescription
set_num_threadsSet the number of Accelerate BLAS threads
get_num_threadsGet the number of Accelerate BLAS threads

Utilities

FunctionDescription
get_macos_versionReturn the current macOS version
AppleAccelerate.load_accelerateFunction
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.

source
AppleAccelerate.set_num_threadsFunction
set_num_threads(n::Integer) -> BlasInt

Set 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.

source
AppleAccelerate.get_num_threadsFunction
get_num_threads() -> BlasInt

Return 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.

source
AppleAccelerate.get_macos_versionFunction
get_macos_version()

Return the current macOS version as a VersionNumber. Returns nothing on non-Apple platforms or if the version cannot be determined.

source
AppleAccelerate._read_macos_versionFunction
_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.

source