A CUDA kernel can use `const __restrict__` on a pointer parameter to promise that its data is read-only and is not aliased through another pointer. This gives the compiler information it can use to choose a suitable load path. section 13.3
Marking a large input array
In `__global__ void kernel(const float* __restrict__ input, float* output)`, `input` is read-only and unaliased. This is a fit for a large read-only array or per-thread indexing; the compiler chooses the load path, which varies by GPU generation. section 13.3
Choose the read-only data approach to match how the array is used:
- Use `const __restrict__` pointers for large arrays or per-thread indexing. section 13.16
- Use `__constant__` for a small uniform array under 64 KB when every thread reads the same index. Use `__ldg(ptr)` explicitly only when the compiler cannot infer read-only status. section 13.3
