New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numba Wrapper Address Protocol (WAP) is broken #8282
Comments
Thanks for the report. This stopped working sometime between 0.53 and 0.54. |
|
Given the contents of 98f733f, I wonder if WAP relied on some import ordering/side effect. |
This "fixes" it: diff --git a/numba/core/cpu.py b/numba/core/cpu.py
--- a/numba/core/cpu.py
+++ b/numba/core/cpu.py
@@ -58,6 +58,17 @@ class CPUContext(BaseContext):
# Initialize NRT runtime
rtsys.initialize(self)
+ from numba.core.types import FunctionType, WrapperAddressProtocol
+ from numba.extending import typeof_impl
+ @typeof_impl.register(WrapperAddressProtocol)
+ def typeof_function_type(val, c):
+ if isinstance(val, WrapperAddressProtocol):
+ sig = val.signature()
+ else:
+ raise NotImplementedError(
+ f'function type from {type(val).__name__}')
+ return FunctionType(sig)
+
# Add lower_extension attribute
self.lower_extensions = {}
from numba.parfors.parfor_lowering import _lower_parfor_parallel the issue is essentially that the |
Thanks, Stuart. I think the tests for WAP are not failing on CI because |
Reporting a bug
visible in the change log (https://github.com/numba/numba/blob/main/CHANGE_LOG).
i.e. it's possible to run as 'python bug.py'.
Reproducer is from Numba docs:
The text was updated successfully, but these errors were encountered: