3 ms·
You share the same pointers between CPU and GPU. Pointers in structures for example are one of the use cases. Also as an even more unique option, see cudaHostR
by my123 5y ago
You share the same pointers between CPU and GPU. Pointers in structures for example are one of the use cases.
Also as an even more unique option, see cudaHostRegister (on CUDA) to make a CPU buffer not allocated through CUDA accessible from the GPU without a copy, at the same address[1]. This isn’t especially high performance because you have to go through the PCIe bus (on Tegra, this mechanism is even more attractive), it’s however very useful.
Your address space is unified between CPU and GPU, with the same pointers used between both.
[1] at the same address for host allocations registered through that mechanism is only there on recent GPUs. Allocations done through CUDA still share the same address on both worlds on GPUs where this is unsupported.