File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1950,9 +1950,7 @@ cdef class SyclDevice(_SyclDevice):
19501950
19511951 cdef int get_overall_ordinal(self ):
19521952 """ If this device is a root ``sycl::device``, returns the ordinal
1953- position of this device in the vector ``sycl::device::get_devices()``
1954- filtered to contain only devices with the same backend as this
1955- device.
1953+ position of this device in the vector ``sycl::device::get_devices()``.
19561954
19571955 Returns -1 if the device is a sub-device, or the device could not
19581956 be found in the vector.
@@ -2045,6 +2043,18 @@ cdef class SyclDevice(_SyclDevice):
20452043 else :
20462044 return str (relId)
20472045
2046+ def get_device_id (self ):
2047+ cdef int dev_id = - 1
2048+
2049+ if self .parent_device:
2050+ raise TypeError (" This SyclDevice is not a root device" )
2051+
2052+ dev_id = self .get_overall_ordinal()
2053+ if dev_id < 0 :
2054+ raise ValueError
2055+ return dev_id
2056+
2057+
20482058cdef api DPCTLSyclDeviceRef SyclDevice_GetDeviceRef(SyclDevice dev):
20492059 """
20502060 C-API function to get opaque device reference from
You can’t perform that action at this time.
0 commit comments