I am having problems copying data from my device back to the host. My data are arranged in a struct:
typedef struct Array2D {
double* arr;
in
It looks like h_output
is allocated with a call to malloc()
. In the first call to cudaMemcpy()
(line 2), h_output
is being used as as a host pointer (which seems right). In the second call to cudaMemcpy()
(line 4), h_output->arr
is being used as a device pointer (which does not seem right). In that 4th line, it looks like you are copying from host memory to host memory. So, you will probably want to use just a straight memcpy()
instead of cudaMemcpy()
.
At least that is what it looks like from the code you have provided.