Pinned Memory
Posted by Matthias on Mar 16, 2012; 4:04pm
URL: https://forum.jogamp.org/Pinned-Memory-tp3832295.html
Hello,
i have a question related to pinned memory / mapping buffers.
The jocl-demo bandwidth source code is as follows:
// unmap and make data in the host buffer valid
queue.putUnmapMemory(cmPinnedData, h_data);
according to the OpenCL Spec and the Nvidia examples its not necessary to unmap the buffer before copy it to the device and use it.
and later before performance measurement you remap it:
h_data = queue.putMapBuffer(cmPinnedData, WRITE, true);
... assuming that the pinned data is mapped again to the same virtual address (in underlying c code)?
Is it guaranteed that the data is still "there", i thougt there is DMA used and the data is not stored in your memory, or is just the OpenCL buffer Object stored in the DMA region and some copy magic happens within the driver?
I am a bite confused now.
best regards
Matthias