The opencl information is useless for determining which card is which. Furthermore if you have 2 monitors connected to a single GPU, it will come up as 2 unique opencl devices.
Then motherboards decide to order cards backwards sometimes with the pci bus id order being the opposite of the device order we end up getting.
Some motherboards do not order their PCIE lanes in numerical order as well, with lanes going 1,3,2 or other randomness.
Then the ATI Display Library gives unique adapter ID information that has absolutely nothing in common with the opencl devices.
The ADL will also give you one for each device, including the ones that don't have OpenCL support so if you have a card that can't mine in your setup, the number of devices cannot match.
There are also unique "thermal devices" in the ADL which had the opportunity to designate GPU 0 and GPU 1 in shared devices (like 6990) but instead they simply come up as unique devices.
Shared GPUs in single cards also do not have a single identifying feature whatsoever to say they're on the same card.
Then of course, windows does something different to linux, and osx doesnt even have an ADL.
All I can do is enumerate them in the order they appear and *hope* they align.
Then I use surrogate markers with circumstantial evidence that the GPUs are on the same card.
As far as I'm concerned, getting any of these bastards behaving in concert is somewhat of a miracle.
All in all it's a mindfuck of epic proportions.