2 Replies Latest reply on Oct 18, 2011 12:42 PM by evk8888

    clGetDeviceIDs

    evk8888
      Regarding the "device_type" parameter in this call.

      hi guys,

       

      Usually the device_type is set by the user stating one of the following bit fields. CL_DEVICE_TYPE_CPU CL_DEVICE_TYPE_GPU CL_DEVICE_TYPE_ACCELERATOR

      CL_DEVICE_TYPE_DEFAULT and CL_DEVICE_TYPE_ALL 

      This has to be mentioned by the user as a command line arg or in the code itself (for GPU or CPU so on).  is thr anyway tht the OpenCL runtime by itself identifies the available systems? like stating there is a CPU and a GPU and we can create a context and queues based on wat we want.

       

      Thanks

      evk

        • clGetDeviceIDs
          antzrhere

          I'm not sure what your asking, but if it's whether OpenCL can automatically create command queues for every available device, then I don't think so. Otherwise you would have no idea what is going on and would be very unflexible.

          You would simply get a list of all deviceIDs with CL_DEVICE_TYPE_ALL (assuming you want both CPU and GPUs, otherwise state the relevant device type), create a shared context for them and then go through every device and create a command queue for each one. Its no more than a couple of lines of code.