We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb72f52 commit 14864f3Copy full SHA for 14864f3
1 file changed
test/basic.jl
@@ -56,6 +56,16 @@ sinexpbc(x) = sinexp.(x)
56
@test @jit(sinexpbc(a)) ≈ r_res
57
end
58
59
+function throw_if_within_autodiff()
60
+ if Enzyme.within_autodiff()
61
+ error("`within_autodiff` returned true even though we are not in an autodiff call.")
62
+ end
63
+ return nothing
64
+end
65
+@testset "within_autodiff" begin
66
+ @test isnothing(@jit throw_if_within_autodiff())
67
68
+
69
sumexp(x) = sum(exp, x)
70
71
sum_compare(x) = sum(x) > 0
0 commit comments