liveBook · Manning

SIMD hardware

As explained in Grokking GPU Programming

A SIMD/AVX unit is processor hardware that applies one vector instruction to multiple data elements at once.

A SIMD unit applies one instruction to several data values at once. On a CPU, SIMD/AVX can speed up a loop that doubles an array, compared with processing one value at a time. This makes the simple scalar step count an imperfect measure of CPU performance. section 1.4

GPU execution offers a related but different model: SIMT. You write an instruction for one thread, and the hardware runs a warp of 32 threads on different data. Unlike explicit SIMD, you do not write special instructions for a group of values; threads that take different paths can leave lanes idle. section 14.1

Doubling an array

A scalar CPU loop doubles 1,000 values one at a time. A CPU vectorized loop handles several values per instruction, while a GPU assigns a thread to each value and schedules those threads in warps. section 1.4 section 14.1

How Grokking GPU Programming covers it

How deep it goes
Defines SIMD through vectorized work and contrasts it with SIMT, without detailing SIMD instruction mechanics.
Examples
Uses doubling a 1,000-element array to compare scalar CPU work, vectorized CPU work, and GPU threads.
What it assumes
Builds the comparison from a sequential single-core loop that processes array elements one at a time.
What you can do after
Understand how CPU SIMD vectorization differs from GPU SIMT execution.
How it connects
Connects SIMD to CPU vectorization and contrasts it with SIMT, GPU threads, and warps.

Also explained in

Compare how 2 books explain SIMD hardware →

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.