enhancementgood first issue
仓库指标
- Star
- (1,408 star)
- PR 合并指标
- (平均合并 5天 5小时) (30 天内合并 16 个 PR)
描述
julia> using CUDA
julia> x=cu([1,2,4,4]);
julia> CUDA.allowscalar(false)
julia> unique(x)
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 are only permitted from the REPL for prototyping purposes.
If you did intend to index this array, annotate the caller with @allowscalar.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] assertscalar(op::String)
@ GPUArrays ~/.julia/packages/GPUArrays/ymNij/src/host/indexing.jl:51
[3] getindex
@ ~/.julia/packages/GPUArrays/ymNij/src/host/indexing.jl:84 [inlined]
[4] iterate
@ ./abstractarray.jl:1096 [inlined]
[5] iterate
@ ./abstractarray.jl:1094 [inlined]
[6] unique(itr::CuArray{Int64, 1})
@ Base ./set.jl:127
[7] _unique_dims
@ ./multidimensional.jl:1587 [inlined]
[8] #unique#484
@ ./multidimensional.jl:1585 [inlined]
[9] unique(A::CuArray{Int64, 1})
@ Base ./multidimensional.jl:1585
[10] top-level scope
@ REPL[13]:1
[11] top-level scope
@ ~/.julia/packages/CUDA/mVgLI/src/initialization.jl:52