I’ve been experimenting with constant variables.
The results have proven very curious and I’m wondering if anyone else has had similar experiences:
I can’t get constant variables declared as pointers and then malloced using cudaMalloc() to work. Doing this slows things down to speeds equivalent to global storage.
constant variables (which now have to be declared as arrays – constant float mydata;) can’t apparently be cudaMemcpy’ed to without similar results – it works, but things become incredibly slow.
As far as I can figure out, the only ways to get data into a constant variable is to assign it at compile time or memcpy to it using cudaMemcpyToSymbol during runtime.
Are these results consistent with what everybody else has been seeing or am I doing something wrong? I don’t have postable code at the moment but I can probably whip something up if anyone wants to see.
Thanks in advance!
Oregon State University Graphics
Edit: toned down the post a bit…