-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
Description
MWE:
julia> using CUDA
julia> issorted(cu(rand(10)))
ERROR: Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
This is typically caused by calling an iterating implementation of a method.
Such implementations *do not* execute on the GPU, but very slowly on the CPU,
and therefore should be avoided.
If you want to allow scalar iteration, use `allowscalar` or `@allowscalar`
to enable scalar iteration globally or for the operations in question.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] errorscalar(op::String)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:151
[3] _assertscalar(op::String, behavior::GPUArraysCore.ScalarIndexing)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:124
[4] assertscalar(op::String)
@ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:112
[5] getindex
@ ~/.julia/packages/GPUArrays/w335n/src/host/indexing.jl:50 [inlined]
[6] iterate
@ ./abstractarray.jl:1235 [inlined]
[7] iterate
@ ./abstractarray.jl:1233 [inlined]
[8] issorted(itr::CuArray{Float32, 1, CUDA.DeviceMemory}, order::Base.Order.ForwardOrdering)
@ Base.Sort ./sort.jl:51
[9] #issorted#1
@ ./sort.jl:95 [inlined]
[10] issorted(itr::CuArray{Float32, 1, CUDA.DeviceMemory})
@ Base.Sort ./sort.jl:88