GPGPU means using a graphics processing unit (GPU) for general-purpose computation. CUDA made this practical with familiar C-like syntax, without disguising computations as graphics operations. GPUs suit work that repeats simple operations across large amounts of data; CPUs are better suited to tasks where one fast core handles complex logic. section 1.6
Matrix multiplication
Multiplying two 4,096×4,096 matrices illustrates a strong GPU fit: estimates put a modern GPU’s time well below a modern multi-core CPU’s. But copying data to and from the GPU and launching work can reduce or erase the benefit for a one-off operation. section 1.6
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 using the chef and many-workers analogy. section 1.6





