Array Operations (vDSP / vForce)

AppleAccelerate wraps Apple's vecLib (vv*) and vDSP (vDSP_*) functions to provide accelerated element-wise operations on Array{Float32} and Array{Float64}.

These functions are not exported to avoid conflicts with Base. Access them via the AppleAccelerate. prefix.

Element-wise Math Functions

These functions wrap Apple's vecLib vv* routines.

One-argument functions

Each function f has an allocating variant f(X) and a mutating variant f!(out, X):

FunctionDescription
ceil, floor, trunc, roundRounding
sqrt, rsqrt, recSquare root, reciprocal square root, reciprocal
exp, exp2, expm1Exponentials
log, log1p, log2, log10Logarithms
sin, sinpi, cos, cospi, tan, tanpiTrigonometric
asin, acos, atanInverse trigonometric
sinh, cosh, tanh, asinh, acosh, atanhHyperbolic
abs, exponentMiscellaneous

Two-argument functions

FunctionDescription
copysign(X, Y)Copy sign of Y to X
rem(X, Y)Element-wise remainder
div_float(X, Y)Element-wise division (via vecLib)
atan(X, Y)Two-argument arctangent
pow(X, Y)Element-wise power

Special return types

FunctionDescription
sincos(X)Returns (sin(X), cos(X)) tuple
cis(X)Returns Complex array cos(X) + im*sin(X)
X = randn(Float64, 1000)

# Element-wise math — 3–19× faster than Base
Y_exp = AppleAccelerate.exp(X)
Y_sin = AppleAccelerate.sin(X)
Y_log = AppleAccelerate.log(X .+ 10)  # shift to positive domain

# Mutating variant (pre-allocate output)
out = similar(X)
AppleAccelerate.exp!(out, X)

# Broadcasting works automatically
Y_broadcast = AppleAccelerate.sin.(X)
AppleAccelerate.sincosFunction
sincos(X::Array{T}) where T <: Union{Float32, Float64}

Compute the sine and cosine of each element simultaneously via vecLib vvsincos. Returns a tuple (sin(X), cos(X)) of arrays. Faster than computing sin and cos separately since both are produced in a single pass.

The mutating variant sincos!(out_sin, out_cos, X) stores results in preallocated arrays.

source
AppleAccelerate.cisFunction
cis(X::Array{T}) where T <: Union{Float32, Float64}

Compute cos(x) + im*sin(x) for each element via vecLib vvcosisin. Returns a Complex{T} array. Equivalent to exp.(im .* X) but faster.

The mutating variant cis!(out, X) stores results in a preallocated complex array.

source

Unary vDSP Operations

Wraps vDSP unary vector operations.

