Skip to content

Commit b4d1f62

Browse files
committed
Reduce JL compat, test allocs in JL>1.8, explain regression.
1 parent ed3232e commit b4d1f62

File tree

10 files changed

+21
-13
lines changed

10 files changed

+21
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DocStringExtensions = "0.9"
1818
MuladdMacro = "0.2"
1919
Primes = "0.5"
2020
Reexport = "1"
21-
julia = "1.9"
21+
julia = "1.6"
2222

2323
[extras]
2424
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/onedim/complex_backward.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ end
1515
@test naive_1d_fourier_transform(x, FFTA.FFT_BACKWARD) bfft(x)
1616
end
1717

18-
@testset "allocation" begin
19-
@test (@allocations bfft(x)) <= 44
18+
@testset "allocation regression" begin
19+
@test (@test_allocations bfft(x)) <= 44
2020
end
2121
end
2222

test/onedim/complex_forward.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ end
1515
@test naive_1d_fourier_transform(x, FFTA.FFT_FORWARD) fft(x)
1616
end
1717

18-
@testset "allocation" begin
19-
@test (@allocations fft(x)) <= 44
18+
@testset "allocation regression" begin
19+
@test (@test_allocations fft(x)) <= 44
2020
end
2121
end
2222

test/onedim/real_backward.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ end
2525
@test naive_1d_fourier_transform(xe, FFTA.FFT_BACKWARD) brfft(x, n)
2626
end
2727

28-
@testset "allocation" begin
29-
@test (@allocations brfft(x, n)) <= 50
28+
@testset "allocation regression" begin
29+
@test (@test_allocations brfft(x, n)) <= 50
3030
end
3131
end
3232

test/onedim/real_forward.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ end
2222
end
2323
end
2424

25-
@testset "allocation" begin
26-
@test (@allocations rfft(x)) <= 48
25+
@testset "allocation regression" begin
26+
@test (@test_allocations rfft(x)) <= 48
2727
end
2828
end
2929

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ function padnum(m,x)
88
String(v)
99
end
1010

11+
macro test_allocations(args)
12+
if Base.VERSION >= v"1.9"
13+
:(@allocations($(esc(args))))
14+
else
15+
:(0)
16+
end
17+
end
18+
1119
function naive_1d_fourier_transform(x::Vector, d::FFTA.Direction)
1220
n = length(x)
1321
y = zeros(Complex{Float64}, n)

test/twodim/complex_backward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ end
1717
end
1818

1919
@testset "allocations" begin
20-
@test (@allocations bfft(X)) <= 111
20+
@test (@test_allocations bfft(X)) <= 111
2121
end
2222
end
2323
end

test/twodim/complex_forward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ end
1717
end
1818

1919
@testset "allocations" begin
20-
@test (@allocations fft(X)) <= 111
20+
@test (@test_allocations fft(X)) <= 111
2121
end
2222
end
2323
end

test/twodim/real_backward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ end
1111
@testset "allocations" begin
1212
X = randn(256, 256)
1313
rfft(X) # compile
14-
@test (@allocations rfft(X)) <= 51
14+
@test (@test_allocations rfft(X)) <= 51
1515
end

test/twodim/real_forward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ end
1212
X = randn(256, 256)
1313
Y = rfft(X)
1414
brfft(Y, 256) # compile
15-
@test (@allocations brfft(Y, 256)) <= 54
15+
@test (@test_allocations brfft(Y, 256)) <= 54
1616
end

0 commit comments

Comments
 (0)