Skip to content

Commit

Permalink
Bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Oct 31, 2023
1 parent 82e6365 commit 2d64194
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/host/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function gpu_checkindex_indices(A, IA::Tuple, I::Tuple)
end
function gpu_checkindex_indices(A, ::Tuple{}, I::Tuple)
@inline
gpu_checkindex(A, OneTo(1), I[1])::Bool & gpu_checkindex_indices(A, (), tail(I))
gpu_checkindex(A, Base.OneTo(1), I[1])::Bool & gpu_checkindex_indices(A, (), tail(I))
end
gpu_checkindex_indices(A, IA::Tuple, ::Tuple{}) = (@inline; all(x->length(x)==1, IA))
gpu_checkindex_indices(A, ::Tuple{}, ::Tuple{}) = true
Expand Down
6 changes: 6 additions & 0 deletions test/testsuite/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ end
@test_throws DimensionMismatch x[1:9,1:9,:,:] = y
end

@testset "mismatching axes/indices" begin
a = rand(1,1)
@test compare(a->a[1:1], AT, a)
@test compare(a->a[1:1,1:1], AT, a)
@test compare(a->a[1:1,1:1,1:1], AT, a)
end
end

@testsuite "indexing find" (AT, eltypes)->begin
Expand Down

0 comments on commit 2d64194

Please sign in to comment.