cudaMemcpy question

Hi all,
I have a question regarding the cudaMemcpy. I always used to have an array and when i transferred the array from CPU to GPU, i transfered all of it.

However, now, i have the array of size 81 and i want to transfer elements from 9-18.

So my question is do i have to create a new array, copy elements 9-18 to it, and then transfer it to GPU, or is there a shortuct way to do:

cudaMemcpy(dev, a, “elements from 9-18”, ToDevice);

Thanks for any answers!

Maybe something like:

cudaMemcpy(dev, &a[9], 10 * sizeof(double), cudaMemcpyHostToDevice)

i.e. pass as reference the first element you wanna copy, and then the number of elements to copy.

I was able to do something like that only by defining an array of pointers like

double *dev_pos[nstr];

//then allocate each pointer 




kernel<<<  >>>(dev_pos[is]);


// and for copy