GPU Programming

On NVIDIA GPUs, what is the unit of 32 threads bundled together to execute the same instruction in lockstep called?

  1. AA warp
  2. BA grid
  3. CA page
Show answer and explanation

Answer: A. A warp

Inside the hardware, a block's threads are grouped into warps of 32, and the 32 threads of a warp execute the same instruction at the same time on different data. Running code written as threads in lockstep bundles like this is called SIMT. AMD GPUs call the similar unit a wavefront, of 64 or 32 threads. Block sizes should normally be multiples of 32.

GPU thread hierarchy and assignment to SMs Grid B0 B1 B2 B3 B4 B5 Block Warp 0 Warp 1 Warp 2 Warp (32 threads) Same instruction in lockstep Threads grouped by 32 Each block goes to an SM SM0 B0 B3 Shared memory SM1 B1 B4 Shared memory SM2 B2 B5 Shared memory Global memory (read/write from all blocks) A block runs on one SM and cooperates via shared memory
GPU thread hierarchy and assignment to SMs · View in diagrams
  • A. Correct. It is the unit the hardware schedules.
  • B. A grid is the whole of one kernel launch.
  • C. A page is a unit of virtual memory.