LESSON 27.05 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Streams, events and asynchronous execution
Watch the CPU queue GPU work, wait for one event and run ahead.
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 · 27.05 · STREAM BAYSTEP 1 · CPU 24 µs · GPU 70.8 µs
01
Stage 1 of 5 · Queue kernels
Each launch puts a kernel in stream 1, a queue on the GPU. The CPU goes on after 2 µs.
Explain it simply
This is asynchronous execution: the CPU does not wait for a kernel to finish. It queues all 12 kernels of step 1 in 24 microseconds. The GPU runs them one by one and ends at 70.8 microseconds. Each ochre line shows how long one kernel sits in the queue.
The CPU lane holds 12 launch calls that end at 24.0 µs. Stream 1 runs the 12 kernels until 70.8 µs.
kernelCPU call, host worktoken copyidle GPUCPU waits
Toy: 3 decode steps of 12 kernels, 2 µs per CUDA call
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
A kernel starts once it is queued and the kernel before it has ended.
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.