cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

richeek_arya
Journeyman III

Difference between mapping and copying

Hi all,

I have a conceptual question regarding reading the data back from the GPU to host. Can I use clEnqueueReadBuffer() or clEnqueueMapBuffer() interchangeably? Which one is better? I read about both of them but  I am confused about the difference between mapping and copying?

Also when we create buffer usign clCreateBuffer we have different flag options. For CL_MEM_USE_HOST_PTR table 4.3 of AMD OpenCL programming guide mentions:

------ Location ------ ------- Map Mode------ ------Map Location---
----Device Memory---- ----Copy---- ---- Pinned Host Memory---


Could anyone please explain the significance of Map Location here? Can I use any of the clEnqueueReadBuffer() or clEnqueueMapBuffer() here to read the data back?

I appreciate any help.

 

Richeek

 

0 Likes
3 Replies
richeek_arya
Journeyman III

Can someone please answer this one too! I have invested lot of time thinking about it but to no avail

0 Likes
maximmoroz
Journeyman III

Check section "4.5 OpenCL Data Transfer Optimization" of the latest Programming Guide.

0 Likes

Yes, section 4.5 should give you the better understanding of the pinned host memory.

And you can use any of the clEnqueueReadBuffer or clEnqueueMapBuffer to read data back from a buffer created using CL_MEM_USE_HOST_PTR.

0 Likes