I’ve been wondering now and then how to setup kernel constants from the host side.
Since these just constants it should be possible to set these up before the kernel actually runs.
CUDA C Programming Guide section B.2.2. mentions how to retrieve a “handle” or “cuda pointer” if you will… to these constants by “quering/retrieving” them by name via api’s.
It mentions nice api’s for the runtime api which can be used to copy to and from symbols, for the driver api it only mentions a “get” function.
So my question is pretty simple really: Can the copy functions from the driver api be used to write and read values to and from these constants via the retrieved cuda pointer ?
My guess would be yes… but this would be nice to know… if so then guide could also be updated a little bit and mention that “cuda driver api memory copy functions” can be used to read/write the constants in the kernel/cuda device.
Perhaps it should even have a special section which is simply called: “reading and writing to constants” that’ll be nice :)