If I start my kernel with a grid whose blocks have dimensions:
dim3 block_dims(16,16);
How are the grid blocks now split into warps? Do the first two rows of such a block form one warp, or the first two columns, or is this arbitrarily-ordered?
Assume a GPU Compute Capability of 2.0.
Threads are numbered in order within blocks so that
threadIdx.x
varies the fastest, thenthreadIdx.y
the second fastest varying, andthreadIdx.z
the slowest varying. This is functionally the same as column major ordering in multidimensional arrays. Warps are sequentially constructed from threads in this ordering. So the calculation for a 2d block isThis is covered both in the programming guide and the PTX guide.