LESSON 26.05 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
The CUDA thread hierarchy
Watch one blur kernel split into threads, blocks, a grid and warps.
Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 26.05 · GPU BAY240 PIXELS · 240 THREADS
01
Stage 1 of 5 · One thread each
The blur kernel needs one GPU thread per pixel: 240 threads. The thread for pixel (9, 6) writes the mean of 9 pixels.
Explain it simply
Each small square is one pixel of a grey image. The GPU starts one thread for every pixel, and they all run the same short program. The traced thread adds the 9 pixels in its box and divides by 9. That mean is its output pixel, on the right.
A grey image of 20 by 12 pixels, one thread per pixel. The thread for pixel (9, 6) averages 9 pixels to 195.1.
pixelsblocks, SMsidle threadsempty lanestraced thread
Toy: 26.C2 · a 20 × 12 image · 3 × 3 blur · 2 SMs
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each output pixel is the mean of the 3 × 3 pixels around it.
PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
- 4 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.