Limits/recommandations for number of contexts/queues?

When I understand the OpenCl specs correctly, it is possible to:

  • assign one card to several devices
  • create more than one command queue for a given device/context combination

Is there an official minimum number of devices/queues which can be created for a single device/context?

Not that I want to create dozens of contexts on a single device, but it would be helpful to get some recommendation (Although I guess this heavily depends on the type of the device).

sorry, it should be

  • assign one card to several contexts

The details will depend on the vendor implementation, but in general you should assume that both contexts and queues take up resources, so you should not create too many of them. Contexts should be used for grouping devices that need to share data, and queues should be used for submitting work to devices. In general, queues should be cheaper than contexts, but it all depends on the implementation.