Skip to content

Commit f8ce052

Browse files
committed
Update indexing.jl
Similar fix of JuliaGPU/CUDA.jl#2554 I got an index 0 after a call to `findall` and I suspect that it is the same issue.
1 parent f3e669f commit f8ce052

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kernels/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function Base.findall(bools::AnyROCArray{Bool})
99
I = keytype(bools)
1010
indices = cumsum(reshape(bools, prod(size(bools))))
1111

12-
n = @allowscalar indices[end]
12+
n = isempty(indices) ? 0 : @allowscalar indices[end]
1313
ys = ROCArray{I}(undef, n)
1414

1515
if n > 0

0 commit comments

Comments
 (0)