Copying into constant memory Invalid Device Symbol

Hey folks,

I am trying to some data from the host to the device constant memory. But on doing so, I am getting the following error at the end of kernel call: “Invalid Device Symbol”

I am initialising constant memory in the following way:

__device__ __constant__ int nvert_dev;

I am copy data into the memory like this in the host function:

cudaMemcpyToSymbol(&nvert_dev, &nvert, sizeof(int), 0, cudaMemcpyHostToDevice);

Likewise, I am copying 9 floats and 2 integers.

Error again: Invalid Device Symbol.

Please throw some light.

Got it.

Should be:

cudaMemcpyToSymbol(“nvert_dev”, &nvert, sizeof(int), 0, cudaMemcpyHostToDevice);

Thanks anyways.