Results 1 to 2 of 2

Thread: performance diff clEnqueueWriteBuffer vs clEnqueueMapBuffer

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    20

    performance diff clEnqueueWriteBuffer vs clEnqueueMapBuffer

    Hi.

    Sorry for using shorthands in the topic title. The textbox seems to have a length limit.

    I have a buffer object, whose data contents are modified across kernel invocations(this memory object is sent as an argument to the kernel for every invocation).

    In this case, is it more efficient to transfer data to this memory object using clEnqueueueWriteBuffer() or instead map the memory object to the host address space using clEnqueueMapBuffer() and then to this mapped region? Will there be an overhead of mapping and unmapping the buffer object when clEnqueueMapBuffer() is called multiple times, when compared to clEnqueueWriteBuffer()?

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: performance diff clEnqueueWriteBuffer vs clEnqueueMapBuffer

    The specific performance implementations will depend a lot on the device you are using (CPU vs. GPU) and the particular implementation. For example, if you are using a CPU device you may be able to avoid a lot of data copying by using map/unmap. If you are on a GPU you may avoid some copying, but you may have a much higher overhead of transfers over the PCIe bus, so small copies may take longer. I'm afraid you'll have to experiment to see which goes fastest with your particular devices and data sizes. (Remember that small copies will always have a large overhead if the data needs to move from the device.)

Similar Threads

  1. clEnqueueMapBuffer in discrete systems
    By Cadorino in forum OpenCL
    Replies: 2
    Last Post: 02-01-2012, 04:16 AM
  2. Specification 1.0 to 1.1 diff
    By matrem in forum Suggestions for next release
    Replies: 7
    Last Post: 06-29-2010, 03:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •