Skip to content

Commit

Permalink
Merge pull request #555 from SciML/default_blas
Browse files Browse the repository at this point in the history
Guard BLAS defaults more, allowing only Array and BLASFloats
  • Loading branch information
ChrisRackauckas authored Oct 31, 2024
2 parents afc7a12 + 3c4a07b commit 46726d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ function defaultalg(A, b, assump::OperatorAssumptions{Bool})
__conditioning(assump) === OperatorCondition.WellConditioned)
if length(b) <= 10
DefaultAlgorithmChoice.RFLUFactorization
elseif appleaccelerate_isavailable()
elseif appleaccelerate_isavailable() && b isa Array &&
eltype(b) <: Union{Float32, Float64, ComplexF32, ComplexF64}
DefaultAlgorithmChoice.AppleAccelerateLUFactorization
elseif (length(b) <= 100 || (isopenblas() && length(b) <= 500) ||
(usemkl && length(b) <= 200)) &&
Expand All @@ -188,7 +189,8 @@ function defaultalg(A, b, assump::OperatorAssumptions{Bool})
DefaultAlgorithmChoice.RFLUFactorization
#elseif A === nothing || A isa Matrix
# alg = FastLUFactorization()
elseif usemkl
elseif usemkl && b isa Array &&
eltype(b) <: Union{Float32, Float64, ComplexF32, ComplexF64}
DefaultAlgorithmChoice.MKLLUFactorization
else
DefaultAlgorithmChoice.LUFactorization
Expand Down

0 comments on commit 46726d0

Please sign in to comment.