contentis opened a new pull request, #50923:
URL: https://github.com/apache/arrow/pull/50923

   Closes #49437
   
   Numba-CUDA 0.28 changed CUDA context handles from `ctypes.c_void_p` to 
native `cuda.bindings.driver.CUcontext` objects. PyArrow currently expects 
incoming handles to have `.value` and also always returns `ctypes.c_void_p` 
when converting back to Numba.
   
   I added a small compatibility layer which:
   - Accepts both legacy `ctypes` handles and native `CUcontext` objects.
   - Returns the representation expected by the installed Numba implementation.
   - Explicitly tests both representations instead of assuming `.value`.
   - Removes CUDA 11 from the Python CUDA jobs while keeping the existing C++ 
CUDA 11 coverage.
   - Numba and `cuda.bindings` are intentionally imported lazily here since 
they are optional dependencies. Not sure how happy I am with this bit but it 
was the best solution in my opinion.
   
   There is also a temporary `numpy<2.5` constraint for the Numba-CUDA 
environment. Numba-CUDA 0.30.4 currently uses the removed `np.row_stack` 
attribute with NumPy 2.5. This is already being handled upstream in 
NVIDIA/numba-cuda#916 and the constraint can be removed once that fix is 
released.
   
   ### Testing
   I tested the full CUDA Numba interop suite locally with:
   - Numba-CUDA 0.27: 50 passed
   - Numba-CUDA 0.28: 50 passed
   - Numba-CUDA 0.30.4: 50 passed
   
   Cython compilation, linting and ShellCheck also pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to