Friday, February 17, 2012

CUDA: Accessing pinned/pagelocked memory from different threads

Some time ago I asked the question here:
http://forums.nvidia.com/index.php?showtopic=201193

on how to access pinned or pagelocked memory from two threads in the same program.

The key is to allocate with the portable attribute.
Look at:
Nvidia Doxygen 4.0 cudaHostAlloc

for details.

Even more elegant is however, to register the memory only if you need it:
See details about  cudaHostRegister cudaHostRegister cudaHostUnregister at:
Nvidia Doxygen 4.0 cudaHostRegister

1 comment: