liveBook · Manning

Hardware register

As explained in Grokking GPU Programming

A GPU register is a tiny, fast storage location private to an individual thread.

A GPU register is a tiny, fast storage spot for one thread’s own variables—like a sticky note on a desk. Registers are private to that thread, unlike shared memory, which threads in a block can access, or global memory, which threads across the grid can reach. section 3.6

When registers limit occupancy

Suppose a block has 256 threads and each uses 48 registers. That block needs 12,288 registers; with 65,536 registers available per SM, five whole blocks fit. This limits residency to 40 warps, or 62.5% occupancy, even though shared memory and the block limit would allow more. Forcing a higher occupancy can cap registers per thread, but variables that no longer fit may spill to slow local memory. Profile configurations rather than assuming maximum occupancy is fastest. section 14.8 section 14.11

How Grokking GPU Programming covers it

How deep it goes
Defines private per-thread storage, calculates allocation limits, and warns about spilling while treating hardware allocation as an approximation.
Examples
Calculates residency for a 256-thread block using 48 registers per thread and shows how register caps can cause spilling.
What it assumes
Assumes familiarity with CUDA kernels, threads, and warps while introducing register storage through an everyday analogy.
What you can do after
Diagnose occupancy trade-offs by calculating register-limited residency and profiling configurations.
How it connects
Connects registers with CUDA threads, warps, occupancy, shared memory, and local-memory spilling.

Also explained in

Compare how 9 books explain hardware register →

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.