I'm having trouble wrapping my head around the restrictions on CUDA constant memory.
Why can't we allocate
__constant__memory at runtime? Why do I need to compile in a fixed size variable with near-global scope?When is constant memory actually loaded, or unloaded? I understand that
cudaMemcpytoSymbolis used to load the particular array, but does each kernel use its own allocation of constant memory? Related, is there a cost to binding, and unbinding similar to the old cost of binding textures (aka, using textures added a cost to every kernel invocation)?Where does constant memory reside on the chip?
I'm primarily interested in answers as they relate to Pascal and Volta.
