-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Describe the bug
Complex division cannot be compiled with cabi.
Steps/Code to reproduce bug
- Prepare a clean python environment
- Execute
pip install numba-cuda - The code below demonstrates the behaviour:
import numba.cuda
def div_by_2(x):
return x / 2
def main():
sig = numba.cuda.types.complex128(numba.cuda.types.complex128)
func = numba.cuda.compile(div_by_2, sig, device=True, abi="c")
print(func)
if __name__ == "__main__":
main()
Expected behavior
Compilation will fail with error:
NotImplementedError: Python exceptions are unsupported in the CUDA C/C++ ABI
Environment details (please complete the following information):
- Environment location: wsl local machine
- Method of numba-cuda install: pip install
- Python env:
numba-cuda==0.27.0
numba==0.63.1
Python 3.11.14
Additional context
The issue is caused by the complex_div implementation raising a ZeroDivisionError, which the C ABI calling convention does not support (and breaks compilation).
Reactions are currently unavailable
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't working