Skip to content

Commit 6413b06

Browse files
version gate AppleAccelerate
1 parent 730f59c commit 6413b06

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/appleaccelerate.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ end
120120
default_alias_A(::AppleAccelerateLUFactorization, ::Any, ::Any) = false
121121
default_alias_b(::AppleAccelerateLUFactorization, ::Any, ::Any) = false
122122

123-
const PREALLOCATED_APPLE_LU = begin
123+
const PREALLOCATED_APPLE_LU = @static if VERSION >= v"1.8"
124124
A = rand(0, 0)
125125
luinst = ArrayInterface.lu_instance(A)
126126
LU(luinst.factors, similar(A, Cint, 0), luinst.info), Ref{Cint}()
127+
else
128+
nothing
127129
end
128130

129131
function LinearSolve.init_cacheval(alg::AppleAccelerateLUFactorization, A, b, u, Pl, Pr,

src/default.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function defaultalg(A, b, assump::OperatorAssumptions)
160160
__conditioning(assump) === OperatorCondition.WellConditioned)
161161
if length(b) <= 10
162162
DefaultAlgorithmChoice.GenericLUFactorization
163-
elseif appleaccelerate_isavailable()
163+
elseif VERSION >= v"1.8" && appleaccelerate_isavailable()
164164
DefaultAlgorithmChoice.AppleAccelerateLUFactorization
165165
elseif (length(b) <= 100 || (isopenblas() && length(b) <= 500)) &&
166166
(A === nothing ? eltype(b) <: Union{Float32, Float64} :

0 commit comments

Comments
 (0)