dim3
This type is an integer vector type based on uint3 that is used to specify dimensions.
- When defining a variable of type
dim3
, any component left unspecified is initialized to1
.
#
Built-in variables specify the grid and block dimensions and the block and thread indices. They are only valid within functions that are executed on the device.
gridDim
- This variable is of type dim3 and contains the dimensions of the grid.
blockIdx
- This variable is of type uint3 and contains the block index within the grid.
blockDim
- This variable is of type dim3 and contains the dimensions of the block.
threadIdx
- This variable is of type uint3 and contains the thread index within the block.
warpSize
- This variable is of type int and contains the warp size in threads.
- warp $n$ starts with thread $32*n$ and ends with thread $32(n + 1) – 1$.
- For a block whose size is not a multiple of 32, the last warp will be padded with extra threads to fill up the 32 threads;
- For blocks that consist of multiple dimensions of threads, the dimensions will be projected into a linear order before partitioning into warps.
- When thread execution diverges, then the different branches of execution are run serially, until the divergent section has completed, at which point all threads in the block execute in parallel again, until the next divergence within that block.