Skip to content

Test a few more corner cases in reductions #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

christiangnrd
Copy link
Member

Adds a few corner case tests for reductions based on the AK.jl reduction tests.

Copy link
Contributor

github-actions bot commented Jul 14, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/testsuite/reductions.jl b/test/testsuite/reductions.jl
index 4db9c80..07a025a 100644
--- a/test/testsuite/reductions.jl
+++ b/test/testsuite/reductions.jl
@@ -56,11 +56,11 @@ end
         end
     end
     # Test more corner cases. Tests from AcceleraterKernels.jl
-    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]]
+    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]]
         for isize in 0:3
             for jsize in 0:3
                 for ksize in 0:3
-                    @test compare(A->mapreduce(x->x+x, +, A; init=zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
+                    @test compare(A -> mapreduce(x -> x + x, +, A; init = zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
                 end
             end
         end
@@ -84,11 +84,11 @@ end
         end
     end
     # Test more corner cases. Tests from AcceleraterKernels.jl
-    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]]
+    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]]
         for isize in 0:3
             for jsize in 0:3
                 for ksize in 0:3
-                    @test compare(A->reduce(+, A; init=zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
+                    @test compare(A -> reduce(+, A; init = zero(Int32), dims), AT, rand(Int32(1):Int32(10), isize, jsize, ksize))
                 end
             end
         end

@christiangnrd
Copy link
Member Author

Test failures are either expected or fixed with #605.

@christiangnrd christiangnrd merged commit e61d13c into JuliaGPU:master Jul 18, 2025
13 of 16 checks passed
@christiangnrd christiangnrd deleted the reductiontests branch July 18, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants