@@ -31,6 +31,7 @@ from ._backend cimport ( # noqa: E211
3131 DPCTLCPUSelector_Create,
3232 DPCTLDefaultSelector_Create,
3333 DPCTLDevice_CreateFromSelector,
34+ DPCTLDeviceMgr_GetCompositeDevices,
3435 DPCTLDeviceMgr_GetDevices,
3536 DPCTLDeviceMgr_GetNumDevices,
3637 DPCTLDeviceSelector_Delete,
@@ -62,6 +63,7 @@ __all__ = [
6263 " has_gpu_devices" ,
6364 " has_accelerator_devices" ,
6465 " _cached_default_device" ,
66+ " get_composite_devices" ,
6567]
6668
6769
@@ -202,6 +204,32 @@ cpdef list get_devices(backend=backend_type.all, device_type=device_type_t.all):
202204 return devices
203205
204206
207+ cpdef list get_composite_devices():
208+ """
209+ Returns a list of the available composite :class:`dpctl.SyclDevice`
210+ instances.
211+
212+ Only available when `ZE_FLAT_DEVICE_HIERARCHY=COMBINED` is set in
213+ the environment, and only for specific Level Zero devices
214+ (i.e., those which expose multiple tiles as root devices).
215+
216+ For more information, see:
217+ https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_composite_device.asciidoc
218+
219+ Returns:
220+ list:
221+ A list of available composite :class:`dpctl.SyclDevice` instances.
222+ """
223+ cdef DPCTLDeviceVectorRef DVRef = NULL
224+ cdef list composite_devices
225+
226+ DVRef = DPCTLDeviceMgr_GetCompositeDevices()
227+ composite_devices = _get_devices(DVRef)
228+ DPCTLDeviceVector_Delete(DVRef)
229+
230+ return composite_devices
231+
232+
205233cpdef int get_num_devices(
206234 backend = backend_type.all, device_type = device_type_t.all
207235):
0 commit comments