Built-in variables
Language extensions: built-in variables
struct dim3 {int x, y, z}
dim3 gridDim;
// dimestions of the grid in blocks (gridDim.z unused prior to CUDA 4.0)
dim3 blockDim;
// dimensions of the block in threads
dim3 blockIdx;
// block index within grid
dim3 threadIdx;
// thread index within block

Computing global thread ID

Last updated