I've been starting out with OpenCL, and I've been wanting to create a cl::Context with multiple devices. While looking into the OpenCL 1.2 C++ Wrapper Api Specifications, I found this constructor for cl::Context:
The constructor
cl::Context::Context(VECTOR_CLASS<Device>& devices, cl_context_properties * properties = NULL, void (CL_CALLBACK * pfn_notify)( const char * errorinfo, const void * private_info, ::size_t cb, void * user_data) = NULL, void * user_data = NULL, cl_int * err = NULL)
creates an OpenCL context.
devices is a pointer to a vector of unique devices returned by cl::Platform::getDevices. If more than one device is specified, a selection criteria may be applied to determine if the list of devices specified can be used together to create a context.
...
My questions are: What are the "criteria" applied by the OpenCL implementation? How should I guarantee that the list of devices I pass in are compatible? What devices are compatible (ie do they have to be the same device type or something?) And do they have to be from the same platform/vendor (it is kind of implied by "unique devices returned by cl::Platform::getDevices")?
The constructor would set the errcode to CL_INVALID_DEVICE if devices contains an invalid device.