Results 1 to 2 of 2

Thread: CL_MEM_ALLOC_HOST_PTR and 'ordinary' buffer reads/writes

  1. #1
    Junior Member
    Join Date
    Dec 2013

    CL_MEM_ALLOC_HOST_PTR and 'ordinary' buffer reads/writes


    Consider a buffer created with the CL_MEM_ALLOC_HOST_PTR. Is it valid to use clEnqueueReadBuffer / clEnqueueWriteBuffer with that buffer if the buffer is not mapped, or is that invalid and reads/writes have _always_ go through enqueueMapBuffer / enqueueUnmapMemObject?

    Further, i suppose a enqueueCopyBuffer is ok given the buffer is unmapped?

    thanks !

  2. #2
    Senior Member
    Join Date
    Dec 2011
    You can use clEnqueueReadBuffer / clEnqueueWriteBuffer with a buffer allocated that way, or you could use clEnqueueMapBuffer / clEnqueueUnmapMemObject. In fact, you can you either method with buffers *not* using the CL_MEM_ALLOC_HOST_PTR flag. However, the performance characteristics may be different depending on which flags you use. Check the vendor optimization guides. And yes, you can use clEnqueueCopyBuffer when the buffer is not mapped.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean