From 990c2b50e95ef755d5471f6e5c3e3b57abd0529b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 11 Sep 2026 09:30:52 -0400 Subject: [PATCH] Regenerate bindings: !539: Treat `None` as `NULL` for `BYTES` arguments Generated from 5d247315167992fd80bfc5f5343c9c0b67eeddf1 + maint-13.4 --- cuda_bindings/cuda/bindings/cudla.pyx | 8 +++++--- cuda_bindings/cuda/bindings/nvfatbin.pyx | 8 +++++--- cuda_bindings/cuda/bindings/nvjitlink.pyx | 8 +++++--- cuda_bindings/cuda/bindings/nvvm.pyx | 8 +++++--- cuda_bindings/docs/source/release/13.5.0-notes.rst | 1 + 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cuda_bindings/cuda/bindings/cudla.pyx b/cuda_bindings/cuda/bindings/cudla.pyx index 9d04eb6013d..f06f010d2f8 100644 --- a/cuda_bindings/cuda/bindings/cudla.pyx +++ b/cuda_bindings/cuda/bindings/cudla.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=27847299a8355597d74d78c538539764838b579ac5331197a0773132e9c1fc18 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dacac686fe1821a7d01ad45a8337f4d35d53fc8fafa3892cd3fdcf4b0ec83b1a # <<<< PREAMBLE CONTENT >>>> @@ -75,7 +75,9 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep flags |= _cyb_cpython.PyBUF_WRITABLE cdef int status = -1 cdef _cyb_cpython.Py_buffer view - if isinstance(buf, int): + if buf is None: + ptr = 0 + elif isinstance(buf, int): ptr = buf else: try: @@ -86,7 +88,7 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep except Exception as e: adj = "writable " if not readonly else "" raise ValueError( - "buf must be either a Python int representing the pointer " + "buf must be None, a Python int representing the pointer " f"address to a valid buffer, or a 1D contiguous {adj}" f"buffer, of size {size}" ) from e diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index 5e098b563e5..3c64bdcb4d0 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=14de87751c0c3d7f45936993e667e4e41c4558782e61b73727a20e908c17c652 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b5d55e220498d5f9a4ea3993256cb5e66063e990616da21b03feb12e39fafeac # <<<< PREAMBLE CONTENT >>>> @@ -20,7 +20,9 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep flags |= _cyb_cpython.PyBUF_WRITABLE cdef int status = -1 cdef _cyb_cpython.Py_buffer view - if isinstance(buf, int): + if buf is None: + ptr = 0 + elif isinstance(buf, int): ptr = buf else: try: @@ -31,7 +33,7 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep except Exception as e: adj = "writable " if not readonly else "" raise ValueError( - "buf must be either a Python int representing the pointer " + "buf must be None, a Python int representing the pointer " f"address to a valid buffer, or a 1D contiguous {adj}" f"buffer, of size {size}" ) from e diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index 095fde7a316..9cfae481d33 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a78f22b1b6dcb03f525500bc064d3296b9439b5d35d5e0b1fdfb8cc02bc4ae78 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2722e4f76d90d40a7e867693a6583e1e1a5364bcb4dd8ec6265135f041d4b362 # <<<< PREAMBLE CONTENT >>>> @@ -23,7 +23,9 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep flags |= _cyb_cpython.PyBUF_WRITABLE cdef int status = -1 cdef _cyb_cpython.Py_buffer view - if isinstance(buf, int): + if buf is None: + ptr = 0 + elif isinstance(buf, int): ptr = buf else: try: @@ -34,7 +36,7 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep except Exception as e: adj = "writable " if not readonly else "" raise ValueError( - "buf must be either a Python int representing the pointer " + "buf must be None, a Python int representing the pointer " f"address to a valid buffer, or a 1D contiguous {adj}" f"buffer, of size {size}" ) from e diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index b66cab7a5ce..b20d028601d 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aa6981cde165f72ca15130140b5ccb381525a5bf29691bd36509266da7e781ae +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=84da1bdc4b1620ced150103d0acd5f0d48ea8808f593d8c67255896868f26ec3 # <<<< PREAMBLE CONTENT >>>> @@ -20,7 +20,9 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep flags |= _cyb_cpython.PyBUF_WRITABLE cdef int status = -1 cdef _cyb_cpython.Py_buffer view - if isinstance(buf, int): + if buf is None: + ptr = 0 + elif isinstance(buf, int): ptr = buf else: try: @@ -31,7 +33,7 @@ cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) excep except Exception as e: adj = "writable " if not readonly else "" raise ValueError( - "buf must be either a Python int representing the pointer " + "buf must be None, a Python int representing the pointer " f"address to a valid buffer, or a 1D contiguous {adj}" f"buffer, of size {size}" ) from e diff --git a/cuda_bindings/docs/source/release/13.5.0-notes.rst b/cuda_bindings/docs/source/release/13.5.0-notes.rst index 1a2b3f9b05e..d0a341278af 100644 --- a/cuda_bindings/docs/source/release/13.5.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.5.0-notes.rst @@ -11,6 +11,7 @@ Enhancements ------------ - ``cuda-bindings`` docstrings now include the full documentation from the upstream CTK, not just the first paragraph. +- For all ``cuda-bindings`` APIs, functions that accept a ``bytes`` object will also accept ``None``, which is treated as ``NULL``. Prerelease feature ------------------