Skip to content

Commit

Permalink
Error on unsupported return type and relax tolerence on tests to avoi…
Browse files Browse the repository at this point in the history
…d random failures
  • Loading branch information
sharanry committed Nov 7, 2023
1 parent 3a3102b commit 585cbb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ext/LinearSolveEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function EnzymeCore.EnzymeRules.forward(func::Const{typeof(LinearSolve.init)}, :
elseif RT <: Duplicated
return Duplicated(res, dres)

Check warning on line 24 in ext/LinearSolveEnzymeExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveEnzymeExt.jl#L18-L24

Added lines #L18 - L24 were not covered by tests
end
error("Unsupported return type $RT")

Check warning on line 26 in ext/LinearSolveEnzymeExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveEnzymeExt.jl#L26

Added line #L26 was not covered by tests
end

function EnzymeCore.EnzymeRules.forward(func::Const{typeof(LinearSolve.solve!)}, ::Type{RT}, linsolve::EnzymeCore.Annotation{LP}; kwargs...) where {RT, LP <: LinearSolve.LinearCache}
Expand Down
4 changes: 2 additions & 2 deletions test/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ for alg in (
end |> collect
@show en_jac

@test en_jac fd_jac rtol=1e-6
@test en_jac fd_jac rtol=1e-4

function fA(A)
prob = LinearProblem(A, b1)
Expand All @@ -213,5 +213,5 @@ for alg in (
end |> collect
@show en_jac

@test en_jac fd_jac rtol=1e-6
@test en_jac fd_jac rtol=1e-4
end

0 comments on commit 585cbb8

Please sign in to comment.