FunctionDescription
vnegNegate each element: result[i] = -X[i]
vnabsNegative absolute value: `result[i] = -
vabsAbsolute value: result[i] = |X[i]|
vsqSquare each element: result[i] = X[i]^2
vssqSigned square: result[i] = X[i] * |X[i]|
vfracFractional part: result[i] = X[i] - trunc(X[i])
vreverse!Reverse vector in-place
vreverseReturn a reversed copy

Vector Reductions

Wraps vDSP reduction functions.

FunctionDescriptionApple function
maximum(X), minimum(X)Max/min valuevDSP_maxv, vDSP_minv
findmax(X), findmin(X)Max/min value and indexvDSP_maxvi, vDSP_minvi
sum(X), mean(X)Sum and meanvDSP_sve, vDSP_meanv
meanmag(X)Mean of absolute valuesvDSP_meamgv
meansqr(X)Mean of squaresvDSP_measqv
meanssqr(X)Mean of signed squaresvDSP_mvessq
summag(X)Sum of absolute valuesvDSP_svemg
sumsqr(X)Sum of squaresvDSP_svesq
sumssqr(X)Sum of signed squaresvDSP_svs
dotDot product: sum(X .* Y)vDSP_dotpr
dotpr2Dual dot product: one B dotted against two A0/A1vDSP_dotpr2
distancesqSquared Euclidean distance: sum((X .- Y).^2)vDSP_distancesq
rmsqvRoot mean square: sqrt(sum(X.^2)/N)
sve_svesqSimultaneous sum and sum-of-squares
maxmgvMaximum magnitude: max(|X|)
minmgvMinimum magnitude: min(|X|)
maxmgviMaximum magnitude with index
minmgviMinimum magnitude with index
X = randn(Float64, 10_000)

# Reductions
s = AppleAccelerate.sum(X)
mx = AppleAccelerate.maximum(X)
val, idx = AppleAccelerate.findmax(X)
avg = AppleAccelerate.mean(X)
AppleAccelerate.maximumFunction
maximum(X::StridedVector{T}) where T <: Union{Float32, Float64}

Return the maximum value in X via vDSP. Equivalent to Base.maximum(X). Wraps vDSP_maxv.

source
AppleAccelerate.minimumFunction
minimum(X::StridedVector{T}) where T <: Union{Float32, Float64}

Return the minimum value in X via vDSP. Equivalent to Base.minimum(X). Wraps vDSP_minv.

source
AppleAccelerate.sumFunction
sum(X::StridedVector{T}) where T <: Union{Float32, Float64}

Return the sum of elements in X via vDSP. Equivalent to Base.sum(X). Wraps vDSP_sve.

source
AppleAccelerate.findmaxFunction
findmax(X::StridedVector{T}) where T <: Union{Float32, Float64}

Return (value, index) of the maximum element in X via vDSP. Equivalent to Base.findmax(X). Wraps vDSP_maxvi.

source
AppleAccelerate.findminFunction
findmin(X::StridedVector{T}) where T <: Union{Float32, Float64}

Return (value, index) of the minimum element in X via vDSP. Equivalent to Base.findmin(X). Wraps vDSP_minvi.

source

Vector-Vector Arithmetic

FunctionDescriptionApple function
vadd / vadd!Element-wise additionvDSP_vadd
vsub / vsub!Element-wise subtractionvDSP_vsub
vmul / vmul!Element-wise multiplicationvDSP_vmul
vdiv / vdiv!Element-wise divisionvDSP_vdiv
A = randn(Float64, 1000)
B = randn(Float64, 1000)

# Vector arithmetic
C = AppleAccelerate.vadd(A, B)   # A .+ B
D = AppleAccelerate.vmul(A, B)   # A .* B

# Compound operation: A * scalar + B
E = AppleAccelerate.vsma(A, 2.5, B)  # A .* 2.5 .+ B
AppleAccelerate.vaddFunction

vadd(X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise addition over two Vector{Float32}. Allocates memory to store result. Returns: Vector{Float32}

source

vadd(X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise addition over two Vector{Float64}. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.vadd!Function

vadd!(result::StridedVector{Float32}, X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise addition over two Vector{Float32} and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vadd!(result::StridedVector{Float64}, X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise addition over two Vector{Float64} and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vsubFunction

vsub(X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise subtraction over two Vector{Float32}. Allocates memory to store result. Returns: Vector{Float32}

source

vsub(X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise subtraction over two Vector{Float64}. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.vsub!Function

vsub!(result::StridedVector{Float32}, X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise subtraction over two Vector{Float32} and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vsub!(result::StridedVector{Float64}, X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise subtraction over two Vector{Float64} and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vmulFunction

vmul(X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise multiplication over two Vector{Float32}. Allocates memory to store result. Returns: Vector{Float32}

source

vmul(X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise multiplication over two Vector{Float64}. Allocates memory to store result. Returns: Vector{Float64}

source
vmul(X::Vector{Complex{Float32}}, Y::Vector{Complex{Float32}}) -> Vector{Complex{Float32}}
vmul!(result, X, Y)

Element-wise complex multiplication: result[i] = X[i] * Y[i]. Wraps vDSP_zvmul.

source
vmul(X::Vector{Complex{Float64}}, Y::Vector{Complex{Float64}}) -> Vector{Complex{Float64}}
vmul!(result, X, Y)

Element-wise complex multiplication: result[i] = X[i] * Y[i]. Wraps vDSP_zvmul.

source
AppleAccelerate.vmul!Function

vmul!(result::StridedVector{Float32}, X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise multiplication over two Vector{Float32} and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vmul!(result::StridedVector{Float64}, X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise multiplication over two Vector{Float64} and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vdivFunction

vdiv(X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise division over two Vector{Float32}. Allocates memory to store result. Returns: Vector{Float32}

source

vdiv(X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise division over two Vector{Float64}. Allocates memory to store result. Returns: Vector{Float64}

source
vdiv(X::Vector{Complex{Float32}}, Y::Vector{Complex{Float32}}) -> Vector{Complex{Float32}}
vdiv!(result, X, Y)

Element-wise complex division: result[i] = X[i] / Y[i]. Wraps vDSP_zvdiv.

source
vdiv(X::Vector{Complex{Float64}}, Y::Vector{Complex{Float64}}) -> Vector{Complex{Float64}}
vdiv!(result, X, Y)

Element-wise complex division: result[i] = X[i] / Y[i]. Wraps vDSP_zvdiv.

source
AppleAccelerate.vdiv!Function

vdiv!(result::StridedVector{Float32}, X::StridedVector{Float32}, Y::StridedVector{Float32})

Implements element-wise division over two Vector{Float32} and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vdiv!(result::StridedVector{Float64}, X::StridedVector{Float64}, Y::StridedVector{Float64})

Implements element-wise division over two Vector{Float64} and overwrites the result vector with computed value. Returns: Vector{Float64} result

source

Two-Vector Comparison & Distance

FunctionDescription
vmaxElement-wise maximum
vminElement-wise minimum
vmaxmgElement-wise maximum magnitude
vminmgElement-wise minimum magnitude
vdistElement-wise Euclidean distance
vtmergTapered merge of two vectors

Vector-Scalar Operations

FunctionDescriptionApple function
vsadd / vsadd!Vector + scalarvDSP_vsadd
vssub / vssub!Vector - scalarvDSP_vsadd
svsub / svsub!Scalar - vectorvDSP_vsadd
vsmul / vsmul!Vector * scalarvDSP_vsmul
vsdiv / vsdiv!Vector / scalarvDSP_vsdiv
svdivScalar / vectorvDSP_svdiv
AppleAccelerate.vsaddFunction

vsadd(X::StridedVector{Float32}, c::Float32)

Implements vector-scalar addition over Vector{Float32} and Float32. Allocates memory to store result. Returns: Vector{Float32}

source

vsadd(X::StridedVector{Float64}, c::Float64)

Implements vector-scalar addition over Vector{Float64} and Float64. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.vsadd!Function

vsadd!(result::StridedVector{Float32}, X::StridedVector{Float32}, c::Float32)

Implements vector-scalar addition over Vector{Float32} and Float32 and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vsadd!(result::StridedVector{Float64}, X::StridedVector{Float64}, c::Float64)

Implements vector-scalar addition over Vector{Float64} and Float64 and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vssubFunction

vssub(X::StridedVector{Float32}, c::Float32)

Implements vector-scalar subtraction over Vector{Float32} and Float32. Allocates memory to store result. Returns: Vector{Float32}

source

vssub(X::StridedVector{Float64}, c::Float64)

Implements vector-scalar subtraction over Vector{Float64} and Float64. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.vssub!Function

vssub!(result::StridedVector{Float32}, X::StridedVector{Float32}, c::Float32)

Implements vector-scalar subtraction over Vector{Float32} and Float32 and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vssub!(result::StridedVector{Float64}, X::StridedVector{Float64}, c::Float64)

Implements vector-scalar subtraction over Vector{Float64} and Float64 and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.svsubFunction

svsub(X::StridedVector{Float32, c::Float32})

Implements vector-scalar subtraction over Float32 and Vector{Float32}. Allocates memory to store result. Returns: Vector{Float32}

source

svsub(X::StridedVector{Float64, c::Float64})

Implements vector-scalar subtraction over Float64 and Vector{Float64}. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.svsub!Function

svsub!(result::StridedVector{Float32}, X::StridedVector{Float32}, c::Float32)

Implements vector-scalar subtraction over Float32 and Vector{Float32} and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

svsub!(result::StridedVector{Float64}, X::StridedVector{Float64}, c::Float64)

Implements vector-scalar subtraction over Float64 and Vector{Float64} and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vsmulFunction

vsmul(X::StridedVector{Float32}, c::Float32)

Implements vector-scalar multiplication over Vector{Float32} and Float32. Allocates memory to store result. Returns: Vector{Float32}

source

vsmul(X::StridedVector{Float64}, c::Float64)

Implements vector-scalar multiplication over Vector{Float64} and Float64. Allocates memory to store result. Returns: Vector{Float64}

source
vsmul(X::Vector{Complex{Float32}}, c::Complex{Float32}) -> Vector{Complex{Float32}}
vsmul!(result, X, c)

Complex vector-scalar multiplication: result[i] = X[i] * c. Wraps vDSP_zvzsml.

source
vsmul(X::Vector{Complex{Float64}}, c::Complex{Float64}) -> Vector{Complex{Float64}}
vsmul!(result, X, c)

Complex vector-scalar multiplication: result[i] = X[i] * c. Wraps vDSP_zvzsml.

source
AppleAccelerate.vsmul!Function

vsmul!(result::StridedVector{Float32}, X::StridedVector{Float32}, c::Float32)

Implements vector-scalar multiplication over Vector{Float32} and Float32 and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vsmul!(result::StridedVector{Float64}, X::StridedVector{Float64}, c::Float64)

Implements vector-scalar multiplication over Vector{Float64} and Float64 and overwrites the result vector with computed value. Returns: Vector{Float64} result

source
AppleAccelerate.vsdivFunction

vsdiv(X::StridedVector{Float32}, c::Float32)

Implements vector-scalar division over Vector{Float32} and Float32. Allocates memory to store result. Returns: Vector{Float32}

source

vsdiv(X::StridedVector{Float64}, c::Float64)

Implements vector-scalar division over Vector{Float64} and Float64. Allocates memory to store result. Returns: Vector{Float64}

source
AppleAccelerate.vsdiv!Function

vsdiv!(result::StridedVector{Float32}, X::StridedVector{Float32}, c::Float32)

Implements vector-scalar division over Vector{Float32} and Float32 and overwrites the result vector with computed value. Returns: Vector{Float32} result

source

vsdiv!(result::StridedVector{Float64}, X::StridedVector{Float64}, c::Float64)

Implements vector-scalar division over Vector{Float64} and Float64 and overwrites the result vector with computed value. Returns: Vector{Float64} result

source

Compound Arithmetic

These operations fuse multiple arithmetic steps into a single vDSP call for better performance.

Three-vector operations

FunctionDescription
vam(A + B) * C
vsbm(A - B) * C
vmaA * B + C
vmsbA * B - C
venvlpSignal envelope

Four-vector operations

FunctionDescription
vaam(A + B) * (C + D)
vsbsbm(A - B) * (C - D)
vasbm(A + B) * (C - D)
vmmaA * B + C * D
vmmsbA * B - C * D
vpythgPythagorean distance

Vector-vector-scalar operations

FunctionDescription
vasm(A + B) * c
vsbsm(A - B) * c
vsmaA * b + C
vsmsaA * b + c
vmsaA * B + c
vsmsbA * b - C
vsmsmaA * b + C * d

Dual output

FunctionDescription
vaddsubSimultaneous add and subtract: returns (A .+ B, A .- B)

Clipping & Thresholding

FunctionDescription
vclipClip values to [low, high]
vclipcClip with count: returns (clipped, nlow, nhigh)
viclipInverted clip: pass values outside [low, high]
vthrThreshold: keep or clamp to threshold
vthresThreshold to zero
vlimTest limit: (b <= A[i]) ? c : -c
vthrscThreshold with signed constant
vcmprsCompress: gather elements where gate is nonzero

Type Conversion

FunctionDescription
vdoubleConvert Float32 to Float64
vsingleConvert Float64 to Float32

Ramp Generation

FunctionDescription
vrampGenerate a ramp: start + i * step
vrampmulMultiply vector by a generated ramp
vrampmul2Stereo ramp multiply (two outputs)
vrampmuladdRamp-multiply then accumulate into an existing vector
vrampmuladd2Stereo ramp-multiply then accumulate (two outputs)
AppleAccelerate.vrampmuladdFunction

Ramp-multiply then accumulate: result[i] = C[i] + X[i] * (start + i*step) for i = 0, ..., length(X)-1. The mutating vrampmuladd!(result, X, start, step) reads/writes result in place as the accumulator (i.e. result[i] += X[i] * ramp[i]). Wraps vDSP_vrampmuladd.

source

Linear Average

FunctionDescription
vavlinWeighted linear average of two vectors

Integration & Running Operations

FunctionDescription
vrsumRunning sum scaled by scale
vsimpsSimpson's rule integration
vtrapzTrapezoidal integration
vswsumSliding window sum
vswmaxSliding window maximum
AppleAccelerate.vswsumFunction

Sliding window sum with window size window. Returns a vector of length length(X) - window + 1. window must satisfy 1 ≤ window ≤ length(X); for vswsum!, result must have length ≥ length(X) - window + 1. Wraps vDSP_vswsum.

source
AppleAccelerate.vswmaxFunction

Sliding window maximum with window size window. Returns a vector of length length(X) - window + 1. window must satisfy 1 ≤ window ≤ length(X); for vswmax!, result must have length ≥ length(X) - window + 1. Wraps vDSP_vswmax.

source

Interpolation

FunctionDescription
vintbLinear interpolation: A + t * (B - A)
vlintLinear interpolation from lookup table
vqintQuadratic interpolation from lookup table

Polynomial Evaluation

FunctionDescription
vpolyEvaluate polynomial at each point

Normalization

FunctionDescription
vnormalizeNormalize to zero mean and unit standard deviation
AppleAccelerate.vnormalizeFunction
vnormalize(X) -> (normalized, mean, stddev)

Normalize vector to zero mean and unit standard deviation: (X .- mean) ./ stddev. Returns a tuple of (normalized_vector, mean, stddev). Wraps vDSP_normalize.

source

Zero Crossings

FunctionDescription
nzcrosFind zero crossings
AppleAccelerate.nzcrosFunction
nzcros(X, max_crossings=0) -> (indices, count)

Find zero crossings in X. Returns a tuple of (crossing_indices, count). If max_crossings <= 0, searches for up to length(X) crossings. Wraps vDSP_nzcros.

source

Decibel Conversion

FunctionDescription
vdbconConvert to decibels relative to a reference
AppleAccelerate.vdbconFunction
vdbcon(X, ref, power=true)

Convert to decibels relative to ref. If power=true, computes 10*log10(X/ref); if power=false, computes 20*log10(X/ref). Wraps vDSP_vdbcon.

source

Vector Fill, Swap & Sort

FunctionDescription
vclr!Fill vector with zeros
vfill!Fill vector with scalar value
vswap!Swap two vectors in-place
vsort!Sort vector in-place
vsortiReturn sort permutation (indices)

Gathering & Indexing

FunctionDescription
vgathrGather by index: C[i] = A[B[i]]
vgathraGather via an array of pointers: C[i] = A[i][1]
vindexIndex with float indices
vgenGenerate linear ramp between two values
vgenpPiecewise linear interpolation from breakpoints
vtabiTable lookup with interpolation
AppleAccelerate.vgathraFunction
vgathra(A::AbstractVector{<:StridedVector{T}}, ptrstride::Integer=1) -> Vector{T}

Gather the first element of each source vector in A into a contiguous result: C[i] = A[1 + (i-1)*ptrstride][1]. A is a caller-owned array of unit-stride vectors; internally an array of their pointers is built and passed to vDSP (GC.@preserved for the duration of the call). ptrstride selects every ptrstride-th pointer from that array (must be positive); the allocating form derives the output length from length(A) and ptrstride, while vgathra! derives the requested output count N from length(C) and requires A to hold at least (N-1)*ptrstride + 1 entries. Wraps vDSP_vgathra / vDSP_vgathraD.

source

Matrix Operations

FunctionDescription
mmulMatrix multiply: C = A * B
mtransMatrix transpose: C = Aᵀ
mmovMatrix copy (submatrix move)

Integer Operations (Int32)

FunctionDescription
vaddiInt32 vector addition
vabsiInt32 absolute value
vfilli!Fill Int32 vector with scalar
veqviInt32 bitwise XNOR
vdiviInt32 vector divide: C[i] = div(A[i], B[i])
vsaddiInt32 scalar add: C[i] = A[i] + b
vsdiviInt32 scalar divide: C[i] = div(A[i], b)

Fixed-Point (Q1.15 / Q8.24) Operations

vDSP fixed-point kernels operate directly on integer storage: an Int16 Q1.15 value v represents the real number v / 32768, and an Int32 Q8.24 value v represents v / 2^24. Results are computed and re-encoded at the same scale.

FunctionDescription
dotpr_s1_15 / dotpr_s8_24Fixed-point dot product
dotpr2_s1_15 / dotpr2_s8_24Fixed-point dual dot product
vrampmul_s1_15 / vrampmul_s8_24Fixed-point ramp multiply
vrampmul2_s1_15 / vrampmul2_s8_24Fixed-point stereo ramp multiply
vrampmuladd_s1_15 / vrampmuladd_s8_24Fixed-point ramp-multiply then accumulate
vrampmuladd2_s1_15 / vrampmuladd2_s8_24Fixed-point stereo ramp-multiply then accumulate
A = Int16[16384, -8192, 4096]   # 0.5, -0.25, 0.125 in Q1.15
B = Int16[8192, 16384, -16384]  # 0.25, 0.5, -0.5 in Q1.15
c = AppleAccelerate.dotpr_s1_15(A, B)  # fixed-point dot product, Q1.15-encoded
AppleAccelerate.dotpr_s1_15Function

Fixed-point (s115) dot product: sum(A .* B) computed and stored in Q-format. Wraps [`vDSPdotprs115`](https://developer.apple.com/documentation/accelerate/vdspdotprs1_15).

source
AppleAccelerate.dotpr_s8_24Function

Fixed-point (s824) dot product: sum(A .* B) computed and stored in Q-format. Wraps [`vDSPdotprs824`](https://developer.apple.com/documentation/accelerate/vdspdotprs8_24).

source
AppleAccelerate.dotpr2_s1_15Function

Fixed-point (s115) dual dot product: B dotted against both A0 and A1. Wraps [`vDSPdotpr2s115`](https://developer.apple.com/documentation/accelerate/vdspdotpr2s1_15).

source
AppleAccelerate.dotpr2_s8_24Function

Fixed-point (s824) dual dot product: B dotted against both A0 and A1. Wraps [`vDSPdotpr2s824`](https://developer.apple.com/documentation/accelerate/vdspdotpr2s8_24).

source
AppleAccelerate.vrampmul_s1_15Function

Fixed-point (s115) ramp multiply. Wraps [`vDSPvrampmuls115`](https://developer.apple.com/documentation/accelerate/vdspvrampmuls1_15).

source
AppleAccelerate.vrampmul_s8_24Function

Fixed-point (s824) ramp multiply. Wraps [`vDSPvrampmuls824`](https://developer.apple.com/documentation/accelerate/vdspvrampmuls8_24).

source
AppleAccelerate.vrampmul2_s1_15Function

Fixed-point (s115) stereo ramp multiply. Wraps [`vDSPvrampmul2s115`](https://developer.apple.com/documentation/accelerate/vdspvrampmul2s1_15).

source
AppleAccelerate.vrampmul2_s8_24Function

Fixed-point (s824) stereo ramp multiply. Wraps [`vDSPvrampmul2s824`](https://developer.apple.com/documentation/accelerate/vdspvrampmul2s8_24).

source
AppleAccelerate.vrampmuladd_s1_15Function

Fixed-point (s115) ramp-multiply then accumulate. Wraps [`vDSPvrampmuladds115`](https://developer.apple.com/documentation/accelerate/vdspvrampmuladds1_15).

source
AppleAccelerate.vrampmuladd_s8_24Function

Fixed-point (s824) ramp-multiply then accumulate. Wraps [`vDSPvrampmuladds824`](https://developer.apple.com/documentation/accelerate/vdspvrampmuladds8_24).

source
AppleAccelerate.vrampmuladd2_s1_15Function

Fixed-point (s115) stereo ramp-multiply then accumulate. Wraps [`vDSPvrampmuladd2s115`](https://developer.apple.com/documentation/accelerate/vdspvrampmuladd2s1_15).

source
AppleAccelerate.vrampmuladd2_s8_24Function

Fixed-point (s824) stereo ramp-multiply then accumulate. Wraps [`vDSPvrampmuladd2s824`](https://developer.apple.com/documentation/accelerate/vdspvrampmuladd2s8_24).

source

24-bit Packed Integer Conversion

vDSP represents packed 24-bit integers with a 3-byte, unaligned in-memory layout. These wrappers surface that as ordinary Int32/UInt32 Julia vectors holding values in the 24-bit range (-8388608:8388607 signed, 0:16777215 unsigned), packing/unpacking around each call.

FunctionDescription
vflt24Packed 24-bit signed int → Float32
vfltu24Packed 24-bit unsigned int → Float32
vfltsm24Packed 24-bit signed int → Float32, scaled by b
vfltsmu24Packed 24-bit unsigned int → Float32, scaled by b
vsmfix24Float32 scaled by b, truncated to packed 24-bit signed int
vsmfixu24Float32 scaled by b, truncated to packed 24-bit unsigned int

Zero-copy packed interop

When the data is already in Apple's packed 3-byte layout (e.g. 24-bit audio off disk or the wire), skip the per-call pack/unpack: the element types PackedInt24 / PackedUInt24 can be handed straight to the conversions. Build a packed vector with pack24 / packu24 (or reinterpret(PackedInt24, bytes) over a raw Vector{UInt8}), pass it to the vflt*24 functions (or write into it from vsmfix*24!), and decode with unpack24.

AppleAccelerate.unpack24Function
unpack24(A::AbstractVector{PackedInt24})  -> Vector{Int32}
unpack24(A::AbstractVector{PackedUInt24}) -> Vector{UInt32}

Decode packed 24-bit integers back to Int32 / UInt32 values. Inverse of pack24 / packu24.

source

Type Conversion (int ↔ float)

DirectionFunctionsDescription
float → signed int (truncate)vfix8, vfix16, vfix32Truncating conversion
float → unsigned int (truncate)vfixu8, vfixu16, vfixu32Truncating conversion
float → signed int (round)vfixr8, vfixr16, vfixr32Rounding conversion
float → unsigned int (round)vfixru8, vfixru16, vfixru32Rounding conversion
signed int → floatvflt8, vflt16, vflt32Signed integer to float
unsigned int → floatvfltu8, vfltu16, vfltu32Unsigned integer to float

Every function in this family has an allocating variant and a mutating variant f!(C, A) that writes into a preallocated C. The number in the name is the integer bit width (8, 16, 32), so vfix32 truncates to Int32, vfltu16 converts UInt16 to float, and so on. Both Float32 and Float64 are supported.

For the mutating f!(C, A) forms, C must satisfy length(C) ≥ length(A); otherwise a DimensionMismatch is thrown before any elements are written.

The two directions differ in how the output type is chosen. For float → int the integer type is fixed by the function name, so the allocating form is f(A). For int → float the float width is ambiguous, so the allocating form takes it explicitly as f(A, Float64) (or Float32).

X = Float64[-1.7, 0.4, 2.9]

I32 = AppleAccelerate.vfix32(X)            # truncate toward zero → Int32[-1, 0, 2]
R32 = AppleAccelerate.vfixr32(X)           # round to nearest    → Int32[-2, 0, 3]
Xf  = AppleAccelerate.vflt32(I32, Float64) # back to Float64 (target type required)

# Mutating variant writes into a preallocated output
out = Vector{Int32}(undef, length(X))
AppleAccelerate.vfix32!(out, X)

Image Convolution

FunctionDescription
f3x32D convolution with 3×3 filter
f5x52D convolution with 5×5 filter
imgfirGeneral 2D image convolution

Broadcasting

AppleAccelerate overrides Base.copy and Base.copyto! for Broadcasted objects, so that broadcasting syntax like f.(X) automatically uses the accelerated implementation.