Login  Register

Re: How to queue in a multidevice environment

Posted by Wade Walker on Mar 12, 2017; 1:07am
URL: https://forum.jogamp.org/How-to-queue-in-a-multidevice-environment-tp4037674p4037769.html

Hi Arnold,

I think at this point you've gone beyond my understanding of CLMultiContext -- since I'm not the original author, I don't have that knowledge at my fingertips, I'd have to look it up in the code the same as you :)

In general, distributing tasks over devices is difficult, unless you know in advance the sizes of the tasks and the relative speeds of your CPU and GPU. To get a good balance across devices, people often do dynamic dispatching, where they don't do a static schedule ahead of time, but instead dispatch jobs to devices at runtime depending on the current utilization of each device and the expected size of each job.

People who are very concerned with fine-grained load balancing across multiple devices (for example in the high-performance computing arena) might explore task-based programming (for example OpenMP tasks), which allow you to specify dependencies between tasks, then let the runtime choose which ones get run where. I'm not sure OpenCL has such a facility, but you could write something like it based on OpenCL if you were so inclined :)