Results 1 to 2 of 2

Thread: multiple kernel for single device(1 gpu)

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    22

    multiple kernel for single device(1 gpu)

    Hi,
    my code need to run multiple kernel repeatedly, in order. what I did was,
    1.
    when clCreateCommandQueue, I set 'cl_command_queue_properties properties' as '0', or 'CL_QUEUE_PROFILING_ENABLE ' if need to do the timing.
    2.
    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
    Location
    Northern Europe
    Posts
    311

    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, 05:38 AM
  2. Replies: 3
    Last Post: 12-21-2009, 09: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
  •