4 Replies Latest reply: Sep 11, 2013 4:04 AM by himanshu.gautam RSS

CL contexts doubts

bubu Novice
Currently Being Moderated

1. Can a context have devices from different platforms? Or is it restricted to an unique platform?

 

2. 1 context = 1 thread? Or can I call CL functions for a context from multiple threads? For instance: can I launch two kernels from the same context, one from threadA and the other from threadB.

 

thx

  • Re: CL contexts doubts
    nou Expert
    Currently Being Moderated

    1. no all devices in context must belongs to same platform.

    2. OpenCL calls are all thread safe. if you use different kernels then you can launch it from multiple threads. there is race condition in clSetKernelArg() so you must use mutexs or distinct kernels.

  • Re: CL contexts doubts
    himanshu.gautam Master
    Currently Being Moderated

    Hi Please go through the opencl spec 1.2 for more details.

    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: CL contexts doubts
      bubu Novice
      Currently Being Moderated

      I ask here cuz it's not really clear to me what spec 1.2 says

      • Re: CL contexts doubts
        himanshu.gautam Master
        Currently Being Moderated

        Ok not a problem. 1. You can not have devices from different platforms. All the devices should be from the same platform. 2. you can have as many kernels you want in a single context and can be launched with multiple threads. But you must be careful when the output of one kernel is input to the other.

        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