Skip to content

Commit

Permalink
Merge pull request #413 from pepijndevos/new-branch
Browse files Browse the repository at this point in the history
Change typeof(x) <: y to x isa y
  • Loading branch information
ChrisRackauckas authored Nov 2, 2023
2 parents dbd631f + 68152be commit d863895
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ext/LinearSolveEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ end
function EnzymeCore.EnzymeRules.reverse(config, func::Const{typeof(LinearSolve.solve!)}, ::Type{RT}, cache, linsolve::EnzymeCore.Annotation{LP}; kwargs...) where {RT, LP <: LinearSolve.LinearCache}
y, dys, _linsolve, dAs, dbs = cache

@assert !(typeof(linsolve) <: Const)
@assert !(typeof(linsolve) <: Active)
@assert !(linsolve isa Const)
@assert !(linsolve isa Active)

if EnzymeRules.width(config) == 1
dys = (dys,)
Expand Down
2 changes: 1 addition & 1 deletion ext/LinearSolveIterativeSolversExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function LinearSolve.init_cacheval(alg::IterativeSolversJL, A, b, u, Pl, Pr, max
end

function SciMLBase.solve!(cache::LinearCache, alg::IterativeSolversJL; kwargs...)
if cache.isfresh || !(typeof(alg) <: IterativeSolvers.GMRESIterable)
if cache.isfresh || !(alg isa IterativeSolvers.GMRESIterable)
solver = LinearSolve.init_cacheval(alg, cache.A, cache.b, cache.u, cache.Pl,
cache.Pr,
cache.maxiters, cache.abstol, cache.reltol,
Expand Down
2 changes: 1 addition & 1 deletion src/factorization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ function init_cacheval(::SparspakFactorization, A, b, u, Pl, Pr, maxiters::Int,
reltol,
verbose::Bool, assumptions::OperatorAssumptions)
A = convert(AbstractMatrix, A)
if typeof(A) <: SparseArrays.AbstractSparseArray
if A isa SparseArrays.AbstractSparseArray
return sparspaklu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A),
nonzeros(A)),
factorize = false)
Expand Down

0 comments on commit d863895

Please sign in to comment.