Skip to content

Commit e61d13c

Browse files
Test a few more corner cases in reductions (#604)
1 parent 86b51fe commit e61d13c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/testsuite/reductions.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ end
5555
@test compare(A->mapreduce(x->x+x, +, A; dims=dims, init=zero(ET)), AT, rand(range, sz))
5656
end
5757
end
58+
# Test more corner cases. Tests from AcceleraterKernels.jl
59+
for dims in [1,2,3,4,[1,2],[1,3],[1,4],[2,3],[2,4],[3,4],[1,2,3],[1,2,4],[1,3,4],[2,3,4],[1,2,3,4]]
60+
for isize in 0:3
61+
for jsize in 0:3
62+
for ksize in 0:3
63+
@test compare(A->mapreduce(x->x+x, +, A; init=zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
64+
end
65+
end
66+
end
67+
end
5868
end
5969

6070
@testsuite "reductions/reduce" (AT, eltypes)->begin
@@ -73,6 +83,16 @@ end
7383
end
7484
end
7585
end
86+
# Test more corner cases. Tests from AcceleraterKernels.jl
87+
for dims in [1,2,3,4,[1,2],[1,3],[1,4],[2,3],[2,4],[3,4],[1,2,3],[1,2,4],[1,3,4],[2,3,4],[1,2,3,4]]
88+
for isize in 0:3
89+
for jsize in 0:3
90+
for ksize in 0:3
91+
@test compare(A->reduce(+, A; init=zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
92+
end
93+
end
94+
end
95+
end
7696
end
7797

7898
@testsuite "reductions/sum prod" (AT, eltypes)->begin

0 commit comments

Comments
 (0)