Introduction
A Julia interface to Apple's Accelerate framework, providing high-performance BLAS/LAPACK, vectorized math operations, DSP/FFT, and sparse linear algebra on macOS.
Installation
Requires macOS 13.4+ and Julia 1.10+.
using Pkg
Pkg.add("AppleAccelerate")Feature Overview
| Feature | Backend | Details |
|---|---|---|
| Dense Linear Algebra | BLAS / LAPACK | Automatic forwarding via LBT — lu, qr, svd, mul!, etc. |
| Array Operations | vDSP / vecLib | Element-wise math (exp, sin, log), reductions, vector arithmetic |
| FFT & Transforms | vDSP FFT | Complex FFT (1D f*2^k with f ∈ {1,3,5,15}, 2D power-of-2), real FFT (power-of-2), DFT, DCT — direct vDSP bindings under the AppleAccelerate. namespace |
| Filtering & Spectral | vDSP | Convolution, biquad IIR, spectral analysis, window functions |
| Sparse Linear Algebra | Sparse Solvers | SpMV, direct solvers (QR, Cholesky, LDLT), factorization reuse (refactor!) |
| Neural Network Primitives | BNNS | Float32 matmul and activations — see BNNS |
| Numerical Integration | Quadrature | Adaptive QUADPACK integration — see Numerical Integration |
AppleAccelerate is built as two layers: an auto-generated raw ABI mirror of Accelerate's C API (AppleAccelerate.LibAccelerate) and a hand-written idiomatic API on top of it. AppleAccelerate ships no package extensions and defines no methods on other packages' functions — loading it never changes what code elsewhere in your session does. See Architecture.
Most functions are not exported to avoid conflicts with Base and LinearAlgebra. Access them via the AppleAccelerate. prefix (e.g., AppleAccelerate.exp(X)). The exception is dense linear algebra, which is activated automatically via LBT on package load.
- macOS only — this package uses Apple's Accelerate framework, which is not available on Linux or Windows.
- FFT size limits — 1D complex
fft/ifft/bfftsupport lengthsf * 2^kwithf ∈ {1, 3, 5, 15}; 2D transforms and the real FFT (rfft/brfft) are power-of-2 only. DFT also supportsf * 2^nwheref ∈ {1, 3, 5, 15}. Use FFTW.jl for other sizes or N-D transforms. - Float32/Float64 only — no support for integer or extended-precision types.
Quick Start
Array Operations
AppleAccelerate provides accelerated element-wise math operations via Apple's vecLib:
using AppleAccelerate
X = randn(Float64, 10_000)
# Accelerated math functions (not exported to avoid conflicts)
Y = AppleAccelerate.exp(X)
Y = AppleAccelerate.sin(X)
Y = AppleAccelerate.log(X)
# Broadcasting works automatically
Y = AppleAccelerate.sin.(X)Dense Linear Algebra
AppleAccelerate automatically forwards BLAS and LAPACK calls to Apple's Accelerate framework on package load:
using AppleAccelerate
using LinearAlgebra
# All BLAS/LAPACK operations now use Accelerate
A = randn(1000, 1000)
F = lu(A) # Uses Accelerate LAPACKSparse Linear Algebra
using AppleAccelerate, SparseArrays, LinearAlgebra
A = sprandn(100, 100, 0.1)
A = A + A' + 20I # Make symmetric positive definite
b = randn(100)
import AppleAccelerate: AAFactorization, solve
f = AAFactorization(A)
x = solve(f, b)Signal Processing
using AppleAccelerate
x = randn(ComplexF64, 1024)
X = AppleAccelerate.fft(x)
x_recovered = AppleAccelerate.ifft(X)Neural Network Primitives
BNNS-backed Float32 matrix multiply and activations (see Neural Network Primitives (BNNS)):
using AppleAccelerate
A = rand(Float32, 4, 3); B = rand(Float32, 3, 5)
C = AppleAccelerate.bnns_matmul(A, B)
y = AppleAccelerate.bnns_activation(:relu, Float32[-1, 0, 1])Integration
Adaptive QUADPACK integration (see Numerical Integration):
using AppleAccelerate
AppleAccelerate.integrate(x -> exp(-x^2), -Inf, Inf).value # ≈ √π1.7724538509055159