cuda.grid is a Numba CUDA intrinsic for obtaining the calling thread's global position. A kernel typically handles one array element, uses cuda.grid(1) for a one-dimensional index, and writes directly to that element. section 9.2.2
Doubling an array
A kernel can obtain position = cuda.grid(1) and multiply my_array[position] by two. With 1,000 elements, a 50-by-20 launch covers the array exactly; a 63-by-16 launch requires a bounds check.
