GPU Programming

Which describes a bank conflict in CUDA shared memory?

  1. ATwo GPUs using the same bank account
  2. BRunning out of shared memory capacity so the program stops
  3. CShared memory is split into 32 banks, and when several threads of a warp access different addresses in the same bank at once, the accesses are serialized
Show answer and explanation

Answer: C. Shared memory is split into 32 banks, and when several threads of a warp access different addresses in the same bank at once, the accesses are serialized

Shared memory consists of 32 banks assigned in rotation every 4 bytes, and each bank can serve only one address per access. If the 32 threads of a warp use different banks, one access suffices, but two threads hitting different addresses in the same bank split it into two. Reading every 32nd element, for example, piles all threads onto one bank and splits the access into 32. When all threads read the same address, it is broadcast and there is no conflict.

  • A. It is not about money.
  • B. It is not a capacity problem.
  • C. Correct. The same address is broadcast and causes no conflict.
Practice this topic Back to topic

More GPU Programming questions

  1. A 32 × 32 float tile in shared memory causes bank conflicts when a warp's 32 threads read down a column. What is the common fix?
  2. When multiplying large matrices on a GPU, why are the matrices split into small tiles loaded into shared memory?
  3. What can happen if a GPU kernel uses too many registers per thread?
  4. Which describes occupancy on a GPU?
  5. What is the main way a GPU hides long memory latency (hundreds of cycles)?