JetBrains Rider 2026.3 Help

Code inspection: '__grid_constant__' is only allowed on a kernel parameter

This inspection reports the __grid_constant__ specifier used anywhere except on a parameter of a __global__ function. The specifier makes the kernel use a single read-only copy of the parameter for the whole grid, so it is allowed only on kernel parameters.

Example

struct Params { int data[8]; }; __device__ void process(const __grid_constant__ Params params);
struct Params { int data[8]; }; __global__ void process(const __grid_constant__ Params params);

If the function is not a kernel, remove __grid_constant__.

27 October 2026