0PricingLogin
CUDA Academy · Lesson

Device-to-Host Transfers

Downloading results back to the CPU.

Bringing Results Home

Your kernel just filled a device buffer with answers, but the CPU cannot read GPU memory directly. You must download the results back. 📥

The Download Direction

To pull data back you use cudaMemcpyDeviceToHost. Now the source is device memory and the destination is host RAM.

cudaMemcpy(h_c, d_c, bytes, cudaMemcpyDeviceToHost);

All lessons in this course

  1. Host-to-Device Transfers
  2. Device-to-Host Transfers
  3. The Copy Direction Enum
  4. The PCIe Transfer Bottleneck
← Back to CUDA Academy