Skip to content

Commit ccce870

Browse files
authored
Update allocation tests for Julia version compatibility
Signed-off-by: Hong Ge <[email protected]>
1 parent 0b97be5 commit ccce870

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test_utils.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,12 @@ function test_rrule_performance(
820820

821821
# Test allocations in primal.
822822
f(x...)
823-
@test (@allocations f(x...)) == 0
823+
824+
@static if VERSION >= v"1.12-"
825+
@test (@allocations f(x...)) == 0
826+
else
827+
@test Base.allocations(f, x...) == 0
828+
end
824829

825830
# Test allocations in round-trip.
826831
f_f̄_fwds = to_fwds(f_f̄)

0 commit comments

Comments
 (0)