JuliaGPU/CUDA.jl

missing kernel for Base.unique

Open

#991 ouverte le 17 juin 2021

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Julia (274 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (1 408 stars)
Métriques de merge PR
 (Merge moyen 5j 5h) (16 PRs mergées en 30 j)

Description

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

Guide contributeur