create context from list of devices with different types?

Assume that clGetDeviceIDs(…, some_platform, …) returns a list of devices from different device type (e.g. GPU and CPU):

Is it allowed/possible to create a context from these devices?

You can use any combination of devices that are returned by clGetDeviceIDs to create a CL context.

For example, clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, …) will return all CL devices in the system supported by a particular platform. This may include CPUs and GPUs (from the same or different vendors) depending on what your CL implementation supports.

You can pass these devices (CPUs, GPUs, or other CL devices returned by clGetDeviceIDs) to <devices> argument in clCreateContext. And all these devices can then be used to enqueue work. CL allows heterogenous devices to be used together in a CL context. The decision, however, falls upon the implementation as to what devices it will allow.

Thank you very much for your reply!

As I already pointed out in my last two posts, I think that the documentation could be improved whenever it comes to “what is allowed and what not?” (e.g. different device_types in a context, different platforms in a context, min/max number of contexts per device and so on).