Results 1 to 2 of 2

Thread: multiple kernel for single device(1 gpu)

  1. #1
    Junior Member
    Join Date
    Dec 2009

    multiple kernel for single device(1 gpu)

    my code need to run multiple kernel repeatedly, in order. what I did was,
    when clCreateCommandQueue, I set 'cl_command_queue_properties properties' as '0', or 'CL_QUEUE_PROFILING_ENABLE ' if need to do the timing.
    and then between each 'clEnqueueNDRangeKernel' or 'clEnqueueReadBuffer', I used 'clEnqueueBarrier(commandqueue)' to do the barrier.

    but I have strange problem that I think it should be related to kernel not executed in order.

    Is there anything I am missing here? Thank you very much.

    btw, I create one context, one program, one commandqueue, and many different kernels for the same program, and run on 1 gpu.

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Northern Europe

    Re: multiple kernel for single device(1 gpu)

    I would suggest using events to accomplish this. The barrier will make sure all the executions of one iteration are all finished, but not ensure that they happen in-order. (Of course GPUs today are all in-order so it shouldn't matter.)

Similar Threads

  1. Replies: 5
    Last Post: 02-06-2011, 04:38 AM
  2. Replies: 3
    Last Post: 12-21-2009, 08:37 AM

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