Re: Pinned Memory
Posted by
Michael Bien on
Mar 16, 2012; 11:13pm
URL: https://forum.jogamp.org/Pinned-Memory-tp3832295p3833459.html
Hello Matthias,
i translated the demo from the nv samples (or AMD sample?) in the
early stages of jocl development to have something to test the
binding and compare the results to the C version (there where not
many samples out there before the spec was final ;) ). It is
probably best to take a look at the original C sample. It wasn't a
line-by-line port, so its possible that i made some translation
mistakes back than.
best regards,
michael
On 03/16/2012 05:04 PM, Matthias [via jogamp] wrote:
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?
I am a bite confused now.
best regards
Matthias
--
- - - -
http://michael-bien.com