@@ -27,12 +27,9 @@ function test_enzyme_eig_full(
2727 alg = MatrixAlgebraKit. select_algorithm (eig_full, A)
2828 DV, ΔDV = ad_eig_full_setup (A)
2929 test_reverse (eig_full, RT, (A, TA), (alg, Const); atol, rtol, output_tangent = ΔDV, fdm)
30- test_reverse (call_and_zero!, RT, (eig_full!, Const), (A, TA), (alg, Const); atol, rtol, output_tangent = ΔDV, fdm)
31- if eltype (T) <: Real && T <: Diagonal
32- A = make_eig_matrix (T, sz)
33- test_forward (eig_full, RT, (A, TA), (alg, Const); atol, rtol, fdm)
34- test_forward (call_and_zero!, RT, (eig_full!, Const), (A, TA), (alg, Const); atol, rtol, fdm)
35- end
30+ test_reverse (call_and_zero!, RT, (eig_full!, Const), (copy (A), TA), (alg, Const); atol, rtol, output_tangent = ΔDV, fdm)
31+ test_forward (eig_full, RT, (A, TA), (alg, Const); atol, rtol, fdm)
32+ test_forward (call_and_zero!, RT, (eig_full!, Const), (copy (A), TA), (alg, Const); atol, rtol, fdm)
3633 end
3734end
3835
@@ -51,12 +48,9 @@ function test_enzyme_eig_vals(
5148 alg = MatrixAlgebraKit. select_algorithm (eig_vals, A)
5249 D, ΔD = ad_eig_vals_setup (A)
5350 test_reverse (eig_vals, RT, (A, TA), (alg, Const); atol, rtol, output_tangent = ΔD, fdm)
54- test_reverse (call_and_zero!, RT, (eig_vals!, Const), (A, TA), (alg, Const); atol, rtol, output_tangent = ΔD, fdm)
55- if eltype (T) <: Real
56- A = make_eig_matrix (T, sz)
57- test_forward (eig_vals, RT, (A, TA), (alg, Const); atol, rtol, fdm)
58- test_forward (call_and_zero!, RT, (eig_vals!, Const), (A, TA), (alg, Const); atol, rtol, fdm)
59- end
51+ test_reverse (call_and_zero!, RT, (eig_vals!, Const), (copy (A), TA), (alg, Const); atol, rtol, output_tangent = ΔD, fdm)
52+ test_forward (eig_vals, RT, (A, TA), (alg, Const); atol, rtol, fdm)
53+ test_forward (call_and_zero!, RT, (eig_vals!, Const), (copy (A), TA), (alg, Const); atol, rtol, fdm)
6054 end
6155end
6256
0 commit comments