Are device ids unique?

Are the device ids returned by clGetDeviceIDs unique in respect to the platform used in clGetDeviceIDs or unique for all platforms? I.e. may there be an AMD device with the same device id as a NVIDIA device in one PC or not?
If the later is true, why may one specify a platform in clCreateContext?
If they are only unique in respect to the platform, why it is not possible to specify a platform in clGetDeviceInfo?

I don’t think it is required to have unique id’s for device. each device is associated with platform because you will get device id’s from platform information.

It is not possible to create context for devices associated with different platforms.

But assuming I have an ATI device and a NVIDIA device with the same cl_device_id (but different cl_platform_ids). How can I query infos on this device, as clGetDeviceInfo only has the device id as parameter and not the platform id?

cl_device_id is a handle to the device, so yes, I think they’d need to be unique. Take a look at the include/CL/cl.h header in your CUDA toolkit folder.