Skip to content

Commit 2030c02

Browse files
committed
Add tests
1 parent ba255da commit 2030c02

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/accumulate.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@ end
192192
# Test that undefined kwargs are not accepted
193193
@test_throws MethodError AK.accumulate(+, v; init=10, dims=2, inclusive=false, bad=:kwarg)
194194

195+
# Test all options with bigger matrices
196+
for D in [(1_000_000,3), (3,1_000_000)], dims in [1,2]
197+
@testset let D = D, dims = dims
198+
vh = ones(Float32, D)
199+
v = array_from_host(vh)
200+
s = AK.accumulate(+, v; init=0, dims)
201+
sh = Array(s)
202+
@test sh == accumulate(+, vh; init=0, dims)
203+
end
204+
end
205+
195206
# Testing different settings
196207
AK.accumulate(
197208
(x, y) -> x + 1,

0 commit comments

Comments
 (0)