I’m sure this is in some CUDA document somewhere, but I haven’t bean able to find it.
Is the first value of threadIdx.x equal to “0” or to “1”. I assume that it is “0”, but all the documentation I’ve read give examples for, say, a 2 x 2 block as having indices of (0,0), (0,1), (1,0), (1,1).
I would guess that the zero reference is handled transparently.
If so, it would be nice to see that documented explicitly.
It is 0, following standard C conventions, which is also precisely what your example shows as well. The only thing which differs from standard C is that multi-dimensional blocks and grids use column-major ordering.