Skip to content

Conversation

@tam724
Copy link
Contributor

@tam724 tam724 commented Aug 6, 2025

On empty arrays, findfirst failed with a BoundsError. We can catch this case with isempty and return nothing, which matches the behaviour for non-gpu arrays.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 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/indexing.jl b/test/testsuite/indexing.jl
index d8943de..db71049 100644
--- a/test/testsuite/indexing.jl
+++ b/test/testsuite/indexing.jl
@@ -173,7 +173,7 @@ end
 
         # emtpy
         @test compare(findfirst, AT, Bool[])
-        @test compare(x->findfirst(>(0.5f0), x), AT, Float32[])
+        @test compare(x -> findfirst(>(0.5f0), x), AT, Float32[])
     end
 
     @testset "findmax & findmin" begin

@maleadt
Copy link
Member

maleadt commented Oct 8, 2025

Thanks, and sorry about the delay!

@maleadt maleadt merged commit 2e884f7 into JuliaGPU:master Oct 8, 2025
13 of 16 checks passed
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