I want to make a simple copy from the first half of a vector in the device to the second one. I tried with the sample code below, but I’m getting “Caught signal 11 (Segmentation fault: address not mapped to object at address)”
I am assuming that d_field is defined as cufftComplex* d_field;
If d_field is allocated in device memory, d_field[0] and d_field[offset] cannot be accessed from the host.
You could use &d_field[offset] or d_field + offset to get the pointer to the respective element.
Sorry, in order to make the sample code ‘leaner’, I forgot to place the & in the snippet, the problematic code have the & like you described. I will fix the post.
Using half_field_size as both an offset in terms of elements and as a number of bytes to transfer is probably wrong.
If you need more help to find your issue, you need to provide a complete minimal example which can be compiled and executed.