Lesson 1: What is a GPU?
Before we write a single line of code, let's meet the hero of this course: the GPU. Picture an office. The CPU (the regular processor in your computer) is like a small team of a few very brilliant workers. Each one is smart, fast, and can solve a complicated task alone from start to finish. The GPU
A CPU is four problem-solving grown-ups who can build a huge, complicated LEGO model alone, step by step. A GPU is a classroom of a thousand kids: each kid only knows how to snap two bricks together, but if you give them all the same simple instruction at once — in a second they build a giant wall. The GPU's secret is not one clever kid, but many hands working together.
- core
- A single worker inside the processor. A CPU has a few strong cores; a GPU has thousands of simple cores working together.
- thread
- One worker's small task — a single piece of work. On a GPU thousands of threads run at once, each on a different item.
- parallelism
- Several things happening at the same time, in the same moment, instead of one after another. This is the source of the GPU's power.
- data parallelism
- Doing the exact same operation on many independent items at once — like coloring every pixel or adding every pair of numbers.