GPU Programming
What is a characteristic of CUDA shared memory?
- AA large main memory shared by all GPUs and the CPU
- BAn area where GPU memory is shared with the hard disk
- CA small, fast on-chip memory shared by threads of the same block and managed explicitly by the program
Show answer and explanation
Answer: C. A small, fast on-chip memory shared by threads of the same block and managed explicitly by the program
Shared memory is fast memory inside each SM, typically tens of KB per block, and can be read and written many times faster than global memory (the GPU's DRAM). Threads in the same block can place and share data in it, so it is used to load data from global memory once and reuse it many times, or to pass intermediate results between threads. Unlike a cache, the program decides what goes there.
- A. That is closer to global or unified memory.
- B. It has nothing to do with disks.
- C. Correct. It acts like a program-managed cache.