liveBook · Manning

CPU

As explained in Grokking GPU Programming

A CPU is a general-purpose processor that executes program instructions.

A CPU runs the main program and handles tasks that benefit from low latency, such as complex logic and work that must happen step by step. Unlike a GPU’s thousands of simple processing units, a CPU has fewer, more capable cores. section 1.10 section 1.2

Imagine assigning students to grade exams. Many graders can work at once if each exam is independent, but they may sit idle if they must wait for one shared answer key. More processors help only when the work can be divided. section 1.2 section 1.10

Table 1.2 Contrasting CPU and GPU design philosophies.
 
CPU (Master Chef)
GPU (Thousand Cooks)
Cores
6–24 on typical desktops
Thousands of simple processing units
Design Goal
Low Latency (Finish each task fast)
High Throughput (Finish many tasks at once)
Analogy
A chef preparing a complex 7-course meal
1,000 workers rolling 1,000 burritos at once
Best For
OS, Web Servers, Complex Logic, and any single-threaded task where one fast core wins
Matrix Math, Image Processing, AI, and many more parallel patterns you’ll discover in this book

Compare CPU and GPU design goals and the kinds of work each handles well. section 1.6

How Grokking GPU Programming covers it

How deep it goes
Contrasts CPU core design and latency goals with GPU throughput, but does not detail CPU architecture.
Examples
Uses exam grading to illustrate dependencies and contrasts CPU tasks with GPU matrix math and image processing.
What you can do after
Evaluate whether work suits CPU execution or can be divided into independent tasks for a GPU.
How it connects
Connects CPU execution with GPUs, parallel computing, MPI, OpenMP, and SIMD.

Also explained in

Compare how 9 books explain CPU →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking GPU Programming. The section links point to the parts of the book it draws on.