GPUArrays.jl icon indicating copy to clipboard operation
GPUArrays.jl copied to clipboard

Indexing with arrays

Open MikeInnes opened this issue 7 years ago • 2 comments

This is with CuArrays own indexing disabled.

Strangely plain arrays seem to work, but not cuarrays.

julia> cu([1:5;])[[5,2,3]]
3-element CuArray{Float32,1}:
 5.0
 2.0
 3.0

julia> cu([1:5;])[cu[5,2,3]]
ERROR: scalar getindex is disabled

MikeInnes avatar Jan 09 '18 11:01 MikeInnes

Seems like the code in Base doesn't route us to the Base._unsafe_getindex! we overload. Was this not the case in CuArrays?

SimonDanisch avatar Jan 09 '18 11:01 SimonDanisch

Yeah I'm pretty sure I got it working at some point.

MikeInnes avatar Jan 09 '18 12:01 MikeInnes