2 Replies Latest reply: Sep 26, 2013 11:00 PM by himanshu.gautam RSS

OpenCL equivalent for CUDA stream 0

cgorac Newbie
Currently Being Moderated

Am porting some CUDA code to OpenCL, with implicit dependencies of CUDA special stream 0 (basically, any command put in stream 0, except for kernel launch, is executed synchronously w.r.t. host code execution); so I'm wondering: is there a "default" command queue in OpenCL with same characteristics?  Or I should create another command queue for this purpose, and then just call clFinish() after each command put into this queue?

 

Thanks.

  • Re: OpenCL equivalent for CUDA stream 0
    himanshu.gautam Master
    Currently Being Moderated

    Hi, There is no defualt command queue in OpenCL. You have to create command queue at the host side with the options in-order or out of order exeuction. by default all the commands will exeute in -order. But they execute asynchronously between host and the device.

    Please check OpenCL spec for more information.

    Regards

    Himanshu , Bruhaspati

    --------------------------------

    The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied

  • Re: OpenCL equivalent for CUDA stream 0
    himanshu.gautam Master
    Currently Being Moderated

    btw... What do you mean  by "will execute synchronously" with the code.

     

    CUDA Streams will keep executing on device... And when you say "cudaThreadSynchronize()" - you synch with the device. I dont think Stream0 is any special...

    May be, for other non-zero streams you require cudaStreamSychronize()? and for 0 you can use "cudaThreadSynchronize"... Is that what you mean?

     

    You can use "clFinish(comm_Q)" which will tbe effect of calling "cudaStreamSynchronize(stream#)"

    Thats straightforward enough..

     

    Please explain your problem in detaill.. .We will give you the solution..

     

    Best REgards,

    Bruhaspati

    Regards

    Himanshu , Bruhaspati

    --------------------------------

    The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied

More Like This

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points