dpctl.select_device_with_aspects

dpctl.select_device_with_aspects(required_aspects, excluded_aspects=None)[source]

Selects the root dpctl.SyclDevice that has the highest default selector score among devices that have all aspects in the required_aspects list, and do not have any aspects in excluded_aspects list.

The list of SYCL device aspects can be found in SYCL 2020 specs:

https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:device-aspects

Example:
import dpctl
# select a GPU that supports double precision
dpctl.select_device_with_aspects(['fp64', 'gpu'])
# select non-custom device with USM shared allocations
dpctl.select_device_with_aspects(
    ['usm_shared_allocations'], excluded_aspects=['custom'])