Hi forum

It has been mentioned that mem copy operations to/from pinned memory is much faster than paged memory.

Does this apply to even shared memories created from OpenGL ?

In which scenario we need to issue the following command :

Code :
cl_mem sharedBuffer = clCreateFromGLBuffer(context, CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, glId, &errNum);

The most time consuming memory operation is between host memory and device memory. With the help of the pinned memory we do the write operation to the device buffer from the host buffer in the following buffer:

1. Create a normal paged buffer.
2. Create another buffer - the pinned buffer.
3. Map the pinned buffer to the pinned host pointer.
4. Copy the host contents to the pinned host pointer.
5. Unmap the pinned host pointer.
6. Copy from the pinned buffer to the normal paged buffer.


Is that the similar path i should be following when allocating memory from the OpenGL objects ?


Regards
Sajjad