assignment of __constant__


I am experiencing problems in assigning device constants (e.g. constant int …).

For instance, I assume that the statement:

__constant__ int Nrows = 500;

creates a symbol called “Nrows” in the constant device memory and initializes it to 500.

This seems to work in emulation mode (emu=1), but not in device mode.

Am I thinking wrong about the initialization of constants? How do they have to be initialized?

Thank you in advance,


Use cudaMemcpyToSymbol

Thank you very much!