Can I call:
int offset=2;
cudaMemcpy(&a_d[offset], &a_h[offset], sizeof(float)*3, cudaMemcpyHostToDevice); // copy to device
assuming a_d and a_h are pointers to arrays of floats (size>5) allocated on the the device and host respectively.
Can I call:
int offset=2;
cudaMemcpy(&a_d[offset], &a_h[offset], sizeof(float)*3, cudaMemcpyHostToDevice); // copy to device
assuming a_d and a_h are pointers to arrays of floats (size>5) allocated on the the device and host respectively.
Yes, this is just pointer arithmetic and does not require dereferencing of a device pointer in host code.