NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
809 stars 63 forks source link

Cython 3: nogil must be at the end of the function signature line #44

Closed bdice closed 1 year ago

bdice commented 1 year ago

I am experimenting with Cython 3.0.0 beta 1. It raises the following warning hundreds of times when cimport-ing cuda-python.

warning: /home/bdice/mambaforge/envs/cudf_cython_beta/lib/python3.10/site-packages/cuda/ccudart.pxd:1123:154: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.

I think this expects nogil except ?cudaErrorCallRequiresNewerDriver to be replaced by except ?cudaErrorCallRequiresNewerDriver nogil. If we could fix this, it would be a massive improvement to the compiler diagnostics that are shown during builds, which are otherwise overwhelmed by the sheer volume of this message.

bdice commented 1 year ago

@vzhurba01 Do you think this would be possible to fix in the next release of cuda-python? Should be a find-replace. Manually building with Cython 3 would be a good-enough test for me, even if it's not regression tested in CI for now.

vzhurba01 commented 1 year ago

Looks simple enough, lets fix it for the next release. Thanks.

vzhurba01 commented 1 year ago

Resolved in CUDA Python 12.2.0. Closing.

bdice commented 1 year ago

@vzhurba01 Thank you!