Commit 2164723
committed
Fix CABI return type mismatch when calling Numba-ABI subroutines
In `user_function`, `return_status_propagate` was called with the
callee's calling convention (`fndesc.call_conv`). When a CABI function
called a Numba-ABI subroutine (e.g. an overloaded function compiled
via `compile_subroutine`), the Numba-ABI convention emitted
`ret i32 <status>` inside a function whose declared return type was
the user type (e.g. `i8*` for NoneType), producing invalid LLVM IR
and an NVVM `ERROR_INVALID_IR` verification failure.
Use the caller's calling convention (`context.fndesc.call_conv`)
instead, which correctly delegates to `CUDACABICallConv.
return_status_propagate` (a no-op, since C ABI has no error-status
channel).
Closes #841
Made-with: Cursor1 parent 7928b8b commit 2164723
File tree
2 files changed
+32
-2
lines changed- numba_cuda/numba/cuda
- core
- tests/cudapy
2 files changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
840 | 868 | | |
841 | 869 | | |
842 | 870 | | |
| |||
0 commit comments