Diagram deck
Nvidia CUDA in 100 Seconds
1. Why GPUs Win at Parallel Work
From Section 2, "Why GPUs Are Built for Parallel Work": when one operation must run on millions of pixels at once, thousands of simple GPU cores beat a handful of powerful CPU cores.
A 1080p frame holds over 2 million pixels, and at 60 FPS each one is recomputed every frame. Graphics, matrix math, and AI training all share this shape: the same operation, repeated enormously.
CPU
Intel Core i9
24
cores
- Each core is large and powerful.
- Very different tasks, handled one at a time.
- Versatile: runs whatever you throw at it.
GPU
NVIDIA RTX 4090
16,000+
cores
- Thousands of small, simple cores.
- The same math, executed on every pixel at once.
- Throughput measured in teraflops.
A GPU is not one faster brain; it is thousands of tiny ones working together. CUDA is the tool that points all that parallelism at real computing problems.
2. Host and Device: The Five-Step CUDA Flow
From Section 3, "How CUDA Works: Host, Device, and Execution": every CUDA program is a handshake across the CPU-GPU boundary - kernel first, data over, launch, execute, results back. Step through it below.
Click any step to jump to it. Steps before the current one are complete.
3. Grid, Blocks, and Threads: Inside a Kernel Launch
From Section 4, "Building Your First CUDA Application": how the launch add<<<1, 256>>> maps 256 threads onto the grid, and why every thread computes its own index before touching data.
Every thread works out which element it owns:
blockIdx.x
Which block the thread lives in. The demo launches one block, so this is 0.
blockDim.x
How many threads each block holds. The launch asks for 256.
threadIdx.x
The thread's position inside its block: 0 to 255.
C[index] = A[index] + B[index];
256 threads, each adding the pair of elements at its own index - 256 additions in parallel. Afterwards, cudaDeviceSynchronize() pauses the host until every thread has finished.