Proper use of cudaMemcpyToSymbol prior to CUDA 4.0:
cudaMemcpyToSymbol("PNT", point, sizeof(double)*SIZE)
or alternatively:
double *cpnt; cudaGetSymbolAddress((void **)&cpnt, "PNT"); cudaMemcpy(cpnt, point, sizeof(double)*SIZE, cudaMemcpyHostToDevice);
which can be a little faster if you plan to access the symbol from the host API more than once.
EDIT: misunderstood the question. For a global version of memory, do something similar to the second version for persistent memory
double *gpnt; cudaGetSymbolAddress((void **)&gpnt, "PNT"); cudaMemcpy(gpnt, point, sizeof(double)*SIZE. cudaMemcpyHostToDevice););
source share