CPU vs GPU: Differences in Architecture and Use
A CPU is built to finish one task as fast as possible, so it has a few powerful cores with large caches and smart control logic. A GPU is built to finish many similar tasks at once, so it has thousands of simple arithmetic units and hides memory delays by switching between huge numbers of threads. CPUs are good at complex, branching, serial work; GPUs are good at massively parallel math such as graphics and deep learning.
| Aspect | CPU | GPU |
|---|---|---|
| Design goal | Low latency: finish a single thread as fast as possible | High throughput: finish as much total work as possible |
| Core count | A few to a few hundred complex cores | Thousands of simple arithmetic units, grouped into larger blocks |
| Execution model | Out-of-order execution and branch prediction in each core, plus SIMD instructions | SIMT: groups of threads (for example 32) run the same instruction together |
| Control logic and cache | Large caches and sophisticated control logic take much of the chip area | More area goes to arithmetic units; caches are smaller per thread |
| Hiding memory latency | Mostly with caches and prefetching | Mostly by switching to other ready threads while one waits |
| Memory | DDR or LPDDR, typically tens to a few hundred GB/s of bandwidth | GDDR or HBM, typically hundreds of GB/s to several TB/s of bandwidth |
| Branching | Handles branches and irregular code well | Slows down when threads in a group take different branches (divergence) |
| Data location | Works directly on main memory | A discrete GPU has its own memory, so data must be copied over a bus such as PCIe |
| Programming | Almost any language and tool | Specialized models such as CUDA, HIP, OpenCL and graphics shader languages |
| Typical workloads | Operating systems, databases, control logic, general applications | Graphics, matrix and vector math, deep learning, simulation |
Figures are typical orders of magnitude and vary by process generation and product.