JuliaGPU/CUDA.jl

missing kernel for Base.unique

Open

#991 aperta il 17 giu 2021

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Julia (274 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (1408 star)
Metriche merge PR
 (Merge medio 5g 5h) (16 PR mergiate in 30 g)

Descrizione

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

Guida contributor