Can a cl_context include devices from different cl_platform_id?

Ok, I know that this question is not really relevant since we only have Nvidia OpenCL driver, but:

Assuming that the function clGetPlatformIDs returns more than one platform, is it possible to pass a list containing devices from both platforms to clCreateContext() in order to create a common cl_context?

I tried to find an answer in the OpenCL specifications but didn’t found any definitive answer. There are some passage in section 4.3 which makes me think it is not possible but I’m totally unsure.

Has anyone an answer to this?

I got an answer to this question on the Khronos OpenCL forum :)

The answer is:
All devices passed to clCreateContext must belong to the same platform.

edit: Initially I had written ‘device’ instead of 'platform’in the answer. I hope this clears it up.

In other words, TRUE Heterogeneous computing is NOT possible with the current version of OpenCL.

And one more, You cannot create an array of Device pointers (GPU pointers) on the device… i.e. clMem contents cannot hold pointers… FYI

I also got an answer to a similar question, so I will leave this here for further reference:

It is possible to create a context containing different device_types. But (see first question in this thread): all of them must belong to the same platform.


i’ve some problems with the vocabulary used in the OpenCL-Standart.
What exactly ist a platform?

Platform: The host plus a collection of devices managed by the OpenCL framework that allow
an application to share resources and execute kernels on devices in the platform.

This is taken form the doc. My computer has two graphic cards one Nvidia and one ATI.
Does ist mean i have two platforms, one with Nvidia Card and one with ATI Card? And in
future it is possible to use both cards together because OpenCL supports “heterogeneous”
collection of GPUs?


I think for ATI card you need to have driver supporting opencl…