dpctl.SyclDevice.get_filter_string¶
- SyclDevice.get_filter_string(include_backend=True, include_device_type=True)¶
For a parent device, returns a filter selector string that includes backend or device type based on the value of the given keyword arguments.
- Parameters:
- Returns:
A Python string representing a filter selector string.
- Return type:
- Raises:
ValueError – If the device is a sub-device. If no match for the device was found in the vector returned by
sycl::device::get_devices()
- Example:
import dpctl # Create a GPU SyclDevice gpu_dev = dpctl.SyclDevice("gpu:0") # filter string should be "gpu:0" fs = gpu_dev.get_filter_string(use_backend=False) dev = dpctl.SyclDevice(fs) assert gpu _dev == dev