diff --git a/numba_dpex/config.py b/numba_dpex/config.py index 08457c22da..d0dee2c4f2 100644 --- a/numba_dpex/config.py +++ b/numba_dpex/config.py @@ -15,7 +15,10 @@ def _ensure_dpctl(): from numba_dpex.dpctl_support import dpctl_version if dpctl_version < (0, 14): - raise ImportError("numba_dpex needs dpctl 0.14 or greater") + logging.warning( + "numba_dpex needs dpctl 0.14 or greater, using " + f"dpctl={dpctl_version} may cause unexpected behavior" + ) def _dpctl_has_non_host_device(): diff --git a/numba_dpex/dpctl_support.py b/numba_dpex/dpctl_support.py index 381760eb49..521e24c7e8 100644 --- a/numba_dpex/dpctl_support.py +++ b/numba_dpex/dpctl_support.py @@ -4,4 +4,18 @@ import dpctl -dpctl_version = tuple(map(int, dpctl.__version__.split(".")[:2])) + +def _parse_version(): + t = dpctl.__version__.split(".") + if len(t) > 1: + try: + return tuple(map(int, t)) + except ValueError: + return (0, 0) + else: + return (0, 0) + + +dpctl_version = _parse_version() + +del _parse_version