memcpy errors memcpy seems to fail with global data

I seem to get many inexplicable errors when using global variables in device memory

to return values from my kernel.

Here are the relevant portions of my source file:

__device__  	long	d_iq_corr[1023];

...

kernel(...)

if (tid==0)

	{

  

  	d_iq_corr[0+quadrature_channel] = accums1[0];

  d_iq_corr[2+quadrature_channel] = accums2[0];

  d_iq_corr[4+quadrature_channel] = accums3[0];

  

	}

...

__global__ wrapper_function()

kernel invocation<<<>>>(...)

 CUDA_SAFE_CALL(cudaMemcpy(iqSums, d_iq_corr,  6*sizeof(long),

                              cudaMemcpyDeviceToHost));

the last call to cudaMemcpy fails with a cudaError at memory location xxxxx.

I can mail you the full source file.

Disclaimer: I’ve never used a device variable, so someone correct me if I’m wrong.

I’m pretty sure that you need to use cudaGetSymbolAddress to get the address of a device variable declared like that.

That was it, thank you.