From 585cbb83319be88400b0530a48f1d9bffbe08035 Mon Sep 17 00:00:00 2001 From: Sharan Yalburgi Date: Tue, 7 Nov 2023 18:17:02 +0530 Subject: [PATCH] Error on unsupported return type and relax tolerence on tests to avoid random failures --- ext/LinearSolveEnzymeExt.jl | 1 + test/enzyme.jl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/LinearSolveEnzymeExt.jl b/ext/LinearSolveEnzymeExt.jl index 4075f940b..2a9f031e7 100644 --- a/ext/LinearSolveEnzymeExt.jl +++ b/ext/LinearSolveEnzymeExt.jl @@ -23,6 +23,7 @@ function EnzymeCore.EnzymeRules.forward(func::Const{typeof(LinearSolve.init)}, : elseif RT <: Duplicated return Duplicated(res, dres) end + error("Unsupported return type $RT") end function EnzymeCore.EnzymeRules.forward(func::Const{typeof(LinearSolve.solve!)}, ::Type{RT}, linsolve::EnzymeCore.Annotation{LP}; kwargs...) where {RT, LP <: LinearSolve.LinearCache} diff --git a/test/enzyme.jl b/test/enzyme.jl index 96c4d28d7..864fc5283 100644 --- a/test/enzyme.jl +++ b/test/enzyme.jl @@ -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) @@ -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 \ No newline at end of file