GPU Programming
In a program using a discrete GPU, what is generally true about CPU-side and GPU-side memory?
- AThey are separate memories, so data is copied to the GPU before computing and results are copied back afterward
- BThey are the same memory, so no copying is ever needed
- CThe GPU cannot store results
Show answer and explanation
Answer: A. They are separate memories, so data is copied to the GPU before computing and results are copied back afterward
A discrete GPU has dedicated GDDR or HBM memory on its board, connected to CPU memory over PCI Express or similar. The basic flow is to copy data from CPU memory to GPU memory, launch the kernel, and copy the results back to CPU memory afterward. The time for these copies often determines overall performance.
- A. Correct. Copies are done with cudaMemcpy or similar.
- B. A discrete GPU has its own dedicated memory.
- C. Results are written to GPU memory.