Skip to content

Scalar indexing on GPU #51

@Moelf

Description

@Moelf
julia> using ArraysOfArrays, CUDA, Adapt

julia> cpu_ary=VectorOfVectors([rand(Float32, rand(1:5)) for _ = 1:3])
3-element VectorOfVectors{Float32, Vector{Float32}, Vector{Int64}, Vector{Tuple{}}}:
 Float32[0.7436946]
 Float32[0.6354585, 0.57725984]
 Float32[0.4983889, 0.11524224, 0.028724253, 0.77355224]

julia> gpu_ary = adapt(CuArray, cpu_ary);

julia> map(argmin, gpu_ary)
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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions