Skip to content

Commit 97b9e97

Browse files
authored
Merge pull request #247 from JuliaGPU/tb/0d_scalar
Disallow 0D scalar iteration.
2 parents 91fbbac + 9de3a4f commit 97b9e97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/host/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ end
8383
Base.IndexStyle(::Type{<:AbstractGPUArray}) = Base.IndexLinear()
8484

8585
function Base.getindex(xs::AbstractGPUArray{T}, i::Integer) where T
86-
ndims(xs) > 0 && assertscalar("scalar getindex")
86+
assertscalar("scalar getindex")
8787
x = Array{T}(undef, 1)
8888
copyto!(x, 1, xs, i, 1)
8989
return x[1]

0 commit comments

Comments
 (0)