You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DPCLTDeviceMgr_GetDevices should not rely of the cached unordered map
of root sycl devices to sycl contexts. Because unordered map can change
the ordering.
Changed implementation to iterate over device::get_devices instead.
Confirmation of the fix:
```
In [1]: import dpctl
In [2]: d0 = dpctl.SyclDevice("gpu:0")
In [3]: d0.filter_string
Out[3]: 'opencl:gpu:0'
In [4]: [i for i, di in enumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) if di == d0]
Out[4]: [0]
In [5]: d0 == dpctl.SyclDevice(d0.filter_string)
Out[5]: True
In [6]: d1 = dpctl.SyclDevice("gpu:1")
In [7]: d1.filter_string
Out[7]: 'level_zero:gpu:0'
In [8]: [i for i, di in enumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) if di == d1]
Out[8]: [1]
In [9]: d1 == dpctl.SyclDevice(d1.filter_string)
Out[9]: True
```
0 commit comments