memcpy question

Hi everyone, I’m just wondering if this memcpy is allowed. In particular, the fact that I’m using an offset into the array.

float* host_array  = (float*) malloc(size);

float* device_array;

cudaMalloc( (void**) &device_array, size*size));

cudaMemcpy(host_array, device_array + offset, size, cudaMemcpyDeviceToHost);


I think you can try it by yourself, but anyway, the answer is yes. Good luck!