JuliaGPU/CUDA.jl

missing kernel for Base.unique

Open

#991 geöffnet am 17. Juni 2021

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Julia (274 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (1.408 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 5h) (16 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide