Code inspection: A '__grid_constant__' parameter must have a const-qualified non-reference type
This inspection reports a __grid_constant__ parameter that is not const or that is declared as a reference. For such a parameter, the kernel receives a read-only copy of the object that is shared by the whole grid, so the parameter needs to be a const non-reference.
Example
struct Params { int data[8]; };
__global__ void kernel(__grid_constant__ Params params);
struct Params { int data[8]; };
__global__ void kernel(const __grid_constant__ Params params);
Do not use Params& or const Params& for this parameter.
27 October 2026