What are the lifetimes for CUDA constant memory?

Viewed 1059

I'm having trouble wrapping my head around the restrictions on CUDA constant memory.

  1. Why can't we allocate __constant__ memory at runtime? Why do I need to compile in a fixed size variable with near-global scope?

  2. When is constant memory actually loaded, or unloaded? I understand that cudaMemcpytoSymbol is 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)?

  3. Where does constant memory reside on the chip?

CUDA Architecture

I'm primarily interested in answers as they relate to Pascal and Volta.

1 Answers
Related