1 Reply Latest reply on Mar 5, 2010 10:54 PM by genaganna

    Mapping/copy/unmapping - some sync needed?

    Raistmer
      I do host buffer (pinned memory) unmapping, copy values from GPU memory to buffer, then map buffer again and use it in host code. This happens in loop.
      Question is - should I use wait on events, clFinish() between commands or some other form of synching or these commands (clEnqueueUnmapMemObject,clEnqueueCopyBuffer,clEnqueueMapBuffer) or they will be executed in order and will wait each other completion just because they placed in appropriate order in queue (as one kernel call will wait before earlier kernel finishes) ?
        • Mapping/copy/unmapping - some sync needed?
          genaganna

           

          Originally posted by: Raistmer I do host buffer (pinned memory) unmapping, copy values from GPU memory to buffer, then map buffer again and use it in host code. This happens in loop. Question is - should I use wait on events, clFinish() between commands or some other form of synching or these commands (clEnqueueUnmapMemObject,clEnqueueCopyBuffer,clEnqueueMapBuffer) or they will be executed in order and will wait each other completion just because they placed in appropriate order in queue (as one kernel call will wait before earlier kernel finishes) ?


          Before using mapped pointer, you should wait to complete Map command. you can use clFinish or events returned by clEnqueueMapBuffer or use blocking call of clEnqueueMapBuffer.

          All commands will be executed in order as FIFO if command properties is not CL_QUEUE_OUT_OF_ORDER_EXEC_
          MODE_ENABLE.