We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9149006 commit b908b0aCopy full SHA for b908b0a
src/indexing.jl
@@ -28,7 +28,7 @@ function Base.findall(bools::WrappedMtlArray{Bool})
28
indices = MtlVector{Int64, Metal.SharedStorage}(undef, boolslen)
29
cumsum!(indices, reshape(bools, boolslen))
30
31
- n = indices[end]
+ n = isempty(indices) ? 0 : indices[end]
32
ys = similar(bools, I, n)
33
34
if n > 0
test/array.jl
@@ -533,6 +533,9 @@ end
533
end
534
535
# ND
536
+ let x = rand(Bool, 0, 0)
537
+ @test findall(x) == Array(findall(MtlArray(x)))
538
+ end
539
let x = rand(Bool, 1000, 1000)
540
@test findall(x) == Array(findall(MtlArray(x)))
541
0 commit comments