GPU Programming
Sending data to a GPU for light work such as adding array elements once can be slower than computing on the CPU. What is the main reason?
- AGPUs cannot add
- BThe time to copy data over PCI Express exceeds the computation time the GPU saves
- CSending data to the GPU changes its values
Show answer and explanation
Answer: B. The time to copy data over PCI Express exceeds the computation time the GPU saves
PCI Express bandwidth is more than ten times lower than GPU memory bandwidth, so just sending the data takes time. With only one addition per element, the computation is tiny compared with the transfer, and the GPU's speed cannot be exploited. GPUs pay off when much computation is done per transferred byte, or when data stays in GPU memory across many processing steps.
- A. GPUs are excellent at addition.
- B. Correct. There is too little computation for the transfer.
- C. Values do not change.