问题
I have been doing some experiments regarding measuring the latency of data transfer from CPU->GPU and GPU->CPU. I found that CPU->GPU data transfer rate is almost twice as much compared to GPU->CPU transfer rate for a particular message size. Can anybody explain me why this is so?
回答1:
Since don't know the detail about your experiment, like what's CPU/GPU used, how to measure transfer rate, I just guess that, data transfer from CPU->GPU, normally is through DMA. each time it can transfer a block bytes from system memory to graphic memory. But data transfer from GPU->CPU, normally CPU is to read the graphic aperture memory which is mapped by PCI bus. CPU only can read the aperture memory in un-cacheable, strict order byte by byte, so it is slow.
来源:https://stackoverflow.com/questions/13032554/cpu-gpu-transfer-vs-gpu-cpu-transfer