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 given dpctl.device_type and dpctl.backend_type values.

The function is analogous to sycl::devices::get_devices(), but with an additional functionality that allows filtering SYCL devices based on backend in addition to only device_type.

Parameters:
  • backend (optional) – A dpctl.backend_type enum value or a string that specifies a SYCL backend. Currently, accepted values are: “cuda”, “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 provided dpctl.backend_type and dpctl.device_type values.

Return type:

list