const and volatile Qualifiers
CV-qualifiers (const and volatile) modify type behavior. const prevents modification; volatile prevents compiler optimization.
CV-qualifiers (const and volatile) modify type behavior. const prevents modification; volatile prevents compiler optimization.
Every function and variable in a CUDA source file needs to answer two questions: which processor does this run on or live on, and who is allowed to call or touch it. C++ alone has no way to express that — global, device, host, shared, constant, and their relatives are CUDA's answer, and getting them right is what makes the rest of the language (templates, references, most of the standard library subset) usable across the host/device boundary at all.