diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f5f6bee8..ee4320195c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added +* Support for Numba 0.60 + ## [0.23.0] - 2024-05-28 ### Fixed diff --git a/environment.yml b/environment.yml index 4c09d7c2f2..7789e8ddf2 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,6 @@ channels: - defaults - dppy/label/dev - numba - - intel - numba/label/dev - nodefaults dependencies: diff --git a/environment/coverage.yml b/environment/coverage.yml index eb4e302156..37aac3b379 100644 --- a/environment/coverage.yml +++ b/environment/coverage.yml @@ -9,7 +9,7 @@ dependencies: - gcc_linux-64 - dpcpp_linux-64>=2024.2 - sysroot_linux-64=2.28 - - numba==0.59* + - numba==0.60* - dpctl - dpnp - dpcpp-llvm-spirv diff --git a/environment/docs.yml b/environment/docs.yml index bca6f7eba3..da5d617a8d 100644 --- a/environment/docs.yml +++ b/environment/docs.yml @@ -9,7 +9,7 @@ dependencies: - gcc_linux-64 - dpcpp_linux-64>=2024.2 - sysroot_linux-64=2.28 - - numba==0.59* + - numba==0.60* - scikit-build>=0.15* - cmake>=3.26* - ninja diff --git a/environment/pre-commit.yml b/environment/pre-commit.yml index 107672e3cf..ddc96d0140 100644 --- a/environment/pre-commit.yml +++ b/environment/pre-commit.yml @@ -6,7 +6,7 @@ channels: - nodefaults dependencies: - libffi - - numba==0.59* + - numba==0.60* - dpctl>=0.16* - dpnp>=0.14* - dpcpp-llvm-spirv diff --git a/numba_dpex/kernel_api_impl/spirv/dispatcher.py b/numba_dpex/kernel_api_impl/spirv/dispatcher.py index 92224d9c28..fa2b9bfad7 100644 --- a/numba_dpex/kernel_api_impl/spirv/dispatcher.py +++ b/numba_dpex/kernel_api_impl/spirv/dispatcher.py @@ -363,9 +363,6 @@ def add_overload(self, cres): self.overloads[args] = cres def compile(self, sig) -> any: - disp = self._get_dispatcher_for_current_target() - if disp is not self: - return disp.compile(sig) with ExitStack() as scope: cres = None diff --git a/numba_dpex/kernel_api_impl/spirv/target.py b/numba_dpex/kernel_api_impl/spirv/target.py index 379a76b92d..196ff814e9 100644 --- a/numba_dpex/kernel_api_impl/spirv/target.py +++ b/numba_dpex/kernel_api_impl/spirv/target.py @@ -293,7 +293,23 @@ def load_additional_registries(self): target context. """ - # pylint: disable=import-outside-toplevel + # pylint: disable=import-outside-toplevel, unused-import, too-many-locals + from numba.cpython import ( + builtins, + charseq, + enumimpl, + hashing, + heapq, + iterators, + listobj, + numbers, + rangeobj, + setobj, + slicing, + tupleobj, + unicode, + ) + from numba_dpex.dpctl_iface import dpctlimpl from numba_dpex.dpnp_iface import dpnpimpl diff --git a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py index 4808bf3f9b..37b7e0b0d3 100644 --- a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py +++ b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py @@ -136,7 +136,7 @@ def func(shape, queue): ) return c - with pytest.raises(errors.TypingError): + with pytest.raises((errors.TypingError, TypeError)): queue = dpctl.SyclQueue() func(10, queue) diff --git a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty_like.py b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty_like.py index e1cc0b209b..be81f6478c 100644 --- a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty_like.py +++ b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty_like.py @@ -154,13 +154,10 @@ def func1(x, queue): y = dpnp.empty_like(x, sycl_queue=queue, device=device) return y - try: + with pytest.raises((errors.TypingError, TypeError)): queue = dpctl.SyclQueue() a = dpnp.ones(10, dtype=dpnp.float32) func1(a, queue) - except Exception as e: - assert isinstance(e, errors.TypingError) - assert "`device` and `sycl_queue` are exclusive keywords" in str(e) @dpjit def func2(x): diff --git a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full.py b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full.py index cc15906a8d..867b502348 100644 --- a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full.py +++ b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full.py @@ -178,9 +178,6 @@ def func(shape, fill_value, queue): c = dpnp.ones(shape, fill_value, sycl_queue=queue, device=device) return c - try: + with pytest.raises((errors.TypingError, TypeError)): queue = dpctl.SyclQueue() func(10, 7, queue) - except Exception as e: - assert isinstance(e, errors.TypingError) - assert "`device` and `sycl_queue` are exclusive keywords" in str(e) diff --git a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full_like.py b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full_like.py index b466b92575..16b436c7f9 100644 --- a/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full_like.py +++ b/numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_full_like.py @@ -195,13 +195,10 @@ def func1(x, fill_value, queue): y = dpnp.full_like(x, 7, sycl_queue=queue, device=device) return y - try: + with pytest.raises((errors.TypingError, TypeError)): queue = dpctl.SyclQueue() a = dpnp.zeros(10) func1(a, 7, queue) - except Exception as e: - assert isinstance(e, errors.TypingError) - assert "`device` and `sycl_queue` are exclusive keywords" in str(e) @dpjit def func2(x, fill_value): @@ -241,11 +238,5 @@ def func(shape, fill_value): x = dpnp.full_like(shape, fill_value) return x - try: + with pytest.raises((errors.TypingError, AttributeError)): func(shape, 7) - except Exception as e: - assert isinstance(e, errors.TypingError) - assert ( - "No implementation of function Function(=0.16.1", # We need numba for runtime cpp headers - "numba>=0.59.0,<0.60.0a0", + "numba>=0.60.0,<0.61.0a0", "llvmlite>=0.42.0", # Do we need dpnp at build time? "dpnp >=0.14", @@ -40,9 +40,9 @@ dependencies = [ # This restrictions are for dependabot, actual restrictions are set with # conda. TODO: populate it during build process # TODO: do we have to set sycl runtime dependencies here - # "dpcpp-cpp-rt>=0.59.0", - # "intel-cmplr-lib-rt>=0.59.0" - "numba>=0.59.0", + # "dpcpp-cpp-rt>=xxxx", + # "intel-cmplr-lib-rt>=xxxx" + "numba>=0.60.0,<0.61.0a0", "llvmlite>=0.42.0", "dpctl>=0.16.1", "dpnp>=0.14.0",