Skip to content

Commit

Permalink
Fix bug in handling Keylov solvers
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanry committed Nov 7, 2023
1 parent 585cbb8 commit 2803bda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/LinearSolveEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function EnzymeCore.EnzymeRules.forward(func::Const{typeof(LinearSolve.solve!)},
if RT <: Const
return res

Check warning on line 35 in ext/LinearSolveEnzymeExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveEnzymeExt.jl#L34-L35

Added lines #L34 - L35 were not covered by tests
end
if linsolve.alg isa LinearSolve.AbstractKrylovSubspaceMethod
if linsolve.val.alg isa LinearSolve.AbstractKrylovSubspaceMethod
error("Algorithm $(_linsolve.alg) is currently not supported by Enzyme rules on LinearSolve.jl. Please open an issue on LinearSolve.jl detailing which algorithm is missing the adjoint handling")

Check warning on line 38 in ext/LinearSolveEnzymeExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveEnzymeExt.jl#L37-L38

Added lines #L37 - L38 were not covered by tests
end
b = deepcopy(linsolve.val.b)

Check warning on line 40 in ext/LinearSolveEnzymeExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveEnzymeExt.jl#L40

Added line #L40 was not covered by tests
Expand Down
3 changes: 1 addition & 2 deletions test/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ for alg in (
RFLUFactorization(),
# KrylovJL_GMRES(), fails
)
alg_str = string(alg)
@show alg_str
@show alg
function fb(b)
prob = LinearProblem(A, b)

Expand Down

0 comments on commit 2803bda

Please sign in to comment.