dpctl.get_devices¶
- dpctl.get_devices(backend=backend_type.all, device_type=device_type.all)¶
Returns a list of
dpctl.SyclDevice
instances selected based on the givendpctl.device_type
anddpctl.backend_type
values.The function is analogous to
sycl::devices::get_devices()
, but with an additional functionality that allows filtering SYCL devices based onbackend
in addition to onlydevice_type
.- Parameters:
backend (optional) – A
dpctl.backend_type
enum value or a string that specifies a SYCL backend. Currently, accepted values are: “cuda”, “hip”, “opencl”, “level_zero”, or “all”. Default:dpctl.backend_type.all
.device_type (optional) – A
dpctl.device_type
enum value or a string that specifies a SYCL device type. Currently, accepted values are: “gpu”, “cpu”, “accelerator”, “host”, or “all”. Default:dpctl.device_type.all
.
- Returns:
A list of available
dpctl.SyclDevice
instances that satisfy the provideddpctl.backend_type
anddpctl.device_type
values.- Return type: