dpctl.get_devices¶
- dpctl.get_devices(backend=backend_type.all, device_type=device_type.all)¶
Returns a list of
dpctl.SyclDeviceinstances selected based on the givendpctl.device_typeanddpctl.backend_typevalues.The function is analogous to
sycl::devices::get_devices(), but with an additional functionality that allows filtering SYCL devices based onbackendin addition to onlydevice_type.- Parameters:
backend (str,
dpctl.backend_type, optional) – Adpctl.backend_typeenum 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 (str,
dpctl.device_type, optional) – Adpctl.device_typeenum value or a string that specifies a SYCL device type. Currently, accepted values are: “gpu”, “cpu”, “accelerator”, or “all”. Default:dpctl.device_type.all.
- Returns:
A list of available
dpctl.SyclDeviceinstances that satisfy the provideddpctl.backend_typeanddpctl.device_typevalues.- Return type: