I’m having trouble with a basic copy operation on the GPU. My goal is to copy a chosen subset of data from an N-D array into a vector. My following two attempts have failed.
using CUDA CUDA.allowscalar(false) a=CUDA.rand(2,4) c=cu([CartesianIndex(1,2), CartesianIndex(2,3)]) b = a[c]
Fails due to scalar operation
b=CUDA.zeros(2) copyto!(b, CartesianIndices(b), a, c)
I must be missing something very simple. Any advice? I know I can write a custom kernel, but this seems like a fairly generic copy operation.