set constant memory for use in _global function

Suppose I have a C`host main function driver, and I want to set a constant variable on the device which will execute a global device CU function, is there any way to assign a constant variable on the device?

How would the variable be declared?

I can see how to do it with a CU main function, but not with a main C function driver.


Not sure if I understand that correctly, but you can call any CUDA API function outside a .cu file.

So cudaMemcpyToSymbol is your friend.