I need a clarification about the code given in the answer to the topic: CUDA cudaMemcpy Struct of Arrays.
Both dev_s and dev_arr1(2 and 3) are allocated in the device. Why is the flag cudaMemcpyHostToDevice used? It should be cudaMemcpyDeviceToDevice.
The code is reported below.
// NOTE: Binding pointers with dev_s
cudaMemcpy(&(dev_s->arr1), &dev_arr1, sizeof(dev_s->arr1),cudaMemcpyHostToDevice);
cudaMemcpy(&(dev_s->arr2), &dev_arr2, sizeof(dev_s->arr2),cudaMemcpyHostToDevice);
cudaMemcpy(&(dev_s->arr3), &dev_arr3, sizeof(dev_s->arr3),cudaMemcpyHostToDevice);