GPU Programming
What can happen if a GPU kernel uses too many registers per thread?
- ARegisters grow automatically and performance always improves
- BResults are always wrong
- CEach SM has a fixed register file, so fewer threads fit at once and memory latency becomes harder to hide
Show answer and explanation
Answer: C. Each SM has a fixed register file, so fewer threads fit at once and memory latency becomes harder to hide
GPUs keep the registers of every active thread on chip so that switching warps is instantaneous. So if each thread uses many registers, fewer threads fit on an SM at once. Registers that do not fit are spilled to memory, which can also slow things down. Compiler options can cap register usage to balance it against thread count.
- A. The total register count is fixed in hardware.
- B. Results remain correct; speed is affected.
- C. Correct. Registers are one of the resources limiting thread count.