CPU vs. GPU

Sections in this chapter

1. Overview

CPU and GPU are both processors in the sense of the processor architecture chapter – both consist of a control unit, execution units, registers, and a cache hierarchy, connected via a bus. The decisive difference lies in their objective: the CPU (Central Processing Unit) is designed to work through a few, often interdependent tasks sequentially as fast as possible. The GPU (Graphics Processing Unit) is designed to process very many similar, independent tasks simultaneously. Both approaches make sense – just for different kinds of problems.

2. Architectural Difference

A CPU typically has only a few cores (currently around 4 to 16 in consumer hardware), but each individual core is highly complex: sophisticated control logic, deep pipelining, branch prediction, and out-of-order execution (instructions are not necessarily executed in program order, but as soon as their data is ready), to achieve high per-core speed even for complex, branch-heavy programs.

A GPU takes the opposite approach: instead of a few complex cores, it contains hundreds to thousands of simple, heavily stripped-down cores. These operate on the SIMT principle (Single Instruction, Multiple Threads) – the same instruction is applied simultaneously to many different data elements, for example to every pixel in an image region or every entry in a matrix. A single GPU core is considerably slower and less flexible than a CPU core – its strength lies in sheer numbers.

Die diagram comparing a CPU with few large cores and a large cache to a GPU with many small cores and a small cache, at equal die area

Continue reading

The remaining sections of this chapter are part of our one-time access. Unlock all knowledge chapters and every PDF download.

1,99 € one time · no subscription

Unlock all content

Already purchased? Restore access