Is GPGPU.DeviceId unique?

Jun 15, 2014 at 8:30 AM
Edited Jun 15, 2014 at 8:55 AM
I need to obtain a dictionary of all devices (GPGPU instances) on the machine, but never get two instances refering to the same GPU.

For example, I have a notebook with NVidia GPU (supports CUDA and OpenCL) and Intel GPU. Hence I get three GPGPU instances (NVidia-CUDA, NVidia-OpenCL, Intel-OpenCL).

Now I would like to distinguish the two NVidia's devices and prefer CUDA over OpenCL. So I should end up with just two entries: (NVidia-CUDA, Intel-OpenCL).
Jun 16, 2014 at 1:02 AM
Okay I have figured this out.

The DeviceId property is simply a device index, both the first listed CUDA and OpenCL devices have DeviceID = 0 so it is not unique.

I made a unique ID rather this way:
id = ((int)gpuType << 16) + gpgpu.DeviceId
where gpuType is corresponding eGPUType.

The hardware-specific ID that is most probably the PciBusID property obtained using GPGPU.GetDeviceProperties().
Marked as answer by ImagingShop on 6/15/2014 at 6:02 PM