Skip to content

Commit

Permalink
Ensure that BLAS is only called with BLAS element types
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 6, 2023
1 parent d914caa commit d5d5e62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function defaultalg(A, b, assump::OperatorAssumptions)
# whether MKL or OpenBLAS is being used
if (A === nothing && !(b isa GPUArraysCore.AbstractGPUArray)) || A isa Matrix
if (A === nothing ||
eltype(A) <: Union{Float32, Float64, ComplexF32, ComplexF64}) &&
eltype(A) <: BLASELTYPES) &&
ArrayInterface.can_setindex(b) &&
(__conditioning(assump) === OperatorCondition.IllConditioned ||
__conditioning(assump) === OperatorCondition.WellConditioned)
Expand All @@ -180,7 +180,8 @@ function defaultalg(A, b, assump::OperatorAssumptions)
DefaultAlgorithmChoice.QRFactorization
elseif __conditioning(assump) === OperatorCondition.SuperIllConditioned
DefaultAlgorithmChoice.SVDFactorization
elseif usemkl
elseif usemkl && (A === nothing ? eltype(b) <: BLASELTYPES :
eltype(A) <: BLASELTYPES)
DefaultAlgorithmChoice.MKLLUFactorization
else
DefaultAlgorithmChoice.LUFactorization
Expand Down

0 comments on commit d5d5e62

Please sign in to comment.