I am trying to copy the contents of a host array to constant memory on the device. This is pretty simple, and there are lots of examples of how to do this in the Programmer’s Guide and various websites. A sample of my code is below:
However, this code always returns an “invalid device symbol” cudaError_t. Any ideas why this might happen? I am using Cuda 2.1 on Ubuntu 64 bit with a Tesla C1060 card.
I have also tried a number of variants on this. I have prefaced particleMass_d with “device” as well as “constant”. I have tried “cudaMemcpyToSymbol(particleMass_d, particleMass_h, NUMBER_OF_PARTICLES*sizeof(float), 0, cudaMemcpyHostToDevice);”. I have also tried putting “particleMass_d” in quotes in the cudaMemcpyToSymbol function.