GPU Programming
Which describes a bank conflict in CUDA shared memory?
- ATwo GPUs using the same bank account
- BRunning out of shared memory capacity so the program stops
- 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.