GPU Programming

When a GPU performs element-wise addition of two large arrays (c[i] = a[i] + b[i]), what mainly determines performance?

  1. AMemory bandwidth (12 bytes are read and written per element for just one addition)
  2. BThe number of arithmetic units
  3. CClock frequency alone
Show answer and explanation

Answer: A. Memory bandwidth (12 bytes are read and written per element for just one addition)

Each float addition reads 4 bytes each from a and b and writes 4 bytes to c, so there is one operation per 12 bytes moved. Memory bandwidth is far lower than a GPU's arithmetic throughput, so this kernel is capped by bandwidth. Speeding up such work means reducing memory traffic, for example by fusing operations so intermediate results are never written to memory.

  • A. Correct. Its low arithmetic intensity makes it memory-bound.
  • B. The arithmetic units spend most of their time waiting.
  • C. Raising frequency does not help memory keep up.