diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml
index e414a2d7d3e..926619a799a 100644
--- a/.github/workflows/bandit.yml
+++ b/.github/workflows/bandit.yml
@@ -42,8 +42,10 @@ jobs:
echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT"
- name: Perform Bandit Analysis using Ruff
uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0
+ # Preserve the inactive CUDA 12 snapshot; the source-integration layer
+ # adapts its security annotations and removes this temporary exclusion.
with:
- args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
+ args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --extend-exclude cuda_bindings_12 --output-format sarif --output-file results.sarif"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
with:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6767804609a..38761afeedc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -14,6 +14,9 @@ ci:
# Please update the rev: SHAs below with this command:
# pre-commit autoupdate --freeze
+# This unchanged maintenance-source import is inactive until its integration layer.
+exclude: ^cuda_bindings_12/
+
repos:
# Runs first so a leaked credential blocks the commit before any formatter runs.
# Self-installing: the hook downloads a pinned, checksum-verified trufflehog on
diff --git a/cuda_bindings_12/.git_archival.txt b/cuda_bindings_12/.git_archival.txt
new file mode 120000
index 00000000000..d7a42b253d8
--- /dev/null
+++ b/cuda_bindings_12/.git_archival.txt
@@ -0,0 +1 @@
+../.git_archival.txt
\ No newline at end of file
diff --git a/cuda_bindings_12/DESCRIPTION.rst b/cuda_bindings_12/DESCRIPTION.rst
new file mode 100644
index 00000000000..ca0297523e0
--- /dev/null
+++ b/cuda_bindings_12/DESCRIPTION.rst
@@ -0,0 +1,15 @@
+.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+.. SPDX-License-Identifier: Apache-2.0
+
+****************************************
+cuda-bindings: Low-level CUDA interfaces
+****************************************
+
+`cuda.bindings `_ is a standard set of low-level interfaces, providing full coverage of and 1:1 access to the CUDA host APIs from Python. Checkout the `Overview `_ for the workflow and performance results.
+
+* `Repository `_
+* `Documentation `_
+* `Examples `_
+* `Issue tracker `_
+
+For the installation instruction, please refer to the `Installation `_ page.
diff --git a/cuda_bindings_12/LICENSE b/cuda_bindings_12/LICENSE
new file mode 100644
index 00000000000..d6f74778be8
--- /dev/null
+++ b/cuda_bindings_12/LICENSE
@@ -0,0 +1,178 @@
+Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/cuda_bindings_12/MANIFEST.in b/cuda_bindings_12/MANIFEST.in
new file mode 100644
index 00000000000..d381e04d59e
--- /dev/null
+++ b/cuda_bindings_12/MANIFEST.in
@@ -0,0 +1,8 @@
+# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+recursive-include cuda/ *.pyx *.pxd *.pxi
+# at least with setuptools 75.0.0 this folder was added erroneously
+# to the payload, causing file copying to the build environment failed
+exclude cuda/bindings cuda?bindings
+exclude cuda/bindings/_bindings cuda?bindings?_bindings
diff --git a/cuda_bindings_12/README.md b/cuda_bindings_12/README.md
new file mode 100644
index 00000000000..a0657706d06
--- /dev/null
+++ b/cuda_bindings_12/README.md
@@ -0,0 +1,67 @@
+# `cuda.bindings`: Low-level CUDA interfaces
+
+`cuda.bindings` is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. Checkout the [Overview page](https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html) for the workflow and performance results.
+
+## Installing
+
+Please refer to the [Installation page](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html) for instructions and required/optional dependencies.
+
+## Developing
+
+This subpackage adheres to the developing practices described in the parent metapackage [CONTRIBUTING.md](https://github.com/NVIDIA/cuda-python/blob/main/CONTRIBUTING.md).
+
+## Testing
+
+Testing dependencies can be installed using the `[test]` optional dependency identifier. For example, `pip install -v -e .[test]`.
+
+Multiple testing options are available:
+
+* Python Unit Tests
+* Cython Unit Tests
+* Samples
+* Benchmark
+
+### Python Unit Tests
+
+Responsible for validating different binding usage patterns. Unit test `test_kernelParams.py` is particularly special since it demonstrates various approaches in setting up kernel launch parameters.
+
+To run these tests:
+* `python -m pytest tests/` against editable installations
+* `pytest tests/` against installed packages
+
+### Cython Unit Tests
+
+Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [Installing from Source](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them:
+
+1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation.
+2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them.
+
+To run these tests:
+* `python -m pytest tests/cython/` against editable installations
+* `pytest tests/cython/` against installed packages
+
+### Samples
+
+Various [CUDA Samples](https://github.com/NVIDIA/cuda-samples/tree/master) that were rewritten using CUDA Python are located in `examples`.
+
+In addition, extra examples are included:
+
+* `examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and
+ launch a kernel on the device. Includes device memory allocation /
+ deallocation, transfers between host and device, creation and usage of
+ streams, and context management.
+* `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management
+ plugin, showing that this CUDA Python Driver API can coexist with other
+ wrappers of the driver API.
+
+To run these samples:
+* `python -m pytest tests/cython/` against editable installations
+* `pytest tests/cython/` against installed packages
+
+### Benchmark
+
+Allows for analyzing binding performance using plugin [pytest-benchmark](https://github.com/ionelmc/pytest-benchmark).
+
+To run these benchmarks:
+* `python -m pytest --benchmark-only benchmarks/` against editable installations
+* `pytest --benchmark-only benchmarks/` against installed packages
diff --git a/cuda_bindings_12/benchmarks/conftest.py b/cuda_bindings_12/benchmarks/conftest.py
new file mode 100644
index 00000000000..0719dca47b8
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/conftest.py
@@ -0,0 +1,91 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import numpy as np
+import pytest
+
+from cuda import cuda, cudart, nvrtc
+
+
+def ASSERT_DRV(err):
+ if isinstance(err, cuda.CUresult):
+ if err != cuda.CUresult.CUDA_SUCCESS:
+ raise RuntimeError(f"Cuda Error: {err}")
+ elif isinstance(err, cudart.cudaError_t):
+ if err != cudart.cudaError_t.cudaSuccess:
+ raise RuntimeError(f"Cudart Error: {err}")
+ elif isinstance(err, nvrtc.nvrtcResult):
+ if err != nvrtc.nvrtcResult.NVRTC_SUCCESS:
+ raise RuntimeError(f"Nvrtc Error: {err}")
+ else:
+ raise RuntimeError(f"Unknown error type: {err}")
+
+
+@pytest.fixture(scope="function")
+def init_cuda():
+ # Initialize
+ (err,) = cuda.cuInit(0)
+ ASSERT_DRV(err)
+ err, device = cuda.cuDeviceGet(0)
+ ASSERT_DRV(err)
+ err, ctx = cuda.cuCtxCreate(0, device)
+ ASSERT_DRV(err)
+
+ # create stream
+ err, stream = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value)
+ ASSERT_DRV(err)
+
+ yield device, ctx, stream
+
+ (err,) = cuda.cuStreamDestroy(stream)
+ ASSERT_DRV(err)
+ (err,) = cuda.cuCtxDestroy(ctx)
+ ASSERT_DRV(err)
+
+
+@pytest.fixture(scope="function")
+def load_module():
+ module = None
+
+ def _load_module(kernel_string, device):
+ nonlocal module
+ # Get module
+ err, major = cuda.cuDeviceGetAttribute(
+ cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device
+ )
+ ASSERT_DRV(err)
+ err, minor = cuda.cuDeviceGetAttribute(
+ cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device
+ )
+ ASSERT_DRV(err)
+
+ err, prog = nvrtc.nvrtcCreateProgram(str.encode(kernel_string), b"kernelString.cu", 0, [], [])
+ ASSERT_DRV(err)
+ opts = [b"--fmad=false", bytes("--gpu-architecture=sm_" + str(major) + str(minor), "ascii")]
+ (err,) = nvrtc.nvrtcCompileProgram(prog, 2, opts)
+
+ err_log, logSize = nvrtc.nvrtcGetProgramLogSize(prog)
+ ASSERT_DRV(err_log)
+ log = b" " * logSize
+ (err_log,) = nvrtc.nvrtcGetProgramLog(prog, log)
+ ASSERT_DRV(err_log)
+ result = log.decode()
+ if len(result) > 1:
+ print(result)
+
+ ASSERT_DRV(err)
+ err, cubinSize = nvrtc.nvrtcGetCUBINSize(prog)
+ ASSERT_DRV(err)
+ cubin = b" " * cubinSize
+ (err,) = nvrtc.nvrtcGetCUBIN(prog, cubin)
+ ASSERT_DRV(err)
+ cubin = np.char.array(cubin)
+ err, module = cuda.cuModuleLoadData(cubin)
+ ASSERT_DRV(err)
+
+ return module
+
+ yield _load_module
+
+ (err,) = cuda.cuModuleUnload(module)
+ ASSERT_DRV(err)
diff --git a/cuda_bindings_12/benchmarks/kernels.py b/cuda_bindings_12/benchmarks/kernels.py
new file mode 100644
index 00000000000..89f1e1a0a87
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/kernels.py
@@ -0,0 +1,159 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+kernel_string = """\
+#define ITEM_PARAM(x, T) T x
+#define REP1(x, T) , ITEM_PARAM(x, T)
+#define REP2(x, T) REP1(x##0, T) REP1(x##1, T)
+#define REP4(x, T) REP2(x##0, T) REP2(x##1, T)
+#define REP8(x, T) REP4(x##0, T) REP4(x##1, T)
+#define REP16(x, T) REP8(x##0, T) REP8(x##1, T)
+#define REP32(x, T) REP16(x##0, T) REP16(x##1, T)
+#define REP64(x, T) REP32(x##0, T) REP32(x##1, T)
+#define REP128(x, T) REP64(x##0, T) REP64(x##1, T)
+#define REP256(x, T) REP128(x##0, T) REP128(x##1, T)
+
+template
+struct KernelFunctionParam
+{
+ unsigned char p[maxBytes];
+};
+
+extern "C" __global__ void small_kernel(float *f)
+{
+ *f = 0.0f;
+}
+
+extern "C" __global__ void empty_kernel()
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_512_args(
+ ITEM_PARAM(F, int*)
+ REP1(A, int*)
+ REP2(A, int*)
+ REP4(A, int*)
+ REP8(A, int*)
+ REP16(A, int*)
+ REP32(A, int*)
+ REP64(A, int*)
+ REP128(A, int*)
+ REP256(A, int*))
+{
+ *F = 0;
+}
+
+extern "C" __global__
+void small_kernel_512_bools(
+ ITEM_PARAM(F, bool)
+ REP1(A, bool)
+ REP2(A, bool)
+ REP4(A, bool)
+ REP8(A, bool)
+ REP16(A, bool)
+ REP32(A, bool)
+ REP64(A, bool)
+ REP128(A, bool)
+ REP256(A, bool))
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_512_ints(
+ ITEM_PARAM(F, int)
+ REP1(A, int)
+ REP2(A, int)
+ REP4(A, int)
+ REP8(A, int)
+ REP16(A, int)
+ REP32(A, int)
+ REP64(A, int)
+ REP128(A, int)
+ REP256(A, int))
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_512_doubles(
+ ITEM_PARAM(F, double)
+ REP1(A, double)
+ REP2(A, double)
+ REP4(A, double)
+ REP8(A, double)
+ REP16(A, double)
+ REP32(A, double)
+ REP64(A, double)
+ REP128(A, double)
+ REP256(A, double))
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_512_chars(
+ ITEM_PARAM(F, char)
+ REP1(A, char)
+ REP2(A, char)
+ REP4(A, char)
+ REP8(A, char)
+ REP16(A, char)
+ REP32(A, char)
+ REP64(A, char)
+ REP128(A, char)
+ REP256(A, char))
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_512_longlongs(
+ ITEM_PARAM(F, long long)
+ REP1(A, long long)
+ REP2(A, long long)
+ REP4(A, long long)
+ REP8(A, long long)
+ REP16(A, long long)
+ REP32(A, long long)
+ REP64(A, long long)
+ REP128(A, long long)
+ REP256(A, long long))
+{
+ return;
+}
+
+extern "C" __global__
+void small_kernel_256_args(
+ ITEM_PARAM(F, int*)
+ REP1(A, int*)
+ REP2(A, int*)
+ REP4(A, int*)
+ REP8(A, int*)
+ REP16(A, int*)
+ REP32(A, int*)
+ REP64(A, int*)
+ REP128(A, int*))
+{
+ *F = 0;
+}
+
+extern "C" __global__
+void small_kernel_16_args(
+ ITEM_PARAM(F, int*)
+ REP1(A, int*)
+ REP2(A, int*)
+ REP4(A, int*)
+ REP8(A, int*))
+{
+ *F = 0;
+}
+
+extern "C" __global__ void small_kernel_2048B(KernelFunctionParam<2048> param)
+{
+ // Do not touch param to prevent compiler from copying
+ // the whole structure from const bank to lmem.
+}
+"""
diff --git a/cuda_bindings_12/benchmarks/pytest.ini b/cuda_bindings_12/benchmarks/pytest.ini
new file mode 100644
index 00000000000..99da0054320
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/pytest.ini
@@ -0,0 +1,6 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+[pytest]
+required_plugins = pytest-benchmark
+addopts = --benchmark-skip
diff --git a/cuda_bindings_12/benchmarks/test_cupy.py b/cuda_bindings_12/benchmarks/test_cupy.py
new file mode 100644
index 00000000000..cd6c6740350
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/test_cupy.py
@@ -0,0 +1,199 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import ctypes
+
+import pytest
+
+try:
+ import cupy
+
+ skip_tests = False
+except ImportError:
+ skip_tests = True
+
+from kernels import kernel_string
+
+
+def launch(kernel, args=()):
+ kernel((1,), (1,), args)
+
+
+# Measure launch latency with no parmaeters
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_empty_kernel(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("empty_kernel")
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel)
+ stream.synchronize()
+
+
+# Measure launch latency with a single parameter
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel")
+ cupy.cuda.set_allocator()
+ arg = cupy.cuda.alloc(ctypes.sizeof(ctypes.c_float))
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, (arg,))
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_args(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_args")
+ cupy.cuda.set_allocator()
+
+ args = []
+ for _ in range(512):
+ args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int)))
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_bools(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_bools")
+ cupy.cuda.set_allocator()
+
+ args = [True] * 512
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_doubles(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_doubles")
+ cupy.cuda.set_allocator()
+
+ args = [1.2345] * 512
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_ints(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_ints")
+ cupy.cuda.set_allocator()
+
+ args = [123] * 512
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_bytes(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_chars")
+ cupy.cuda.set_allocator()
+
+ args = [127] * 512
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_512_longlongs(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_512_longlongs")
+ cupy.cuda.set_allocator()
+
+ args = [9223372036854775806] * 512
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_256_args(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_256_args")
+ cupy.cuda.set_allocator()
+
+ args = []
+ for _ in range(256):
+ args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int)))
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.skipif(skip_tests, reason="cupy is not installed")
+@pytest.mark.benchmark(group="cupy")
+def test_launch_latency_small_kernel_16_args(benchmark):
+ module = cupy.RawModule(code=kernel_string)
+ kernel = module.get_function("small_kernel_16_args")
+ cupy.cuda.set_allocator()
+
+ args = []
+ for _ in range(16):
+ args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int)))
+ args = tuple(args)
+
+ stream = cupy.cuda.stream.Stream(non_blocking=True)
+
+ with stream:
+ benchmark(launch, kernel, args)
+ stream.synchronize()
diff --git a/cuda_bindings_12/benchmarks/test_launch_latency.py b/cuda_bindings_12/benchmarks/test_launch_latency.py
new file mode 100755
index 00000000000..541db98d556
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/test_launch_latency.py
@@ -0,0 +1,336 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import ctypes
+
+import pytest
+from conftest import ASSERT_DRV
+from kernels import kernel_string
+
+from cuda import cuda
+
+
+def launch(kernel, stream, args=(), arg_types=()):
+ cuda.cuLaunchKernel(
+ kernel,
+ 1,
+ 1,
+ 1, # grid dim
+ 1,
+ 1,
+ 1, # block dim
+ 0,
+ stream, # shared mem and stream
+ (args, arg_types),
+ 0,
+ ) # arguments
+
+
+def launch_packed(kernel, stream, params):
+ cuda.cuLaunchKernel(
+ kernel,
+ 1,
+ 1,
+ 1, # grid dim
+ 1,
+ 1,
+ 1, # block dim
+ 0,
+ stream, # shared mem and stream
+ params,
+ 0,
+ ) # arguments
+
+
+# Measure launch latency with no parmaeters
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_empty_kernel(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"empty_kernel")
+ ASSERT_DRV(err)
+
+ benchmark(launch, func, stream)
+
+ cuda.cuCtxSynchronize()
+
+
+# Measure launch latency with a single parameter
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel")
+ ASSERT_DRV(err)
+
+ err, f = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_float))
+ ASSERT_DRV(err)
+
+ benchmark(launch, func, stream, args=(f,), arg_types=(None,))
+
+ cuda.cuCtxSynchronize()
+
+ (err,) = cuda.cuMemFree(f)
+ ASSERT_DRV(err)
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_args(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args")
+ ASSERT_DRV(err)
+
+ args = []
+ arg_types = [None] * 512
+ for _ in arg_types:
+ err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int))
+ ASSERT_DRV(err)
+ args.append(p)
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+ for p in args:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_bools(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_bools")
+ ASSERT_DRV(err)
+
+ args = [True] * 512
+ arg_types = [ctypes.c_bool] * 512
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_doubles(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_doubles")
+ ASSERT_DRV(err)
+
+ args = [1.2345] * 512
+ arg_types = [ctypes.c_double] * 512
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_ints(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_ints")
+ ASSERT_DRV(err)
+
+ args = [123] * 512
+ arg_types = [ctypes.c_int] * 512
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_bytes(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_chars")
+ ASSERT_DRV(err)
+
+ args = [127] * 512
+ arg_types = [ctypes.c_byte] * 512
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_longlongs(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_longlongs")
+ ASSERT_DRV(err)
+
+ args = [9223372036854775806] * 512
+ arg_types = [ctypes.c_longlong] * 512
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_256_args(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_256_args")
+ ASSERT_DRV(err)
+
+ args = []
+ arg_types = [None] * 256
+ for _ in arg_types:
+ err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int))
+ ASSERT_DRV(err)
+ args.append(p)
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+ for p in args:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+# Measure launch latency with many parameters using builtin parameter packing
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_16_args(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_16_args")
+ ASSERT_DRV(err)
+
+ args = []
+ arg_types = [None] * 16
+ for _ in arg_types:
+ err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int))
+ ASSERT_DRV(err)
+ args.append(p)
+
+ args = tuple(args)
+ arg_types = tuple(arg_types)
+
+ benchmark(launch, func, stream, args=args, arg_types=arg_types)
+
+ cuda.cuCtxSynchronize()
+
+ for p in args:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+# Measure launch latency with many parameters, excluding parameter packing
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_args_ctypes(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args")
+ ASSERT_DRV(err)
+
+ vals = []
+ val_ps = []
+ for i in range(512):
+ err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int))
+ ASSERT_DRV(err)
+ vals.append(p)
+ val_ps.append(ctypes.c_void_p(int(vals[i])))
+
+ packagedParams = (ctypes.c_void_p * 512)()
+ for i in range(512):
+ packagedParams[i] = ctypes.addressof(val_ps[i])
+
+ benchmark(launch_packed, func, stream, packagedParams)
+
+ cuda.cuCtxSynchronize()
+
+ for p in vals:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+def pack_and_launch(kernel, stream, params):
+ packed_params = (ctypes.c_void_p * len(params))()
+ ptrs = [0] * len(params)
+ for i in range(len(params)):
+ ptrs[i] = ctypes.c_void_p(int(params[i]))
+ packed_params[i] = ctypes.addressof(ptrs[i])
+
+ cuda.cuLaunchKernel(kernel, 1, 1, 1, 1, 1, 1, 0, stream, packed_params, 0)
+
+
+# Measure launch latency plus parameter packing using ctypes
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_512_args_ctypes_with_packing(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args")
+ ASSERT_DRV(err)
+
+ vals = []
+ for i in range(512):
+ err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int))
+ ASSERT_DRV(err)
+ vals.append(p)
+
+ benchmark(pack_and_launch, func, stream, vals)
+
+ cuda.cuCtxSynchronize()
+
+ for p in vals:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+# Measure launch latency with a single large struct parameter
+@pytest.mark.benchmark(group="launch-latency")
+def test_launch_latency_small_kernel_2048B(benchmark, init_cuda, load_module):
+ device, ctx, stream = init_cuda
+ module = load_module(kernel_string, device)
+
+ err, func = cuda.cuModuleGetFunction(module, b"small_kernel_2048B")
+ ASSERT_DRV(err)
+
+ class struct_2048B(ctypes.Structure):
+ _fields_ = [("values", ctypes.c_uint8 * 2048)]
+
+ benchmark(launch, func, stream, args=(struct_2048B(),), arg_types=(None,))
+
+ cuda.cuCtxSynchronize()
diff --git a/cuda_bindings_12/benchmarks/test_numba.py b/cuda_bindings_12/benchmarks/test_numba.py
new file mode 100644
index 00000000000..4f708bf69d7
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/test_numba.py
@@ -0,0 +1,52 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import numpy as np
+import pytest
+
+try:
+ from numba import cuda
+
+ skip_tests = False
+except ImportError:
+ skip_tests = True
+
+
+def launch_empty(kernel, stream):
+ kernel[1, 1, stream]()
+
+
+def launch(kernel, stream, arg):
+ kernel[1, 1, stream](arg)
+
+
+# Measure launch latency with no parmaeters
+@pytest.mark.skipif(skip_tests, reason="Numba is not installed")
+@pytest.mark.benchmark(group="numba", min_rounds=1000)
+def test_launch_latency_empty_kernel(benchmark):
+ stream = cuda.stream()
+
+ @cuda.jit
+ def empty_kernel():
+ return
+
+ benchmark(launch_empty, empty_kernel, stream)
+
+ cuda.synchronize()
+
+
+# Measure launch latency with a single parameter
+@pytest.mark.skipif(skip_tests, reason="Numba is not installed")
+@pytest.mark.benchmark(group="numba", min_rounds=1000)
+def test_launch_latency_small_kernel(benchmark):
+ stream = cuda.stream()
+
+ arg = cuda.device_array(1, dtype=np.float32, stream=stream)
+
+ @cuda.jit
+ def small_kernel(array):
+ array[0] = 0.0
+
+ benchmark(launch, small_kernel, stream, arg)
+
+ cuda.synchronize()
diff --git a/cuda_bindings_12/benchmarks/test_pointer_attributes.py b/cuda_bindings_12/benchmarks/test_pointer_attributes.py
new file mode 100644
index 00000000000..136d4be19f0
--- /dev/null
+++ b/cuda_bindings_12/benchmarks/test_pointer_attributes.py
@@ -0,0 +1,112 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import random
+
+import pytest
+from conftest import ASSERT_DRV
+
+from cuda import cuda
+
+random.seed(0)
+
+idx = 0
+
+
+def query_attribute(attribute, ptrs):
+ global idx
+ ptr = ptrs[idx]
+ idx = (idx + 1) % len(ptrs)
+
+ cuda.cuPointerGetAttribute(attribute, ptr)
+
+
+def query_attributes(attributes, ptrs):
+ global idx
+ ptr = ptrs[idx]
+ idx = (idx + 1) % len(ptrs)
+
+ cuda.cuPointerGetAttributes(len(attributes), attributes, ptr)
+
+
+@pytest.mark.benchmark(group="pointer-attributes")
+# Measure cuPointerGetAttribute in the same way as C benchmarks
+def test_pointer_get_attribute(benchmark, init_cuda):
+ _ = init_cuda
+
+ ptrs = []
+ for _ in range(500):
+ err, ptr = cuda.cuMemAlloc(1 << 18)
+ ASSERT_DRV(err)
+ ptrs.append(ptr)
+
+ random.shuffle(ptrs)
+
+ benchmark(query_attribute, cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, ptrs)
+
+ for p in ptrs:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+@pytest.mark.benchmark(group="pointer-attributes")
+# Measure cuPointerGetAttributes with all attributes
+def test_pointer_get_attributes_all(benchmark, init_cuda):
+ _ = init_cuda
+
+ ptrs = []
+ for _ in range(500):
+ err, ptr = cuda.cuMemAlloc(1 << 18)
+ ASSERT_DRV(err)
+ ptrs.append(ptr)
+
+ random.shuffle(ptrs)
+
+ attributes = [
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_CONTEXT,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_HOST_POINTER,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_P2P_TOKENS,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_BUFFER_ID,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_SIZE,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPED,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,
+ ]
+
+ benchmark(query_attributes, attributes, ptrs)
+
+ for p in ptrs:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
+
+
+@pytest.mark.benchmark(group="pointer-attributes")
+# Measure cuPointerGetAttributes with a single attribute
+def test_pointer_get_attributes_single(benchmark, init_cuda):
+ _ = init_cuda
+
+ ptrs = []
+ for _ in range(500):
+ err, ptr = cuda.cuMemAlloc(1 << 18)
+ ASSERT_DRV(err)
+ ptrs.append(ptr)
+
+ random.shuffle(ptrs)
+
+ attributes = [
+ cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE,
+ ]
+
+ benchmark(query_attributes, attributes, ptrs)
+
+ for p in ptrs:
+ (err,) = cuda.cuMemFree(p)
+ ASSERT_DRV(err)
diff --git a/cuda_bindings_12/build_hooks.py b/cuda_bindings_12/build_hooks.py
new file mode 100644
index 00000000000..f09ee822a50
--- /dev/null
+++ b/cuda_bindings_12/build_hooks.py
@@ -0,0 +1,460 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+# This module implements basic PEP 517 backend support to defer CUDA-dependent
+# logic (header parsing, code generation, cythonization) to build time. See:
+# - https://peps.python.org/pep-0517/
+# - https://setuptools.pypa.io/en/latest/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks
+# - https://github.com/NVIDIA/cuda-python/issues/1635
+
+import atexit
+import contextlib
+import functools
+import glob
+import os
+import shutil
+import sys
+import sysconfig
+import tempfile
+from warnings import warn
+
+from setuptools import build_meta as _build_meta
+from setuptools.extension import Extension
+
+# Metadata hooks delegate directly to setuptools -- no CUDA needed.
+prepare_metadata_for_build_editable = _build_meta.prepare_metadata_for_build_editable
+prepare_metadata_for_build_wheel = _build_meta.prepare_metadata_for_build_wheel
+build_sdist = _build_meta.build_sdist
+get_requires_for_build_sdist = _build_meta.get_requires_for_build_sdist
+get_requires_for_build_wheel = _build_meta.get_requires_for_build_wheel
+get_requires_for_build_editable = _build_meta.get_requires_for_build_editable
+
+# Populated by _build_cuda_bindings(); consumed by setup.py.
+_extensions = None
+
+
+@functools.cache
+def _get_cuda_paths() -> list[str]:
+ CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None))
+ if not CUDA_HOME:
+ raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set")
+ CUDA_HOME = CUDA_HOME.split(os.pathsep)
+ print("CUDA paths:", CUDA_HOME)
+ return CUDA_HOME
+
+
+# -----------------------------------------------------------------------
+# Header parsing helpers (called only from _build_cuda_bindings)
+
+_REQUIRED_HEADERS = {
+ "runtime": [
+ "driver_types.h",
+ "vector_types.h",
+ "cuda_runtime.h",
+ "surface_types.h",
+ "texture_types.h",
+ "library_types.h",
+ "cuda_runtime_api.h",
+ "device_types.h",
+ "driver_functions.h",
+ "cuda_profiler_api.h",
+ ],
+ # nvrtc: headers no longer parsed at build time (pre-generated by cybind).
+ # During compilation, Cython will reference C headers that are not
+ # explicitly parsed above. These are the known dependencies:
+ #
+ # - crt/host_defines.h
+ # - builtin_types.h
+ # - cuda_device_runtime_api.h
+}
+
+
+class _Struct:
+ def __init__(self, name, members):
+ self._name = name
+ self._member_names = []
+ self._member_types = []
+ self._member_declarators = []
+ for var_name, var_type, _ in members:
+ base_type = var_type[0]
+ base_type = base_type.removeprefix("struct ")
+ base_type = base_type.removeprefix("union ")
+
+ self._member_names += [var_name]
+ self._member_types += [base_type]
+ self._member_declarators += [tuple(var_type[1:])]
+
+ def member_type(self, member_name):
+ try:
+ return self._member_types[self._member_names.index(member_name)]
+ except ValueError:
+ return None
+
+ def member_array_length(self, member_name):
+ try:
+ declarators = self._member_declarators[self._member_names.index(member_name)]
+ except ValueError:
+ return None
+
+ for declarator in declarators:
+ if isinstance(declarator, list) and len(declarator) == 1:
+ return declarator[0]
+ return None
+
+ def discoverMembers(self, memberDict, prefix, seen=None):
+ if seen is None:
+ seen = set()
+ elif self._name in seen:
+ return []
+
+ discovered = []
+ next_seen = set(seen)
+ next_seen.add(self._name)
+
+ for memberName, memberType in zip(self._member_names, self._member_types):
+ if memberName:
+ discovered.append(".".join([prefix, memberName]))
+
+ t = memberType.replace("const ", "").replace("volatile ", "").strip().rstrip(" *")
+ if t in memberDict and t != self._name:
+ discovered += memberDict[t].discoverMembers(
+ memberDict, discovered[-1] if memberName else prefix, next_seen
+ )
+
+ return discovered
+
+ def __repr__(self):
+ return f"{self._name}: {self._member_names} with types {self._member_types}"
+
+
+def _fetch_header_paths(required_headers, include_path_list):
+ header_dict = {}
+ missing_headers = []
+ for library, header_list in required_headers.items():
+ header_paths = []
+ for header in header_list:
+ path_candidate = [os.path.join(path, header) for path in include_path_list]
+ for path in path_candidate:
+ if os.path.exists(path):
+ header_paths += [path]
+ break
+ else:
+ missing_headers += [header]
+
+ header_dict[library] = header_paths
+
+ if missing_headers:
+ error_message = "Couldn't find required headers: "
+ error_message += ", ".join(missing_headers)
+ cuda_paths = _get_cuda_paths()
+ raise RuntimeError(f'{error_message}\nIs CUDA_HOME setup correctly? (CUDA_HOME="{cuda_paths}")')
+
+ return header_dict
+
+
+def _parse_headers(header_dict, include_path_list, parser_caching):
+ from pyclibrary import CParser
+
+ found_types = []
+ found_functions = []
+ found_values = []
+ found_struct = []
+ struct_list = {}
+
+ replace = {
+ " __device_builtin__ ": " ",
+ "CUDARTAPI ": " ",
+ "typedef __device_builtin__ enum cudaError cudaError_t;": "typedef cudaError cudaError_t;",
+ "typedef __device_builtin__ enum cudaOutputMode cudaOutputMode_t;": "typedef cudaOutputMode cudaOutputMode_t;",
+ "typedef enum cudaError cudaError_t;": "typedef cudaError cudaError_t;",
+ "typedef enum cudaOutputMode cudaOutputMode_t;": "typedef cudaOutputMode cudaOutputMode_t;",
+ "typedef enum cudaDataType_t cudaDataType_t;": "",
+ "typedef enum libraryPropertyType_t libraryPropertyType_t;": "",
+ " enum ": " ",
+ ", enum ": ", ",
+ "\\(enum ": "(",
+ # Since we only support 64 bit architectures, we can inline the sizeof(T*) to 8 and then compute the
+ # result in Python. The arithmetic expression is preserved to help with clarity and understanding
+ r"char reserved\[52 - sizeof\(CUcheckpointGpuPair \*\)\];": rf"char reserved[{52 - 8}];",
+ r"char reserved\[64 - sizeof\(CUcheckpointGpuPair \*\) - sizeof\(unsigned int\)\];": (
+ rf"char reserved[{64 - 8 - 4}];"
+ ),
+ }
+
+ print(f'Parsing headers in "{include_path_list}" (Caching = {parser_caching})', flush=True)
+ for library, header_paths in header_dict.items():
+ print(f"Parsing {library} headers", flush=True)
+ parser = CParser(
+ header_paths, cache="./cache_{}".format(library.split(".")[0]) if parser_caching else None, replace=replace
+ )
+
+ if library == "driver":
+ CUDA_VERSION = parser.defs["macros"].get("CUDA_VERSION", "Unknown")
+ print(f"Found CUDA_VERSION: {CUDA_VERSION}", flush=True)
+
+ found_types += {key for key in parser.defs["types"]}
+ found_types += {key for key in parser.defs["structs"]}
+ found_types += {key for key in parser.defs["unions"]}
+ found_types += {key for key in parser.defs["enums"]}
+ found_functions += {key for key in parser.defs["functions"]}
+ found_values += {key for key in parser.defs["values"]}
+
+ for key, value in parser.defs["structs"].items():
+ struct_list[key] = _Struct(key, value["members"])
+ for key, value in parser.defs["unions"].items():
+ struct_list[key] = _Struct(key, value["members"])
+
+ for key, value in struct_list.items():
+ if key.startswith("anon_union") or key.startswith("anon_struct"):
+ continue
+
+ found_struct += [key]
+ discovered = value.discoverMembers(struct_list, key)
+ if discovered:
+ found_struct += discovered
+
+ # TODO(#1312): make this work properly
+ found_types.append("CUstreamAtomicReductionDataType_enum")
+
+ return found_types, found_functions, found_values, found_struct, struct_list
+
+
+# -----------------------------------------------------------------------
+# Code generation helpers
+
+
+def _fetch_input_files(path):
+ return [os.path.join(path, f) for f in os.listdir(path) if f.endswith(".in")]
+
+
+def _generate_output(infile, template_vars):
+ from Cython import Tempita
+
+ assert infile.endswith(".in")
+ outfile = infile[:-3]
+
+ with open(infile, encoding="utf-8") as f:
+ pxdcontent = Tempita.Template(f.read()).substitute(template_vars)
+
+ if os.path.exists(outfile):
+ with open(outfile, encoding="utf-8") as f:
+ if f.read() == pxdcontent:
+ print(f"Skipping {infile} (No change)", flush=True)
+ return
+ with open(outfile, "w", encoding="utf-8") as f:
+ print(f"Generating {infile}", flush=True)
+ f.write(pxdcontent)
+
+
+# -----------------------------------------------------------------------
+# Extension preparation helpers
+
+
+def _rename_architecture_specific_files():
+ path = os.path.join("cuda", "bindings", "_internal")
+ if sys.platform == "linux":
+ src_files = glob.glob(os.path.join(path, "*_linux.pyx"))
+ elif sys.platform == "win32":
+ src_files = glob.glob(os.path.join(path, "*_windows.pyx"))
+ else:
+ raise RuntimeError(f"platform is unrecognized: {sys.platform}")
+ dst_files = []
+ for src in src_files:
+ with tempfile.NamedTemporaryFile(delete=False, dir=".") as f:
+ shutil.copy2(src, f.name)
+ f_name = f.name
+ dst = src.replace("_linux", "").replace("_windows", "")
+ os.replace(f_name, f"./{dst}")
+ dst_files.append(dst)
+ return dst_files
+
+
+def _prep_extensions(sources, libraries, include_dirs, library_dirs, extra_compile_args, extra_link_args):
+ pattern = sources[0]
+ files = glob.glob(pattern)
+ libraries = libraries if libraries else []
+ exts = []
+ for pyx in files:
+ mod_name = pyx.replace(".pyx", "").replace(os.sep, ".").replace("/", ".")
+ exts.append(
+ Extension(
+ mod_name,
+ sources=[pyx, *sources[1:]],
+ include_dirs=include_dirs,
+ library_dirs=library_dirs,
+ runtime_library_dirs=[],
+ libraries=libraries,
+ language="c++",
+ extra_compile_args=extra_compile_args,
+ extra_link_args=extra_link_args,
+ )
+ )
+ return exts
+
+
+# -----------------------------------------------------------------------
+# Main build function
+
+
+def _build_cuda_bindings(strip=False):
+ """Build all cuda-bindings extensions.
+
+ All CUDA-dependent logic (header parsing, code generation, cythonization)
+ is deferred to this function so that metadata queries do not require a
+ CUDA toolkit installation.
+ """
+ from Cython.Build import cythonize
+
+ global _extensions
+
+ cuda_paths = _get_cuda_paths()
+
+ if os.environ.get("PARALLEL_LEVEL") is not None:
+ warn(
+ "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ nthreads = int(os.environ.get("PARALLEL_LEVEL", "0"))
+ else:
+ nthreads = int(os.environ.get("CUDA_PYTHON_PARALLEL_LEVEL", "0") or "0")
+
+ parser_caching = bool(os.environ.get("CUDA_PYTHON_PARSER_CACHING", False))
+ compile_for_coverage = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0")))
+
+ # Parse CUDA headers
+ include_path_list = [os.path.join(path, "include") for path in cuda_paths]
+ header_dict = _fetch_header_paths(_REQUIRED_HEADERS, include_path_list)
+ found_types, found_functions, found_values, found_struct, struct_list = _parse_headers(
+ header_dict, include_path_list, parser_caching
+ )
+ struct_field_types = {}
+ struct_field_array_lengths = {}
+ for struct_name, struct in struct_list.items():
+ for member_name in struct._member_names:
+ key = f"{struct_name}.{member_name}"
+ struct_field_types[key] = struct.member_type(member_name)
+ struct_field_array_lengths[key] = struct.member_array_length(member_name)
+
+ # Generate code from .in templates
+ path_list = [
+ os.path.join("cuda"),
+ os.path.join("cuda", "bindings"),
+ os.path.join("cuda", "bindings", "_bindings"),
+ os.path.join("cuda", "bindings", "_internal"),
+ os.path.join("cuda", "bindings", "_lib"),
+ os.path.join("cuda", "bindings", "utils"),
+ ]
+ input_files = []
+ for path in path_list:
+ input_files += _fetch_input_files(path)
+
+ import platform
+
+ template_vars = {
+ "found_types": found_types,
+ "found_functions": found_functions,
+ "found_values": found_values,
+ "found_struct": found_struct,
+ "struct_list": struct_list,
+ "struct_field_types": struct_field_types,
+ "struct_field_array_lengths": struct_field_array_lengths,
+ "os": os,
+ "sys": sys,
+ "platform": platform,
+ }
+ for file in input_files:
+ _generate_output(file, template_vars)
+
+ # Prepare compile/link arguments
+ include_dirs = [
+ os.path.dirname(sysconfig.get_path("include")),
+ ] + include_path_list
+ library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")]
+ cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"]
+ library_dirs.extend(os.path.join(prefix, subdir) for prefix in cuda_paths for subdir in cudalib_subdirs)
+
+ extra_compile_args = []
+ extra_link_args = []
+ extra_cythonize_kwargs = {}
+ if sys.platform != "win32":
+ extra_compile_args += [
+ "-std=c++14",
+ "-fpermissive",
+ "-Wno-deprecated-declarations",
+ "-fno-var-tracking-assignments",
+ ]
+ if "--debug" in sys.argv:
+ extra_cythonize_kwargs["gdb_debug"] = True
+ extra_compile_args += ["-g", "-O0"]
+ extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"]
+ else:
+ extra_compile_args += ["-O3"]
+ if strip and sys.platform == "linux":
+ extra_link_args += ["-Wl,--strip-all"]
+ if compile_for_coverage:
+ # CYTHON_TRACE_NOGIL indicates to trace nogil functions. It is not
+ # related to free-threading builds.
+ extra_compile_args += ["-DCYTHON_TRACE_NOGIL=1", "-DCYTHON_USE_SYS_MONITORING=0"]
+
+ # Rename architecture-specific files
+ dst_files = _rename_architecture_specific_files()
+
+ @atexit.register
+ def _cleanup_dst_files():
+ for dst in dst_files:
+ with contextlib.suppress(FileNotFoundError):
+ os.remove(dst)
+
+ # Build extension list
+ extensions = []
+ static_runtime_libraries = ["cudart_static", "rt"] if sys.platform == "linux" else ["cudart_static"]
+ cuda_bindings_files = glob.glob("cuda/bindings/*.pyx")
+ if sys.platform == "win32":
+ cuda_bindings_files = [f for f in cuda_bindings_files if "cufile" not in f]
+ sources_list = [
+ # private
+ (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries),
+ (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries),
+ # utils
+ (["cuda/bindings/utils/*.pyx"], None),
+ # public
+ *(([f], None) for f in cuda_bindings_files),
+ # public (deprecated, to be removed)
+ (["cuda/*.pyx"], None),
+ # internal files used by generated bindings
+ (["cuda/bindings/_internal/utils.pyx"], None),
+ *(([f], None) for f in dst_files if f.endswith(".pyx")),
+ ]
+
+ for sources, libraries in sources_list:
+ extensions += _prep_extensions(
+ sources, libraries, include_dirs, library_dirs, extra_compile_args, extra_link_args
+ )
+
+ # Cythonize
+ cython_directives = dict(language_level=3, embedsignature=True, binding=True, freethreading_compatible=True)
+ if compile_for_coverage:
+ cython_directives["linetrace"] = True
+
+ _extensions = cythonize(
+ extensions,
+ nthreads=nthreads,
+ build_dir="build/cython",
+ compiler_directives=cython_directives,
+ **extra_cythonize_kwargs,
+ )
+
+
+# -----------------------------------------------------------------------
+# PEP 517 build hooks
+
+
+def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
+ _build_cuda_bindings(strip=True)
+ return _build_meta.build_wheel(wheel_directory, config_settings, metadata_directory)
+
+
+def build_editable(wheel_directory, config_settings=None, metadata_directory=None):
+ _build_cuda_bindings(strip=False)
+ return _build_meta.build_editable(wheel_directory, config_settings, metadata_directory)
diff --git a/cuda_bindings_12/cuda/bindings/__init__.pxd b/cuda_bindings_12/cuda/bindings/__init__.pxd
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/cuda_bindings_12/cuda/bindings/__init__.py b/cuda_bindings_12/cuda/bindings/__init__.py
new file mode 100644
index 00000000000..ea1daae3e0b
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/__init__.py
@@ -0,0 +1,5 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+from cuda.bindings import utils
+from cuda.bindings._version import __version__
diff --git a/cuda_bindings_12/cuda/bindings/_bindings/__init__.py b/cuda_bindings_12/cuda/bindings/_bindings/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in
new file mode 100644
index 00000000000..52389ddf04a
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in
@@ -0,0 +1,1468 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=497222751557bdc4a8756fe4782b96e2baa2e59daf890a40b166d80f97a74bf8
+include "../cyruntime_types.pxi"
+
+include "../_lib/cyruntime/cyruntime.pxd"
+
+{{if 'cudaDeviceReset' in found_functions}}
+
+cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetByPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcGetEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcOpenEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcGetMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcOpenMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcCloseMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}}
+
+cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetLastError' in found_functions}}
+
+cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaPeekAtLastError' in found_functions}}
+
+cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetErrorName' in found_functions}}
+
+cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil
+{{endif}}
+
+{{if 'cudaGetErrorString' in found_functions}}
+
+cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil
+{{endif}}
+
+{{if 'cudaGetDeviceCount' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDeviceProperties_v2' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetDefaultMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetP2PAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaChooseDevice' in found_functions}}
+
+cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaInitDevice' in found_functions}}
+
+cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSetDevice' in found_functions}}
+
+cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreate' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreateWithPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetId' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCtxResetPersistingL2Cache' in found_functions}}
+
+cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamDestroy' in found_functions}}
+
+cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamWaitEvent' in found_functions}}
+
+cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamAddCallback' in found_functions}}
+
+cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamQuery' in found_functions}}
+
+cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamAttachMemAsync' in found_functions}}
+
+cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamBeginCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamBeginCaptureToGraph' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}}
+
+cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamEndCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamIsCapturing' in found_functions}}
+
+cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventCreate' in found_functions}}
+
+cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventRecord' in found_functions}}
+
+cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventRecordWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventQuery' in found_functions}}
+
+cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventDestroy' in found_functions}}
+
+cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventElapsedTime' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventElapsedTime_v2' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaImportExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaImportExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLaunchHostFunc' in found_functions}}
+
+cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocManaged' in found_functions}}
+
+cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc' in found_functions}}
+
+cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocHost' in found_functions}}
+
+cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocPitch' in found_functions}}
+
+cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFree' in found_functions}}
+
+cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeHost' in found_functions}}
+
+cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostAlloc' in found_functions}}
+
+cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostRegister' in found_functions}}
+
+cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostUnregister' in found_functions}}
+
+cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostGetDevicePointer' in found_functions}}
+
+cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc3D' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc3DArray' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetMipmappedArrayLevel' in found_functions}}
+
+cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetPlane' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset' in found_functions}}
+
+cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset2D' in found_functions}}
+
+cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset3D' in found_functions}}
+
+cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemsetAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemAdvise' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemAdvise_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemRangeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemRangeGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeAsync' in found_functions}}
+
+cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolTrimTo' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolSetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolGetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolCreate' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolDestroy' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocFromPoolAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolExportToShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolExportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolImportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaPointerGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceCanAccessPeer' in found_functions}}
+
+cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceEnablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceDisablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsUnregisterResource' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsMapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsUnmapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetChannelDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCreateChannelDesc' in found_functions}}
+
+cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil
+{{endif}}
+
+{{if 'cudaCreateTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectTextureDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCreateSurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroySurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDriverGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaRuntimeGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddKernelNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemsetNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddHostNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphHostNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddChildGraphNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}}
+
+cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEmptyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEventRecordNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEventWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemAllocNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemFreeNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGraphMemTrim' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeFindInClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetType' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetRootNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetEdges' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetEdges_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDestroyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiate' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeSetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecUpdate' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphUpload' in found_functions}}
+
+cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphLaunch' in found_functions}}
+
+cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDebugDotPrint' in found_functions}}
+
+cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectCreate' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectRetain' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectRelease' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRetainUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphReleaseUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddNode_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphConditionalHandleCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDriverEntryPoint' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDriverEntryPointByVersion' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryLoadData' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryLoadFromFile' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryUnload' in found_functions}}
+
+cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetGlobal' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetManaged' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetUnifiedFunction' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetKernelCount' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryEnumerateKernels' in found_functions}}
+
+cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaKernelSetAttributeForDevice' in found_functions}}
+
+cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetExportTable' in found_functions}}
+
+cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'make_cudaPitchedPtr' in found_functions}}
+
+cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil
+{{endif}}
+
+{{if 'make_cudaPos' in found_functions}}
+
+cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil
+{{endif}}
+
+{{if 'make_cudaExtent' in found_functions}}
+
+cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil
+{{endif}}
+
+{{if 'cudaProfilerStart' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaProfilerStop' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in
new file mode 100644
index 00000000000..eb86cdbf5aa
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in
@@ -0,0 +1,2659 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3eb7a8ac79c0415fa1dfeb13d6f9f72ff7ff9b867f08b683c267219576c8df15
+include "../cyruntime_functions.pxi"
+
+import os
+cimport cuda.bindings._bindings.cyruntime_ptds as ptds
+cimport cython
+
+cdef bint __cudaPythonInit = False
+cdef bint __usePTDS = False
+cdef int _cudaPythonInit() except -1 nogil:
+ global __cudaPythonInit
+ global __usePTDS
+
+ with gil:
+ __usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0)))
+ __cudaPythonInit = True
+ return __usePTDS
+
+# Create a very small function to check whether we are init'ed, so the C
+# compiler can inline it.
+cdef inline int cudaPythonInit() except -1 nogil:
+ if __cudaPythonInit:
+ return __usePTDS
+ return _cudaPythonInit()
+
+{{if 'cudaDeviceReset' in found_functions}}
+
+cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceReset()
+ return cudaDeviceReset()
+{{endif}}
+
+{{if 'cudaDeviceSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSynchronize()
+ return cudaDeviceSynchronize()
+{{endif}}
+
+{{if 'cudaDeviceSetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSetLimit(limit, value)
+ return cudaDeviceSetLimit(limit, value)
+{{endif}}
+
+{{if 'cudaDeviceGetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetLimit(pValue, limit)
+ return cudaDeviceGetLimit(pValue, limit)
+{{endif}}
+
+{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device)
+ return cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device)
+{{endif}}
+
+{{if 'cudaDeviceGetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetCacheConfig(pCacheConfig)
+ return cudaDeviceGetCacheConfig(pCacheConfig)
+{{endif}}
+
+{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority)
+ return cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority)
+{{endif}}
+
+{{if 'cudaDeviceSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSetCacheConfig(cacheConfig)
+ return cudaDeviceSetCacheConfig(cacheConfig)
+{{endif}}
+
+{{if 'cudaDeviceGetByPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetByPCIBusId(device, pciBusId)
+ return cudaDeviceGetByPCIBusId(device, pciBusId)
+{{endif}}
+
+{{if 'cudaDeviceGetPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetPCIBusId(pciBusId, length, device)
+ return cudaDeviceGetPCIBusId(pciBusId, length, device)
+{{endif}}
+
+{{if 'cudaIpcGetEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaIpcGetEventHandle(handle, event)
+ return cudaIpcGetEventHandle(handle, event)
+{{endif}}
+
+{{if 'cudaIpcOpenEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaIpcOpenEventHandle(event, handle)
+ return cudaIpcOpenEventHandle(event, handle)
+{{endif}}
+
+{{if 'cudaIpcGetMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaIpcGetMemHandle(handle, devPtr)
+ return cudaIpcGetMemHandle(handle, devPtr)
+{{endif}}
+
+{{if 'cudaIpcOpenMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaIpcOpenMemHandle(devPtr, handle, flags)
+ return cudaIpcOpenMemHandle(devPtr, handle, flags)
+{{endif}}
+
+{{if 'cudaIpcCloseMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaIpcCloseMemHandle(devPtr)
+ return cudaIpcCloseMemHandle(devPtr)
+{{endif}}
+
+{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}}
+
+cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceFlushGPUDirectRDMAWrites(target, scope)
+ return cudaDeviceFlushGPUDirectRDMAWrites(target, scope)
+{{endif}}
+
+{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback)
+ return cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback)
+{{endif}}
+
+{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceUnregisterAsyncNotification(device, callback)
+ return cudaDeviceUnregisterAsyncNotification(device, callback)
+{{endif}}
+
+{{if 'cudaDeviceGetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetSharedMemConfig(pConfig)
+ return cudaDeviceGetSharedMemConfig(pConfig)
+{{endif}}
+
+{{if 'cudaDeviceSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSetSharedMemConfig(config)
+ return cudaDeviceSetSharedMemConfig(config)
+{{endif}}
+
+{{if 'cudaGetLastError' in found_functions}}
+
+cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetLastError()
+ return cudaGetLastError()
+{{endif}}
+
+{{if 'cudaPeekAtLastError' in found_functions}}
+
+cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaPeekAtLastError()
+ return cudaPeekAtLastError()
+{{endif}}
+
+{{if 'cudaGetErrorName' in found_functions}}
+
+cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetErrorName(error)
+ return cudaGetErrorName(error)
+{{endif}}
+
+{{if 'cudaGetErrorString' in found_functions}}
+
+cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetErrorString(error)
+ return cudaGetErrorString(error)
+{{endif}}
+
+{{if 'cudaGetDeviceCount' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDeviceCount(count)
+ return cudaGetDeviceCount(count)
+{{endif}}
+
+{{if 'cudaGetDeviceProperties_v2' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDeviceProperties_v2(prop, device)
+ return cudaGetDeviceProperties_v2(prop, device)
+{{endif}}
+
+{{if 'cudaDeviceGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetAttribute(value, attr, device)
+ return cudaDeviceGetAttribute(value, attr, device)
+{{endif}}
+
+{{if 'cudaDeviceGetDefaultMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetDefaultMemPool(memPool, device)
+ return cudaDeviceGetDefaultMemPool(memPool, device)
+{{endif}}
+
+{{if 'cudaDeviceSetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSetMemPool(device, memPool)
+ return cudaDeviceSetMemPool(device, memPool)
+{{endif}}
+
+{{if 'cudaDeviceGetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetMemPool(memPool, device)
+ return cudaDeviceGetMemPool(memPool, device)
+{{endif}}
+
+{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags)
+ return cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags)
+{{endif}}
+
+{{if 'cudaDeviceGetP2PAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice)
+ return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice)
+{{endif}}
+
+{{if 'cudaChooseDevice' in found_functions}}
+
+cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaChooseDevice(device, prop)
+ return cudaChooseDevice(device, prop)
+{{endif}}
+
+{{if 'cudaInitDevice' in found_functions}}
+
+cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaInitDevice(device, deviceFlags, flags)
+ return cudaInitDevice(device, deviceFlags, flags)
+{{endif}}
+
+{{if 'cudaSetDevice' in found_functions}}
+
+cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaSetDevice(device)
+ return cudaSetDevice(device)
+{{endif}}
+
+{{if 'cudaGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDevice(device)
+ return cudaGetDevice(device)
+{{endif}}
+
+{{if 'cudaSetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaSetDeviceFlags(flags)
+ return cudaSetDeviceFlags(flags)
+{{endif}}
+
+{{if 'cudaGetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDeviceFlags(flags)
+ return cudaGetDeviceFlags(flags)
+{{endif}}
+
+{{if 'cudaStreamCreate' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamCreate(pStream)
+ return cudaStreamCreate(pStream)
+{{endif}}
+
+{{if 'cudaStreamCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamCreateWithFlags(pStream, flags)
+ return cudaStreamCreateWithFlags(pStream, flags)
+{{endif}}
+
+{{if 'cudaStreamCreateWithPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamCreateWithPriority(pStream, flags, priority)
+ return cudaStreamCreateWithPriority(pStream, flags, priority)
+{{endif}}
+
+{{if 'cudaStreamGetPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetPriority(hStream, priority)
+ return cudaStreamGetPriority(hStream, priority)
+{{endif}}
+
+{{if 'cudaStreamGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetFlags(hStream, flags)
+ return cudaStreamGetFlags(hStream, flags)
+{{endif}}
+
+{{if 'cudaStreamGetId' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetId(hStream, streamId)
+ return cudaStreamGetId(hStream, streamId)
+{{endif}}
+
+{{if 'cudaStreamGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetDevice(hStream, device)
+ return cudaStreamGetDevice(hStream, device)
+{{endif}}
+
+{{if 'cudaCtxResetPersistingL2Cache' in found_functions}}
+
+cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaCtxResetPersistingL2Cache()
+ return cudaCtxResetPersistingL2Cache()
+{{endif}}
+
+{{if 'cudaStreamCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamCopyAttributes(dst, src)
+ return cudaStreamCopyAttributes(dst, src)
+{{endif}}
+
+{{if 'cudaStreamGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetAttribute(hStream, attr, value_out)
+ return cudaStreamGetAttribute(hStream, attr, value_out)
+{{endif}}
+
+{{if 'cudaStreamSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamSetAttribute(hStream, attr, value)
+ return cudaStreamSetAttribute(hStream, attr, value)
+{{endif}}
+
+{{if 'cudaStreamDestroy' in found_functions}}
+
+cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamDestroy(stream)
+ return cudaStreamDestroy(stream)
+{{endif}}
+
+{{if 'cudaStreamWaitEvent' in found_functions}}
+
+cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamWaitEvent(stream, event, flags)
+ return cudaStreamWaitEvent(stream, event, flags)
+{{endif}}
+
+{{if 'cudaStreamAddCallback' in found_functions}}
+
+cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamAddCallback(stream, callback, userData, flags)
+ return cudaStreamAddCallback(stream, callback, userData, flags)
+{{endif}}
+
+{{if 'cudaStreamSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamSynchronize(stream)
+ return cudaStreamSynchronize(stream)
+{{endif}}
+
+{{if 'cudaStreamQuery' in found_functions}}
+
+cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamQuery(stream)
+ return cudaStreamQuery(stream)
+{{endif}}
+
+{{if 'cudaStreamAttachMemAsync' in found_functions}}
+
+cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamAttachMemAsync(stream, devPtr, length, flags)
+ return cudaStreamAttachMemAsync(stream, devPtr, length, flags)
+{{endif}}
+
+{{if 'cudaStreamBeginCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamBeginCapture(stream, mode)
+ return cudaStreamBeginCapture(stream, mode)
+{{endif}}
+
+{{if 'cudaStreamBeginCaptureToGraph' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode)
+ return cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode)
+{{endif}}
+
+{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}}
+
+cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaThreadExchangeStreamCaptureMode(mode)
+ return cudaThreadExchangeStreamCaptureMode(mode)
+{{endif}}
+
+{{if 'cudaStreamEndCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamEndCapture(stream, pGraph)
+ return cudaStreamEndCapture(stream, pGraph)
+{{endif}}
+
+{{if 'cudaStreamIsCapturing' in found_functions}}
+
+cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamIsCapturing(stream, pCaptureStatus)
+ return cudaStreamIsCapturing(stream, pCaptureStatus)
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
+ return cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out)
+ return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out)
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags)
+ return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags)
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags)
+ return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags)
+{{endif}}
+
+{{if 'cudaEventCreate' in found_functions}}
+
+cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventCreate(event)
+ return cudaEventCreate(event)
+{{endif}}
+
+{{if 'cudaEventCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventCreateWithFlags(event, flags)
+ return cudaEventCreateWithFlags(event, flags)
+{{endif}}
+
+{{if 'cudaEventRecord' in found_functions}}
+
+cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventRecord(event, stream)
+ return cudaEventRecord(event, stream)
+{{endif}}
+
+{{if 'cudaEventRecordWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventRecordWithFlags(event, stream, flags)
+ return cudaEventRecordWithFlags(event, stream, flags)
+{{endif}}
+
+{{if 'cudaEventQuery' in found_functions}}
+
+cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventQuery(event)
+ return cudaEventQuery(event)
+{{endif}}
+
+{{if 'cudaEventSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventSynchronize(event)
+ return cudaEventSynchronize(event)
+{{endif}}
+
+{{if 'cudaEventDestroy' in found_functions}}
+
+cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventDestroy(event)
+ return cudaEventDestroy(event)
+{{endif}}
+
+{{if 'cudaEventElapsedTime' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventElapsedTime(ms, start, end)
+ return cudaEventElapsedTime(ms, start, end)
+{{endif}}
+
+{{if 'cudaEventElapsedTime_v2' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaEventElapsedTime_v2(ms, start, end)
+ return cudaEventElapsedTime_v2(ms, start, end)
+{{endif}}
+
+{{if 'cudaImportExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaImportExternalMemory(extMem_out, memHandleDesc)
+ return cudaImportExternalMemory(extMem_out, memHandleDesc)
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc)
+ return cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc)
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc)
+ return cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc)
+{{endif}}
+
+{{if 'cudaDestroyExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDestroyExternalMemory(extMem)
+ return cudaDestroyExternalMemory(extMem)
+{{endif}}
+
+{{if 'cudaImportExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaImportExternalSemaphore(extSem_out, semHandleDesc)
+ return cudaImportExternalSemaphore(extSem_out, semHandleDesc)
+{{endif}}
+
+{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream)
+ return cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream)
+{{endif}}
+
+{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream)
+ return cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream)
+{{endif}}
+
+{{if 'cudaDestroyExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDestroyExternalSemaphore(extSem)
+ return cudaDestroyExternalSemaphore(extSem)
+{{endif}}
+
+{{if 'cudaFuncSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFuncSetCacheConfig(func, cacheConfig)
+ return cudaFuncSetCacheConfig(func, cacheConfig)
+{{endif}}
+
+{{if 'cudaFuncGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFuncGetAttributes(attr, func)
+ return cudaFuncGetAttributes(attr, func)
+{{endif}}
+
+{{if 'cudaFuncSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFuncSetAttribute(func, attr, value)
+ return cudaFuncSetAttribute(func, attr, value)
+{{endif}}
+
+{{if 'cudaLaunchHostFunc' in found_functions}}
+
+cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLaunchHostFunc(stream, fn, userData)
+ return cudaLaunchHostFunc(stream, fn, userData)
+{{endif}}
+
+{{if 'cudaFuncSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFuncSetSharedMemConfig(func, config)
+ return cudaFuncSetSharedMemConfig(func, config)
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize)
+ return cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize)
+{{endif}}
+
+{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize)
+ return cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize)
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags)
+ return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags)
+{{endif}}
+
+{{if 'cudaMallocManaged' in found_functions}}
+
+cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocManaged(devPtr, size, flags)
+ return cudaMallocManaged(devPtr, size, flags)
+{{endif}}
+
+{{if 'cudaMalloc' in found_functions}}
+
+cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMalloc(devPtr, size)
+ return cudaMalloc(devPtr, size)
+{{endif}}
+
+{{if 'cudaMallocHost' in found_functions}}
+
+cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocHost(ptr, size)
+ return cudaMallocHost(ptr, size)
+{{endif}}
+
+{{if 'cudaMallocPitch' in found_functions}}
+
+cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocPitch(devPtr, pitch, width, height)
+ return cudaMallocPitch(devPtr, pitch, width, height)
+{{endif}}
+
+{{if 'cudaMallocArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocArray(array, desc, width, height, flags)
+ return cudaMallocArray(array, desc, width, height, flags)
+{{endif}}
+
+{{if 'cudaFree' in found_functions}}
+
+cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFree(devPtr)
+ return cudaFree(devPtr)
+{{endif}}
+
+{{if 'cudaFreeHost' in found_functions}}
+
+cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFreeHost(ptr)
+ return cudaFreeHost(ptr)
+{{endif}}
+
+{{if 'cudaFreeArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFreeArray(array)
+ return cudaFreeArray(array)
+{{endif}}
+
+{{if 'cudaFreeMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFreeMipmappedArray(mipmappedArray)
+ return cudaFreeMipmappedArray(mipmappedArray)
+{{endif}}
+
+{{if 'cudaHostAlloc' in found_functions}}
+
+cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaHostAlloc(pHost, size, flags)
+ return cudaHostAlloc(pHost, size, flags)
+{{endif}}
+
+{{if 'cudaHostRegister' in found_functions}}
+
+cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaHostRegister(ptr, size, flags)
+ return cudaHostRegister(ptr, size, flags)
+{{endif}}
+
+{{if 'cudaHostUnregister' in found_functions}}
+
+cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaHostUnregister(ptr)
+ return cudaHostUnregister(ptr)
+{{endif}}
+
+{{if 'cudaHostGetDevicePointer' in found_functions}}
+
+cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaHostGetDevicePointer(pDevice, pHost, flags)
+ return cudaHostGetDevicePointer(pDevice, pHost, flags)
+{{endif}}
+
+{{if 'cudaHostGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaHostGetFlags(pFlags, pHost)
+ return cudaHostGetFlags(pFlags, pHost)
+{{endif}}
+
+{{if 'cudaMalloc3D' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMalloc3D(pitchedDevPtr, extent)
+ return cudaMalloc3D(pitchedDevPtr, extent)
+{{endif}}
+
+{{if 'cudaMalloc3DArray' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMalloc3DArray(array, desc, extent, flags)
+ return cudaMalloc3DArray(array, desc, extent, flags)
+{{endif}}
+
+{{if 'cudaMallocMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags)
+ return cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags)
+{{endif}}
+
+{{if 'cudaGetMipmappedArrayLevel' in found_functions}}
+
+cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level)
+ return cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level)
+{{endif}}
+
+{{if 'cudaMemcpy3D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy3D(p)
+ return cudaMemcpy3D(p)
+{{endif}}
+
+{{if 'cudaMemcpy3DPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy3DPeer(p)
+ return cudaMemcpy3DPeer(p)
+{{endif}}
+
+{{if 'cudaMemcpy3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy3DAsync(p, stream)
+ return cudaMemcpy3DAsync(p, stream)
+{{endif}}
+
+{{if 'cudaMemcpy3DPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy3DPeerAsync(p, stream)
+ return cudaMemcpy3DPeerAsync(p, stream)
+{{endif}}
+
+{{if 'cudaMemGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemGetInfo(free, total)
+ return cudaMemGetInfo(free, total)
+{{endif}}
+
+{{if 'cudaArrayGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaArrayGetInfo(desc, extent, flags, array)
+ return cudaArrayGetInfo(desc, extent, flags, array)
+{{endif}}
+
+{{if 'cudaArrayGetPlane' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaArrayGetPlane(pPlaneArray, hArray, planeIdx)
+ return cudaArrayGetPlane(pPlaneArray, hArray, planeIdx)
+{{endif}}
+
+{{if 'cudaArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaArrayGetMemoryRequirements(memoryRequirements, array, device)
+ return cudaArrayGetMemoryRequirements(memoryRequirements, array, device)
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device)
+ return cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device)
+{{endif}}
+
+{{if 'cudaArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaArrayGetSparseProperties(sparseProperties, array)
+ return cudaArrayGetSparseProperties(sparseProperties, array)
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap)
+ return cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap)
+{{endif}}
+
+{{if 'cudaMemcpy' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy(dst, src, count, kind)
+ return cudaMemcpy(dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count)
+ return cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count)
+{{endif}}
+
+{{if 'cudaMemcpy2D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind)
+ return cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind)
+ return cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind)
+ return cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind)
+ return cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpyAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyAsync(dst, src, count, kind, stream)
+ return cudaMemcpyAsync(dst, src, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpyPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)
+ return cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)
+{{endif}}
+
+{{if 'cudaMemcpyBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream)
+ return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream)
+{{endif}}
+
+{{if 'cudaMemcpy3DBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream)
+ return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream)
+ return cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream)
+ return cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream)
+ return cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemset' in found_functions}}
+
+cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemset(devPtr, value, count)
+ return cudaMemset(devPtr, value, count)
+{{endif}}
+
+{{if 'cudaMemset2D' in found_functions}}
+
+cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemset2D(devPtr, pitch, value, width, height)
+ return cudaMemset2D(devPtr, pitch, value, width, height)
+{{endif}}
+
+{{if 'cudaMemset3D' in found_functions}}
+
+cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemset3D(pitchedDevPtr, value, extent)
+ return cudaMemset3D(pitchedDevPtr, value, extent)
+{{endif}}
+
+{{if 'cudaMemsetAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemsetAsync(devPtr, value, count, stream)
+ return cudaMemsetAsync(devPtr, value, count, stream)
+{{endif}}
+
+{{if 'cudaMemset2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemset2DAsync(devPtr, pitch, value, width, height, stream)
+ return cudaMemset2DAsync(devPtr, pitch, value, width, height, stream)
+{{endif}}
+
+{{if 'cudaMemset3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemset3DAsync(pitchedDevPtr, value, extent, stream)
+ return cudaMemset3DAsync(pitchedDevPtr, value, extent, stream)
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPrefetchAsync(devPtr, count, dstDevice, stream)
+ return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream)
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream)
+ return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream)
+{{endif}}
+
+{{if 'cudaMemAdvise' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemAdvise(devPtr, count, advice, device)
+ return cudaMemAdvise(devPtr, count, advice, device)
+{{endif}}
+
+{{if 'cudaMemAdvise_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemAdvise_v2(devPtr, count, advice, location)
+ return cudaMemAdvise_v2(devPtr, count, advice, location)
+{{endif}}
+
+{{if 'cudaMemRangeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count)
+ return cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count)
+{{endif}}
+
+{{if 'cudaMemRangeGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count)
+ return cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count)
+{{endif}}
+
+{{if 'cudaMemcpyToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind)
+ return cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind)
+ return cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind)
+ return cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream)
+ return cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpyFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream)
+ return cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMallocAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocAsync(devPtr, size, hStream)
+ return cudaMallocAsync(devPtr, size, hStream)
+{{endif}}
+
+{{if 'cudaFreeAsync' in found_functions}}
+
+cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaFreeAsync(devPtr, hStream)
+ return cudaFreeAsync(devPtr, hStream)
+{{endif}}
+
+{{if 'cudaMemPoolTrimTo' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolTrimTo(memPool, minBytesToKeep)
+ return cudaMemPoolTrimTo(memPool, minBytesToKeep)
+{{endif}}
+
+{{if 'cudaMemPoolSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolSetAttribute(memPool, attr, value)
+ return cudaMemPoolSetAttribute(memPool, attr, value)
+{{endif}}
+
+{{if 'cudaMemPoolGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolGetAttribute(memPool, attr, value)
+ return cudaMemPoolGetAttribute(memPool, attr, value)
+{{endif}}
+
+{{if 'cudaMemPoolSetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolSetAccess(memPool, descList, count)
+ return cudaMemPoolSetAccess(memPool, descList, count)
+{{endif}}
+
+{{if 'cudaMemPoolGetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolGetAccess(flags, memPool, location)
+ return cudaMemPoolGetAccess(flags, memPool, location)
+{{endif}}
+
+{{if 'cudaMemPoolCreate' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolCreate(memPool, poolProps)
+ return cudaMemPoolCreate(memPool, poolProps)
+{{endif}}
+
+{{if 'cudaMemPoolDestroy' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolDestroy(memPool)
+ return cudaMemPoolDestroy(memPool)
+{{endif}}
+
+{{if 'cudaMallocFromPoolAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMallocFromPoolAsync(ptr, size, memPool, stream)
+ return cudaMallocFromPoolAsync(ptr, size, memPool, stream)
+{{endif}}
+
+{{if 'cudaMemPoolExportToShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags)
+ return cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags)
+{{endif}}
+
+{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags)
+ return cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags)
+{{endif}}
+
+{{if 'cudaMemPoolExportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolExportPointer(exportData, ptr)
+ return cudaMemPoolExportPointer(exportData, ptr)
+{{endif}}
+
+{{if 'cudaMemPoolImportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaMemPoolImportPointer(ptr, memPool, exportData)
+ return cudaMemPoolImportPointer(ptr, memPool, exportData)
+{{endif}}
+
+{{if 'cudaPointerGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaPointerGetAttributes(attributes, ptr)
+ return cudaPointerGetAttributes(attributes, ptr)
+{{endif}}
+
+{{if 'cudaDeviceCanAccessPeer' in found_functions}}
+
+cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice)
+ return cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice)
+{{endif}}
+
+{{if 'cudaDeviceEnablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceEnablePeerAccess(peerDevice, flags)
+ return cudaDeviceEnablePeerAccess(peerDevice, flags)
+{{endif}}
+
+{{if 'cudaDeviceDisablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceDisablePeerAccess(peerDevice)
+ return cudaDeviceDisablePeerAccess(peerDevice)
+{{endif}}
+
+{{if 'cudaGraphicsUnregisterResource' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsUnregisterResource(resource)
+ return cudaGraphicsUnregisterResource(resource)
+{{endif}}
+
+{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsResourceSetMapFlags(resource, flags)
+ return cudaGraphicsResourceSetMapFlags(resource, flags)
+{{endif}}
+
+{{if 'cudaGraphicsMapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsMapResources(count, resources, stream)
+ return cudaGraphicsMapResources(count, resources, stream)
+{{endif}}
+
+{{if 'cudaGraphicsUnmapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsUnmapResources(count, resources, stream)
+ return cudaGraphicsUnmapResources(count, resources, stream)
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsResourceGetMappedPointer(devPtr, size, resource)
+ return cudaGraphicsResourceGetMappedPointer(devPtr, size, resource)
+{{endif}}
+
+{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel)
+ return cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel)
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource)
+ return cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource)
+{{endif}}
+
+{{if 'cudaGetChannelDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetChannelDesc(desc, array)
+ return cudaGetChannelDesc(desc, array)
+{{endif}}
+
+{{if 'cudaCreateChannelDesc' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaCreateChannelDesc(x, y, z, w, f)
+ return cudaCreateChannelDesc(x, y, z, w, f)
+{{endif}}
+
+{{if 'cudaCreateTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc)
+ return cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc)
+{{endif}}
+
+{{if 'cudaDestroyTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDestroyTextureObject(texObject)
+ return cudaDestroyTextureObject(texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetTextureObjectResourceDesc(pResDesc, texObject)
+ return cudaGetTextureObjectResourceDesc(pResDesc, texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectTextureDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetTextureObjectTextureDesc(pTexDesc, texObject)
+ return cudaGetTextureObjectTextureDesc(pTexDesc, texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject)
+ return cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject)
+{{endif}}
+
+{{if 'cudaCreateSurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaCreateSurfaceObject(pSurfObject, pResDesc)
+ return cudaCreateSurfaceObject(pSurfObject, pResDesc)
+{{endif}}
+
+{{if 'cudaDestroySurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDestroySurfaceObject(surfObject)
+ return cudaDestroySurfaceObject(surfObject)
+{{endif}}
+
+{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject)
+ return cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject)
+{{endif}}
+
+{{if 'cudaDriverGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDriverGetVersion(driverVersion)
+ return cudaDriverGetVersion(driverVersion)
+{{endif}}
+
+{{if 'cudaRuntimeGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaRuntimeGetVersion(runtimeVersion)
+ return cudaRuntimeGetVersion(runtimeVersion)
+{{endif}}
+
+{{if 'cudaGraphCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphCreate(pGraph, flags)
+ return cudaGraphCreate(pGraph, flags)
+{{endif}}
+
+{{if 'cudaGraphAddKernelNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+ return cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphKernelNodeGetParams(node, pNodeParams)
+ return cudaGraphKernelNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphKernelNodeSetParams(node, pNodeParams)
+ return cudaGraphKernelNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphKernelNodeCopyAttributes(hSrc, hDst)
+ return cudaGraphKernelNodeCopyAttributes(hSrc, hDst)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphKernelNodeGetAttribute(hNode, attr, value_out)
+ return cudaGraphKernelNodeGetAttribute(hNode, attr, value_out)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphKernelNodeSetAttribute(hNode, attr, value)
+ return cudaGraphKernelNodeSetAttribute(hNode, attr, value)
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams)
+ return cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams)
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind)
+ return cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemcpyNodeGetParams(node, pNodeParams)
+ return cudaGraphMemcpyNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemcpyNodeSetParams(node, pNodeParams)
+ return cudaGraphMemcpyNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind)
+ return cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphAddMemsetNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams)
+ return cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams)
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemsetNodeGetParams(node, pNodeParams)
+ return cudaGraphMemsetNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemsetNodeSetParams(node, pNodeParams)
+ return cudaGraphMemsetNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddHostNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+ return cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphHostNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphHostNodeGetParams(node, pNodeParams)
+ return cudaGraphHostNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphHostNodeSetParams(node, pNodeParams)
+ return cudaGraphHostNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddChildGraphNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph)
+ return cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph)
+{{endif}}
+
+{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}}
+
+cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphChildGraphNodeGetGraph(node, pGraph)
+ return cudaGraphChildGraphNodeGetGraph(node, pGraph)
+{{endif}}
+
+{{if 'cudaGraphAddEmptyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies)
+ return cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphAddEventRecordNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event)
+ return cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event)
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphEventRecordNodeGetEvent(node, event_out)
+ return cudaGraphEventRecordNodeGetEvent(node, event_out)
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphEventRecordNodeSetEvent(node, event)
+ return cudaGraphEventRecordNodeSetEvent(node, event)
+{{endif}}
+
+{{if 'cudaGraphAddEventWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event)
+ return cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event)
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphEventWaitNodeGetEvent(node, event_out)
+ return cudaGraphEventWaitNodeGetEvent(node, event_out)
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphEventWaitNodeSetEvent(node, event)
+ return cudaGraphEventWaitNodeSetEvent(node, event)
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+ return cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out)
+ return cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams)
+ return cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+ return cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out)
+ return cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams)
+ return cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddMemAllocNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+ return cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemAllocNodeGetParams(node, params_out)
+ return cudaGraphMemAllocNodeGetParams(node, params_out)
+{{endif}}
+
+{{if 'cudaGraphAddMemFreeNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr)
+ return cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr)
+{{endif}}
+
+{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphMemFreeNodeGetParams(node, dptr_out)
+ return cudaGraphMemFreeNodeGetParams(node, dptr_out)
+{{endif}}
+
+{{if 'cudaDeviceGraphMemTrim' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGraphMemTrim(device)
+ return cudaDeviceGraphMemTrim(device)
+{{endif}}
+
+{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceGetGraphMemAttribute(device, attr, value)
+ return cudaDeviceGetGraphMemAttribute(device, attr, value)
+{{endif}}
+
+{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaDeviceSetGraphMemAttribute(device, attr, value)
+ return cudaDeviceSetGraphMemAttribute(device, attr, value)
+{{endif}}
+
+{{if 'cudaGraphClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphClone(pGraphClone, originalGraph)
+ return cudaGraphClone(pGraphClone, originalGraph)
+{{endif}}
+
+{{if 'cudaGraphNodeFindInClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph)
+ return cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph)
+{{endif}}
+
+{{if 'cudaGraphNodeGetType' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetType(node, pType)
+ return cudaGraphNodeGetType(node, pType)
+{{endif}}
+
+{{if 'cudaGraphGetNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphGetNodes(graph, nodes, numNodes)
+ return cudaGraphGetNodes(graph, nodes, numNodes)
+{{endif}}
+
+{{if 'cudaGraphGetRootNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes)
+ return cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes)
+{{endif}}
+
+{{if 'cudaGraphGetEdges' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphGetEdges(graph, from_, to, numEdges)
+ return cudaGraphGetEdges(graph, from_, to, numEdges)
+{{endif}}
+
+{{if 'cudaGraphGetEdges_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges)
+ return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies)
+ return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies)
+ return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes)
+ return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes)
+ return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes)
+{{endif}}
+
+{{if 'cudaGraphAddDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddDependencies(graph, from_, to, numDependencies)
+ return cudaGraphAddDependencies(graph, from_, to, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphAddDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies)
+ return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphRemoveDependencies(graph, from_, to, numDependencies)
+ return cudaGraphRemoveDependencies(graph, from_, to, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies)
+ return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphDestroyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphDestroyNode(node)
+ return cudaGraphDestroyNode(node)
+{{endif}}
+
+{{if 'cudaGraphInstantiate' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphInstantiate(pGraphExec, graph, flags)
+ return cudaGraphInstantiate(pGraphExec, graph, flags)
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
+ return cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams)
+ return cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams)
+{{endif}}
+
+{{if 'cudaGraphExecGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecGetFlags(graphExec, flags)
+ return cudaGraphExecGetFlags(graphExec, flags)
+{{endif}}
+
+{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams)
+ return cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams)
+ return cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind)
+ return cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams)
+ return cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams)
+ return cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph)
+ return cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph)
+{{endif}}
+
+{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event)
+ return cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event)
+{{endif}}
+
+{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event)
+ return cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event)
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams)
+ return cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams)
+ return cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphNodeSetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled)
+ return cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled)
+{{endif}}
+
+{{if 'cudaGraphNodeGetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled)
+ return cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled)
+{{endif}}
+
+{{if 'cudaGraphExecUpdate' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo)
+ return cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo)
+{{endif}}
+
+{{if 'cudaGraphUpload' in found_functions}}
+
+cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphUpload(graphExec, stream)
+ return cudaGraphUpload(graphExec, stream)
+{{endif}}
+
+{{if 'cudaGraphLaunch' in found_functions}}
+
+cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphLaunch(graphExec, stream)
+ return cudaGraphLaunch(graphExec, stream)
+{{endif}}
+
+{{if 'cudaGraphExecDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecDestroy(graphExec)
+ return cudaGraphExecDestroy(graphExec)
+{{endif}}
+
+{{if 'cudaGraphDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphDestroy(graph)
+ return cudaGraphDestroy(graph)
+{{endif}}
+
+{{if 'cudaGraphDebugDotPrint' in found_functions}}
+
+cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphDebugDotPrint(graph, path, flags)
+ return cudaGraphDebugDotPrint(graph, path, flags)
+{{endif}}
+
+{{if 'cudaUserObjectCreate' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags)
+ return cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags)
+{{endif}}
+
+{{if 'cudaUserObjectRetain' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaUserObjectRetain(object, count)
+ return cudaUserObjectRetain(object, count)
+{{endif}}
+
+{{if 'cudaUserObjectRelease' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaUserObjectRelease(object, count)
+ return cudaUserObjectRelease(object, count)
+{{endif}}
+
+{{if 'cudaGraphRetainUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphRetainUserObject(graph, object, count, flags)
+ return cudaGraphRetainUserObject(graph, object, count, flags)
+{{endif}}
+
+{{if 'cudaGraphReleaseUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphReleaseUserObject(graph, object, count)
+ return cudaGraphReleaseUserObject(graph, object, count)
+{{endif}}
+
+{{if 'cudaGraphAddNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+ return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddNode_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams)
+ return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphNodeSetParams(node, nodeParams)
+ return cudaGraphNodeSetParams(node, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphExecNodeSetParams(graphExec, node, nodeParams)
+ return cudaGraphExecNodeSetParams(graphExec, node, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphConditionalHandleCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags)
+ return cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags)
+{{endif}}
+
+{{if 'cudaGetDriverEntryPoint' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus)
+ return cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus)
+{{endif}}
+
+{{if 'cudaGetDriverEntryPointByVersion' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus)
+ return cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus)
+{{endif}}
+
+{{if 'cudaLibraryLoadData' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+ return cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+{{endif}}
+
+{{if 'cudaLibraryLoadFromFile' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+ return cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+{{endif}}
+
+{{if 'cudaLibraryUnload' in found_functions}}
+
+cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryUnload(library)
+ return cudaLibraryUnload(library)
+{{endif}}
+
+{{if 'cudaLibraryGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryGetKernel(pKernel, library, name)
+ return cudaLibraryGetKernel(pKernel, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetGlobal' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryGetGlobal(dptr, numbytes, library, name)
+ return cudaLibraryGetGlobal(dptr, numbytes, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetManaged' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryGetManaged(dptr, numbytes, library, name)
+ return cudaLibraryGetManaged(dptr, numbytes, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetUnifiedFunction' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryGetUnifiedFunction(fptr, library, symbol)
+ return cudaLibraryGetUnifiedFunction(fptr, library, symbol)
+{{endif}}
+
+{{if 'cudaLibraryGetKernelCount' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryGetKernelCount(count, lib)
+ return cudaLibraryGetKernelCount(count, lib)
+{{endif}}
+
+{{if 'cudaLibraryEnumerateKernels' in found_functions}}
+
+cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaLibraryEnumerateKernels(kernels, numKernels, lib)
+ return cudaLibraryEnumerateKernels(kernels, numKernels, lib)
+{{endif}}
+
+{{if 'cudaKernelSetAttributeForDevice' in found_functions}}
+
+cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaKernelSetAttributeForDevice(kernel, attr, value, device)
+ return cudaKernelSetAttributeForDevice(kernel, attr, value, device)
+{{endif}}
+
+{{if 'cudaGetExportTable' in found_functions}}
+
+cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetExportTable(ppExportTable, pExportTableId)
+ return cudaGetExportTable(ppExportTable, pExportTableId)
+{{endif}}
+
+{{if 'cudaGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaGetKernel(kernelPtr, entryFuncAddr)
+ return cudaGetKernel(kernelPtr, entryFuncAddr)
+{{endif}}
+
+{{if 'make_cudaPitchedPtr' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._make_cudaPitchedPtr(d, p, xsz, ysz)
+ return make_cudaPitchedPtr(d, p, xsz, ysz)
+{{endif}}
+
+{{if 'make_cudaPos' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._make_cudaPos(x, y, z)
+ return make_cudaPos(x, y, z)
+{{endif}}
+
+{{if 'make_cudaExtent' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._make_cudaExtent(w, h, d)
+ return make_cudaExtent(w, h, d)
+{{endif}}
+
+{{if 'cudaProfilerStart' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaProfilerStart()
+ return cudaProfilerStart()
+{{endif}}
+
+{{if 'cudaProfilerStop' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:
+ cdef bint usePTDS = cudaPythonInit()
+ if usePTDS:
+ return ptds._cudaProfilerStop()
+ return cudaProfilerStop()
+{{endif}}
+
+
+include "../_lib/cyruntime/cyruntime.pxi"
diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in
new file mode 100644
index 00000000000..43792e1e18c
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in
@@ -0,0 +1,1471 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=58ec8deb9f130e6305b7842d14d609fd871cd1d3f7bf0f0ff714957cd77772b5
+cdef extern from "":
+ """
+ #define CUDA_API_PER_THREAD_DEFAULT_STREAM
+ """
+
+include "../cyruntime_types.pxi"
+
+{{if 'cudaDeviceReset' in found_functions}}
+
+cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetByPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcGetEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcOpenEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcGetMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcOpenMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaIpcCloseMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}}
+
+cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetLastError' in found_functions}}
+
+cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaPeekAtLastError' in found_functions}}
+
+cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetErrorName' in found_functions}}
+
+cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil
+{{endif}}
+
+{{if 'cudaGetErrorString' in found_functions}}
+
+cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil
+{{endif}}
+
+{{if 'cudaGetDeviceCount' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDeviceProperties_v2' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetDefaultMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetP2PAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaChooseDevice' in found_functions}}
+
+cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaInitDevice' in found_functions}}
+
+cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSetDevice' in found_functions}}
+
+cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreate' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCreateWithPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetId' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCtxResetPersistingL2Cache' in found_functions}}
+
+cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamDestroy' in found_functions}}
+
+cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamWaitEvent' in found_functions}}
+
+cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamAddCallback' in found_functions}}
+
+cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamQuery' in found_functions}}
+
+cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamAttachMemAsync' in found_functions}}
+
+cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamBeginCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamBeginCaptureToGraph' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}}
+
+cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamEndCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamIsCapturing' in found_functions}}
+
+cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventCreate' in found_functions}}
+
+cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventRecord' in found_functions}}
+
+cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventRecordWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventQuery' in found_functions}}
+
+cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventDestroy' in found_functions}}
+
+cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventElapsedTime' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaEventElapsedTime_v2' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaImportExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaImportExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLaunchHostFunc' in found_functions}}
+
+cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFuncSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocManaged' in found_functions}}
+
+cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc' in found_functions}}
+
+cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocHost' in found_functions}}
+
+cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocPitch' in found_functions}}
+
+cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFree' in found_functions}}
+
+cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeHost' in found_functions}}
+
+cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostAlloc' in found_functions}}
+
+cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostRegister' in found_functions}}
+
+cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostUnregister' in found_functions}}
+
+cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostGetDevicePointer' in found_functions}}
+
+cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaHostGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc3D' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMalloc3DArray' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetMipmappedArrayLevel' in found_functions}}
+
+cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetPlane' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy3DBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset' in found_functions}}
+
+cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset2D' in found_functions}}
+
+cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset3D' in found_functions}}
+
+cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemsetAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemset3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemAdvise' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemAdvise_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemRangeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemRangeGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemcpyFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaFreeAsync' in found_functions}}
+
+cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolTrimTo' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolSetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolGetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolCreate' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolDestroy' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMallocFromPoolAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolExportToShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolExportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaMemPoolImportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaPointerGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceCanAccessPeer' in found_functions}}
+
+cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceEnablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceDisablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsUnregisterResource' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsMapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsUnmapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetChannelDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCreateChannelDesc' in found_functions}}
+
+cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil
+{{endif}}
+
+{{if 'cudaCreateTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroyTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectTextureDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaCreateSurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDestroySurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDriverGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaRuntimeGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddKernelNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemsetNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddHostNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphHostNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddChildGraphNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}}
+
+cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEmptyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEventRecordNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddEventWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemAllocNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddMemFreeNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGraphMemTrim' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeFindInClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetType' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetRootNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetEdges' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphGetEdges_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDestroyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiate' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeSetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeGetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecUpdate' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphUpload' in found_functions}}
+
+cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphLaunch' in found_functions}}
+
+cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphDebugDotPrint' in found_functions}}
+
+cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectCreate' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectRetain' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaUserObjectRelease' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphRetainUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphReleaseUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphAddNode_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphExecNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGraphConditionalHandleCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDriverEntryPoint' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetDriverEntryPointByVersion' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryLoadData' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryLoadFromFile' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryUnload' in found_functions}}
+
+cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetGlobal' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetManaged' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetUnifiedFunction' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryGetKernelCount' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaLibraryEnumerateKernels' in found_functions}}
+
+cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaKernelSetAttributeForDevice' in found_functions}}
+
+cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetExportTable' in found_functions}}
+
+cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'make_cudaPitchedPtr' in found_functions}}
+
+cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil
+{{endif}}
+
+{{if 'make_cudaPos' in found_functions}}
+
+cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil
+{{endif}}
+
+{{if 'make_cudaExtent' in found_functions}}
+
+cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil
+{{endif}}
+
+{{if 'cudaProfilerStart' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
+
+{{if 'cudaProfilerStop' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil
+{{endif}}
diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in
new file mode 100644
index 00000000000..df2a7422a95
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in
@@ -0,0 +1,1765 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9ef99cae70f08efa9f2a007ad5234e8632e797d6fd4109ca8e61034c69bd9658
+cdef extern from "":
+ """
+ #define CUDA_API_PER_THREAD_DEFAULT_STREAM
+ """
+
+include "../cyruntime_functions.pxi"
+
+cimport cython
+
+{{if 'cudaDeviceReset' in found_functions}}
+
+cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceReset()
+{{endif}}
+
+{{if 'cudaDeviceSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSynchronize()
+{{endif}}
+
+{{if 'cudaDeviceSetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSetLimit(limit, value)
+{{endif}}
+
+{{if 'cudaDeviceGetLimit' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetLimit(pValue, limit)
+{{endif}}
+
+{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device)
+{{endif}}
+
+{{if 'cudaDeviceGetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetCacheConfig(pCacheConfig)
+{{endif}}
+
+{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority)
+{{endif}}
+
+{{if 'cudaDeviceSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSetCacheConfig(cacheConfig)
+{{endif}}
+
+{{if 'cudaDeviceGetByPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetByPCIBusId(device, pciBusId)
+{{endif}}
+
+{{if 'cudaDeviceGetPCIBusId' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetPCIBusId(pciBusId, length, device)
+{{endif}}
+
+{{if 'cudaIpcGetEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaIpcGetEventHandle(handle, event)
+{{endif}}
+
+{{if 'cudaIpcOpenEventHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaIpcOpenEventHandle(event, handle)
+{{endif}}
+
+{{if 'cudaIpcGetMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaIpcGetMemHandle(handle, devPtr)
+{{endif}}
+
+{{if 'cudaIpcOpenMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaIpcOpenMemHandle(devPtr, handle, flags)
+{{endif}}
+
+{{if 'cudaIpcCloseMemHandle' in found_functions}}
+
+cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaIpcCloseMemHandle(devPtr)
+{{endif}}
+
+{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}}
+
+cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceFlushGPUDirectRDMAWrites(target, scope)
+{{endif}}
+
+{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback)
+{{endif}}
+
+{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}}
+
+cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceUnregisterAsyncNotification(device, callback)
+{{endif}}
+
+{{if 'cudaDeviceGetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetSharedMemConfig(pConfig)
+{{endif}}
+
+{{if 'cudaDeviceSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSetSharedMemConfig(config)
+{{endif}}
+
+{{if 'cudaGetLastError' in found_functions}}
+
+cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetLastError()
+{{endif}}
+
+{{if 'cudaPeekAtLastError' in found_functions}}
+
+cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaPeekAtLastError()
+{{endif}}
+
+{{if 'cudaGetErrorName' in found_functions}}
+
+cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil:
+ return cudaGetErrorName(error)
+{{endif}}
+
+{{if 'cudaGetErrorString' in found_functions}}
+
+cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil:
+ return cudaGetErrorString(error)
+{{endif}}
+
+{{if 'cudaGetDeviceCount' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDeviceCount(count)
+{{endif}}
+
+{{if 'cudaGetDeviceProperties_v2' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDeviceProperties_v2(prop, device)
+{{endif}}
+
+{{if 'cudaDeviceGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetAttribute(value, attr, device)
+{{endif}}
+
+{{if 'cudaDeviceGetDefaultMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetDefaultMemPool(memPool, device)
+{{endif}}
+
+{{if 'cudaDeviceSetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSetMemPool(device, memPool)
+{{endif}}
+
+{{if 'cudaDeviceGetMemPool' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetMemPool(memPool, device)
+{{endif}}
+
+{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags)
+{{endif}}
+
+{{if 'cudaDeviceGetP2PAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice)
+{{endif}}
+
+{{if 'cudaChooseDevice' in found_functions}}
+
+cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaChooseDevice(device, prop)
+{{endif}}
+
+{{if 'cudaInitDevice' in found_functions}}
+
+cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaInitDevice(device, deviceFlags, flags)
+{{endif}}
+
+{{if 'cudaSetDevice' in found_functions}}
+
+cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaSetDevice(device)
+{{endif}}
+
+{{if 'cudaGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDevice(device)
+{{endif}}
+
+{{if 'cudaSetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaSetDeviceFlags(flags)
+{{endif}}
+
+{{if 'cudaGetDeviceFlags' in found_functions}}
+
+cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDeviceFlags(flags)
+{{endif}}
+
+{{if 'cudaStreamCreate' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamCreate(pStream)
+{{endif}}
+
+{{if 'cudaStreamCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamCreateWithFlags(pStream, flags)
+{{endif}}
+
+{{if 'cudaStreamCreateWithPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamCreateWithPriority(pStream, flags, priority)
+{{endif}}
+
+{{if 'cudaStreamGetPriority' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetPriority(hStream, priority)
+{{endif}}
+
+{{if 'cudaStreamGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetFlags(hStream, flags)
+{{endif}}
+
+{{if 'cudaStreamGetId' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetId(hStream, streamId)
+{{endif}}
+
+{{if 'cudaStreamGetDevice' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetDevice(hStream, device)
+{{endif}}
+
+{{if 'cudaCtxResetPersistingL2Cache' in found_functions}}
+
+cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaCtxResetPersistingL2Cache()
+{{endif}}
+
+{{if 'cudaStreamCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamCopyAttributes(dst, src)
+{{endif}}
+
+{{if 'cudaStreamGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetAttribute(hStream, attr, value_out)
+{{endif}}
+
+{{if 'cudaStreamSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamSetAttribute(hStream, attr, value)
+{{endif}}
+
+{{if 'cudaStreamDestroy' in found_functions}}
+
+cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamDestroy(stream)
+{{endif}}
+
+{{if 'cudaStreamWaitEvent' in found_functions}}
+
+cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamWaitEvent(stream, event, flags)
+{{endif}}
+
+{{if 'cudaStreamAddCallback' in found_functions}}
+
+cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamAddCallback(stream, callback, userData, flags)
+{{endif}}
+
+{{if 'cudaStreamSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamSynchronize(stream)
+{{endif}}
+
+{{if 'cudaStreamQuery' in found_functions}}
+
+cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamQuery(stream)
+{{endif}}
+
+{{if 'cudaStreamAttachMemAsync' in found_functions}}
+
+cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamAttachMemAsync(stream, devPtr, length, flags)
+{{endif}}
+
+{{if 'cudaStreamBeginCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamBeginCapture(stream, mode)
+{{endif}}
+
+{{if 'cudaStreamBeginCaptureToGraph' in found_functions}}
+
+cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode)
+{{endif}}
+
+{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}}
+
+cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaThreadExchangeStreamCaptureMode(mode)
+{{endif}}
+
+{{if 'cudaStreamEndCapture' in found_functions}}
+
+cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamEndCapture(stream, pGraph)
+{{endif}}
+
+{{if 'cudaStreamIsCapturing' in found_functions}}
+
+cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamIsCapturing(stream, pCaptureStatus)
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetCaptureInfo_v2_ptsz(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
+{{endif}}
+
+{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}}
+
+cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out)
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags)
+{{endif}}
+
+{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags)
+{{endif}}
+
+{{if 'cudaEventCreate' in found_functions}}
+
+cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventCreate(event)
+{{endif}}
+
+{{if 'cudaEventCreateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventCreateWithFlags(event, flags)
+{{endif}}
+
+{{if 'cudaEventRecord' in found_functions}}
+
+cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventRecord(event, stream)
+{{endif}}
+
+{{if 'cudaEventRecordWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventRecordWithFlags(event, stream, flags)
+{{endif}}
+
+{{if 'cudaEventQuery' in found_functions}}
+
+cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventQuery(event)
+{{endif}}
+
+{{if 'cudaEventSynchronize' in found_functions}}
+
+cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventSynchronize(event)
+{{endif}}
+
+{{if 'cudaEventDestroy' in found_functions}}
+
+cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventDestroy(event)
+{{endif}}
+
+{{if 'cudaEventElapsedTime' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventElapsedTime(ms, start, end)
+{{endif}}
+
+{{if 'cudaEventElapsedTime_v2' in found_functions}}
+
+cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaEventElapsedTime_v2(ms, start, end)
+{{endif}}
+
+{{if 'cudaImportExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaImportExternalMemory(extMem_out, memHandleDesc)
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc)
+{{endif}}
+
+{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc)
+{{endif}}
+
+{{if 'cudaDestroyExternalMemory' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDestroyExternalMemory(extMem)
+{{endif}}
+
+{{if 'cudaImportExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaImportExternalSemaphore(extSem_out, semHandleDesc)
+{{endif}}
+
+{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaSignalExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream)
+{{endif}}
+
+{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaWaitExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream)
+{{endif}}
+
+{{if 'cudaDestroyExternalSemaphore' in found_functions}}
+
+cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDestroyExternalSemaphore(extSem)
+{{endif}}
+
+{{if 'cudaFuncSetCacheConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFuncSetCacheConfig(func, cacheConfig)
+{{endif}}
+
+{{if 'cudaFuncGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFuncGetAttributes(attr, func)
+{{endif}}
+
+{{if 'cudaFuncSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFuncSetAttribute(func, attr, value)
+{{endif}}
+
+{{if 'cudaLaunchHostFunc' in found_functions}}
+
+cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLaunchHostFunc(stream, fn, userData)
+{{endif}}
+
+{{if 'cudaFuncSetSharedMemConfig' in found_functions}}
+
+cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFuncSetSharedMemConfig(func, config)
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize)
+{{endif}}
+
+{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize)
+{{endif}}
+
+{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags)
+{{endif}}
+
+{{if 'cudaMallocManaged' in found_functions}}
+
+cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocManaged(devPtr, size, flags)
+{{endif}}
+
+{{if 'cudaMalloc' in found_functions}}
+
+cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMalloc(devPtr, size)
+{{endif}}
+
+{{if 'cudaMallocHost' in found_functions}}
+
+cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocHost(ptr, size)
+{{endif}}
+
+{{if 'cudaMallocPitch' in found_functions}}
+
+cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocPitch(devPtr, pitch, width, height)
+{{endif}}
+
+{{if 'cudaMallocArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocArray(array, desc, width, height, flags)
+{{endif}}
+
+{{if 'cudaFree' in found_functions}}
+
+cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFree(devPtr)
+{{endif}}
+
+{{if 'cudaFreeHost' in found_functions}}
+
+cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFreeHost(ptr)
+{{endif}}
+
+{{if 'cudaFreeArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFreeArray(array)
+{{endif}}
+
+{{if 'cudaFreeMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFreeMipmappedArray(mipmappedArray)
+{{endif}}
+
+{{if 'cudaHostAlloc' in found_functions}}
+
+cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaHostAlloc(pHost, size, flags)
+{{endif}}
+
+{{if 'cudaHostRegister' in found_functions}}
+
+cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaHostRegister(ptr, size, flags)
+{{endif}}
+
+{{if 'cudaHostUnregister' in found_functions}}
+
+cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaHostUnregister(ptr)
+{{endif}}
+
+{{if 'cudaHostGetDevicePointer' in found_functions}}
+
+cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaHostGetDevicePointer(pDevice, pHost, flags)
+{{endif}}
+
+{{if 'cudaHostGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaHostGetFlags(pFlags, pHost)
+{{endif}}
+
+{{if 'cudaMalloc3D' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMalloc3D(pitchedDevPtr, extent)
+{{endif}}
+
+{{if 'cudaMalloc3DArray' in found_functions}}
+
+cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMalloc3DArray(array, desc, extent, flags)
+{{endif}}
+
+{{if 'cudaMallocMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags)
+{{endif}}
+
+{{if 'cudaGetMipmappedArrayLevel' in found_functions}}
+
+cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level)
+{{endif}}
+
+{{if 'cudaMemcpy3D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy3D(p)
+{{endif}}
+
+{{if 'cudaMemcpy3DPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy3DPeer(p)
+{{endif}}
+
+{{if 'cudaMemcpy3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy3DAsync(p, stream)
+{{endif}}
+
+{{if 'cudaMemcpy3DPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy3DPeerAsync(p, stream)
+{{endif}}
+
+{{if 'cudaMemGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemGetInfo(free, total)
+{{endif}}
+
+{{if 'cudaArrayGetInfo' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaArrayGetInfo(desc, extent, flags, array)
+{{endif}}
+
+{{if 'cudaArrayGetPlane' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaArrayGetPlane(pPlaneArray, hArray, planeIdx)
+{{endif}}
+
+{{if 'cudaArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaArrayGetMemoryRequirements(memoryRequirements, array, device)
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device)
+{{endif}}
+
+{{if 'cudaArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaArrayGetSparseProperties(sparseProperties, array)
+{{endif}}
+
+{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}}
+
+cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap)
+{{endif}}
+
+{{if 'cudaMemcpy' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy(dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyPeer' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count)
+{{endif}}
+
+{{if 'cudaMemcpy2D' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpy2DArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind)
+{{endif}}
+
+{{if 'cudaMemcpyAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyAsync(dst, src, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpyPeerAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)
+{{endif}}
+
+{{if 'cudaMemcpyBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream)
+{{endif}}
+
+{{if 'cudaMemcpy3DBatchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream)
+{{endif}}
+
+{{if 'cudaMemset' in found_functions}}
+
+cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemset(devPtr, value, count)
+{{endif}}
+
+{{if 'cudaMemset2D' in found_functions}}
+
+cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemset2D(devPtr, pitch, value, width, height)
+{{endif}}
+
+{{if 'cudaMemset3D' in found_functions}}
+
+cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemset3D(pitchedDevPtr, value, extent)
+{{endif}}
+
+{{if 'cudaMemsetAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemsetAsync(devPtr, value, count, stream)
+{{endif}}
+
+{{if 'cudaMemset2DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemset2DAsync(devPtr, pitch, value, width, height, stream)
+{{endif}}
+
+{{if 'cudaMemset3DAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemset3DAsync(pitchedDevPtr, value, extent, stream)
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream)
+{{endif}}
+
+{{if 'cudaMemPrefetchAsync_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream)
+{{endif}}
+
+{{if 'cudaMemAdvise' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemAdvise(devPtr, count, advice, device)
+{{endif}}
+
+{{if 'cudaMemAdvise_v2' in found_functions}}
+
+cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemAdvise_v2(devPtr, count, advice, location)
+{{endif}}
+
+{{if 'cudaMemRangeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count)
+{{endif}}
+
+{{if 'cudaMemRangeGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count)
+{{endif}}
+
+{{if 'cudaMemcpyToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyFromArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyArrayToArray' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind)
+{{endif}}
+
+{{if 'cudaMemcpyToArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMemcpyFromArrayAsync' in found_functions}}
+
+cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream)
+{{endif}}
+
+{{if 'cudaMallocAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocAsync(devPtr, size, hStream)
+{{endif}}
+
+{{if 'cudaFreeAsync' in found_functions}}
+
+cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaFreeAsync(devPtr, hStream)
+{{endif}}
+
+{{if 'cudaMemPoolTrimTo' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolTrimTo(memPool, minBytesToKeep)
+{{endif}}
+
+{{if 'cudaMemPoolSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolSetAttribute(memPool, attr, value)
+{{endif}}
+
+{{if 'cudaMemPoolGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolGetAttribute(memPool, attr, value)
+{{endif}}
+
+{{if 'cudaMemPoolSetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolSetAccess(memPool, descList, count)
+{{endif}}
+
+{{if 'cudaMemPoolGetAccess' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolGetAccess(flags, memPool, location)
+{{endif}}
+
+{{if 'cudaMemPoolCreate' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolCreate(memPool, poolProps)
+{{endif}}
+
+{{if 'cudaMemPoolDestroy' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolDestroy(memPool)
+{{endif}}
+
+{{if 'cudaMallocFromPoolAsync' in found_functions}}
+
+cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMallocFromPoolAsync(ptr, size, memPool, stream)
+{{endif}}
+
+{{if 'cudaMemPoolExportToShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags)
+{{endif}}
+
+{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags)
+{{endif}}
+
+{{if 'cudaMemPoolExportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolExportPointer(exportData, ptr)
+{{endif}}
+
+{{if 'cudaMemPoolImportPointer' in found_functions}}
+
+cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaMemPoolImportPointer(ptr, memPool, exportData)
+{{endif}}
+
+{{if 'cudaPointerGetAttributes' in found_functions}}
+
+cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaPointerGetAttributes(attributes, ptr)
+{{endif}}
+
+{{if 'cudaDeviceCanAccessPeer' in found_functions}}
+
+cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice)
+{{endif}}
+
+{{if 'cudaDeviceEnablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceEnablePeerAccess(peerDevice, flags)
+{{endif}}
+
+{{if 'cudaDeviceDisablePeerAccess' in found_functions}}
+
+cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceDisablePeerAccess(peerDevice)
+{{endif}}
+
+{{if 'cudaGraphicsUnregisterResource' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsUnregisterResource(resource)
+{{endif}}
+
+{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsResourceSetMapFlags(resource, flags)
+{{endif}}
+
+{{if 'cudaGraphicsMapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsMapResources(count, resources, stream)
+{{endif}}
+
+{{if 'cudaGraphicsUnmapResources' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsUnmapResources(count, resources, stream)
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsResourceGetMappedPointer(devPtr, size, resource)
+{{endif}}
+
+{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel)
+{{endif}}
+
+{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}}
+
+cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource)
+{{endif}}
+
+{{if 'cudaGetChannelDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetChannelDesc(desc, array)
+{{endif}}
+
+{{if 'cudaCreateChannelDesc' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil:
+ return cudaCreateChannelDesc(x, y, z, w, f)
+{{endif}}
+
+{{if 'cudaCreateTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc)
+{{endif}}
+
+{{if 'cudaDestroyTextureObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDestroyTextureObject(texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetTextureObjectResourceDesc(pResDesc, texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectTextureDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetTextureObjectTextureDesc(pTexDesc, texObject)
+{{endif}}
+
+{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject)
+{{endif}}
+
+{{if 'cudaCreateSurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaCreateSurfaceObject(pSurfObject, pResDesc)
+{{endif}}
+
+{{if 'cudaDestroySurfaceObject' in found_functions}}
+
+cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDestroySurfaceObject(surfObject)
+{{endif}}
+
+{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}}
+
+cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject)
+{{endif}}
+
+{{if 'cudaDriverGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDriverGetVersion(driverVersion)
+{{endif}}
+
+{{if 'cudaRuntimeGetVersion' in found_functions}}
+
+cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaRuntimeGetVersion(runtimeVersion)
+{{endif}}
+
+{{if 'cudaGraphCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphCreate(pGraph, flags)
+{{endif}}
+
+{{if 'cudaGraphAddKernelNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphKernelNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphKernelNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphKernelNodeCopyAttributes(hSrc, hDst)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphKernelNodeGetAttribute(hNode, attr, value_out)
+{{endif}}
+
+{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}}
+
+cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphKernelNodeSetAttribute(hNode, attr, value)
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams)
+{{endif}}
+
+{{if 'cudaGraphAddMemcpyNode1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemcpyNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemcpyNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphAddMemsetNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams)
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemsetNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemsetNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddHostNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphHostNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphHostNodeGetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphHostNodeSetParams(node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddChildGraphNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph)
+{{endif}}
+
+{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}}
+
+cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphChildGraphNodeGetGraph(node, pGraph)
+{{endif}}
+
+{{if 'cudaGraphAddEmptyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphAddEventRecordNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event)
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphEventRecordNodeGetEvent(node, event_out)
+{{endif}}
+
+{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphEventRecordNodeSetEvent(node, event)
+{{endif}}
+
+{{if 'cudaGraphAddEventWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event)
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphEventWaitNodeGetEvent(node, event_out)
+{{endif}}
+
+{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphEventWaitNodeSetEvent(node, event)
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out)
+{{endif}}
+
+{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddMemAllocNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemAllocNodeGetParams(node, params_out)
+{{endif}}
+
+{{if 'cudaGraphAddMemFreeNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr)
+{{endif}}
+
+{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphMemFreeNodeGetParams(node, dptr_out)
+{{endif}}
+
+{{if 'cudaDeviceGraphMemTrim' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGraphMemTrim(device)
+{{endif}}
+
+{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceGetGraphMemAttribute(device, attr, value)
+{{endif}}
+
+{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}}
+
+cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaDeviceSetGraphMemAttribute(device, attr, value)
+{{endif}}
+
+{{if 'cudaGraphClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphClone(pGraphClone, originalGraph)
+{{endif}}
+
+{{if 'cudaGraphNodeFindInClone' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph)
+{{endif}}
+
+{{if 'cudaGraphNodeGetType' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetType(node, pType)
+{{endif}}
+
+{{if 'cudaGraphGetNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphGetNodes(graph, nodes, numNodes)
+{{endif}}
+
+{{if 'cudaGraphGetRootNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes)
+{{endif}}
+
+{{if 'cudaGraphGetEdges' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphGetEdges(graph, from_, to, numEdges)
+{{endif}}
+
+{{if 'cudaGraphGetEdges_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes)
+{{endif}}
+
+{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes)
+{{endif}}
+
+{{if 'cudaGraphAddDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddDependencies(graph, from_, to, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphAddDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphRemoveDependencies(graph, from_, to, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphRemoveDependencies_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies)
+{{endif}}
+
+{{if 'cudaGraphDestroyNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphDestroyNode(node)
+{{endif}}
+
+{{if 'cudaGraphInstantiate' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphInstantiate(pGraphExec, graph, flags)
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphInstantiateWithFlags(pGraphExec, graph, flags)
+{{endif}}
+
+{{if 'cudaGraphInstantiateWithParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams)
+{{endif}}
+
+{{if 'cudaGraphExecGetFlags' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecGetFlags(graphExec, flags)
+{{endif}}
+
+{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind)
+{{endif}}
+
+{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecHostNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph)
+{{endif}}
+
+{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event)
+{{endif}}
+
+{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event)
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphNodeSetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled)
+{{endif}}
+
+{{if 'cudaGraphNodeGetEnabled' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled)
+{{endif}}
+
+{{if 'cudaGraphExecUpdate' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo)
+{{endif}}
+
+{{if 'cudaGraphUpload' in found_functions}}
+
+cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphUpload(graphExec, stream)
+{{endif}}
+
+{{if 'cudaGraphLaunch' in found_functions}}
+
+cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphLaunch(graphExec, stream)
+{{endif}}
+
+{{if 'cudaGraphExecDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecDestroy(graphExec)
+{{endif}}
+
+{{if 'cudaGraphDestroy' in found_functions}}
+
+cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphDestroy(graph)
+{{endif}}
+
+{{if 'cudaGraphDebugDotPrint' in found_functions}}
+
+cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphDebugDotPrint(graph, path, flags)
+{{endif}}
+
+{{if 'cudaUserObjectCreate' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags)
+{{endif}}
+
+{{if 'cudaUserObjectRetain' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaUserObjectRetain(object, count)
+{{endif}}
+
+{{if 'cudaUserObjectRelease' in found_functions}}
+
+cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaUserObjectRelease(object, count)
+{{endif}}
+
+{{if 'cudaGraphRetainUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphRetainUserObject(graph, object, count, flags)
+{{endif}}
+
+{{if 'cudaGraphReleaseUserObject' in found_functions}}
+
+cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphReleaseUserObject(graph, object, count)
+{{endif}}
+
+{{if 'cudaGraphAddNode' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphAddNode_v2' in found_functions}}
+
+cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphNodeSetParams(node, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphExecNodeSetParams' in found_functions}}
+
+cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphExecNodeSetParams(graphExec, node, nodeParams)
+{{endif}}
+
+{{if 'cudaGraphConditionalHandleCreate' in found_functions}}
+
+cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags)
+{{endif}}
+
+{{if 'cudaGetDriverEntryPoint' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus)
+{{endif}}
+
+{{if 'cudaGetDriverEntryPointByVersion' in found_functions}}
+
+cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus)
+{{endif}}
+
+{{if 'cudaLibraryLoadData' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+{{endif}}
+
+{{if 'cudaLibraryLoadFromFile' in found_functions}}
+
+cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
+{{endif}}
+
+{{if 'cudaLibraryUnload' in found_functions}}
+
+cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryUnload(library)
+{{endif}}
+
+{{if 'cudaLibraryGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryGetKernel(pKernel, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetGlobal' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryGetGlobal(dptr, numbytes, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetManaged' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryGetManaged(dptr, numbytes, library, name)
+{{endif}}
+
+{{if 'cudaLibraryGetUnifiedFunction' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryGetUnifiedFunction(fptr, library, symbol)
+{{endif}}
+
+{{if 'cudaLibraryGetKernelCount' in found_functions}}
+
+cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryGetKernelCount(count, lib)
+{{endif}}
+
+{{if 'cudaLibraryEnumerateKernels' in found_functions}}
+
+cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaLibraryEnumerateKernels(kernels, numKernels, lib)
+{{endif}}
+
+{{if 'cudaKernelSetAttributeForDevice' in found_functions}}
+
+cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaKernelSetAttributeForDevice(kernel, attr, value, device)
+{{endif}}
+
+{{if 'cudaGetExportTable' in found_functions}}
+
+cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetExportTable(ppExportTable, pExportTableId)
+{{endif}}
+
+{{if 'cudaGetKernel' in found_functions}}
+
+cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaGetKernel(kernelPtr, entryFuncAddr)
+{{endif}}
+
+{{if 'make_cudaPitchedPtr' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil:
+ return make_cudaPitchedPtr(d, p, xsz, ysz)
+{{endif}}
+
+{{if 'make_cudaPos' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil:
+ return make_cudaPos(x, y, z)
+{{endif}}
+
+{{if 'make_cudaExtent' in found_functions}}
+@cython.show_performance_hints(False)
+cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil:
+ return make_cudaExtent(w, h, d)
+{{endif}}
+
+{{if 'cudaProfilerStart' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaProfilerStart()
+{{endif}}
+
+{{if 'cudaProfilerStop' in found_functions}}
+
+cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil:
+ return cudaProfilerStop()
+{{endif}}
diff --git a/cuda_bindings_12/cuda/bindings/_internal/__init__.py b/cuda_bindings_12/cuda/bindings/_internal/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py b/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py
new file mode 100644
index 00000000000..18ad0239def
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py
@@ -0,0 +1,78 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=35d522fae601127f3ffc9d0de45d9adf2572934ee3308f5d99567aa8efd5ae77
+"""
+This is a replacement for the stdlib enum.IntEnum.
+
+Notably, it has much better import time performance, since it doesn't generate
+and evaluate Python code at startup time.
+
+It supports the most important subset of the IntEnum API. See `test_enum` in
+`cuda_bindings/tests/test_basics.py` for details.
+"""
+
+from typing import Any, Iterator
+
+
+class FastEnumMetaclass(type):
+ def __init__(cls, name, bases, namespace):
+ super().__init__(name, bases, namespace)
+
+ cls.__singletons__ = {}
+ cls.__members__ = {}
+ for name, value in cls.__dict__.items():
+ if name.startswith("__") and name.endswith("__"):
+ continue
+
+ if isinstance(value, tuple):
+ value, doc = value
+ elif isinstance(value, int):
+ doc = None
+ else:
+ continue
+
+ # A name sharing a value with an already-processed member is an
+ # alias (e.g. a deprecated name kept for backward compatibility):
+ # it resolves to the same singleton, but isn't a distinct member.
+ if (singleton := cls.__singletons__.get(value)) is None:
+ singleton = int.__new__(cls, value)
+ singleton.__doc__ = doc
+ singleton._name = name
+ cls.__singletons__[value] = singleton
+ cls.__members__[name] = singleton
+
+ for name, member in cls.__members__.items():
+ setattr(cls, name, member)
+
+ def __repr__(cls) -> str:
+ return f""
+
+ def __len__(cls) -> int:
+ return len(cls.__singletons__)
+
+ def __iter__(cls) -> Iterator["FastEnum"]:
+ return iter(cls.__singletons__.values())
+
+ def __contains__(cls, item: Any) -> bool:
+ return item in cls.__singletons__
+
+
+class FastEnum(int, metaclass=FastEnumMetaclass):
+ def __new__(cls, value: int) -> "FastEnum":
+ singleton: FastEnum = cls.__singletons__.get(value)
+ if singleton is None:
+ raise ValueError(f"{value} is not a valid {cls.__name__}")
+ return singleton
+
+ def __repr__(self) -> str:
+ return f"<{self.__class__.__name__}.{self._name}: {int(self)}>"
+
+ @property
+ def name(self) -> str:
+ return self._name
+
+ @property
+ def value(self) -> int:
+ return int(self)
diff --git a/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd b/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd
new file mode 100644
index 00000000000..62658be1e1f
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd
@@ -0,0 +1,53 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# This code was automatically generated with version 12.9.1. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=754c0fc21d3ba16995b80db0257818b472b3a2e9f9b95df721d27d031787f4ee
+
+
+# <<<< PREAMBLE CONTENT >>>>
+
+from libcpp cimport bool as _cyb_bool
+
+
+# <<<< END OF PREAMBLE CONTENT >>>>
+
+from ..cycufile cimport *
+
+
+###############################################################################
+# Wrapper functions
+###############################################################################
+
+cdef CUfileError_t _cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil
+cdef void _cuFileHandleDeregister(CUfileHandle_t fh) except* nogil
+cdef CUfileError_t _cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil
+cdef ssize_t _cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil
+cdef ssize_t _cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil
+cdef CUfileError_t _cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil
+cdef long _cuFileUseCount() except* nogil
+cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil
+cdef void _cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil
+cdef CUfileError_t _cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil
+cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil
diff --git a/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx
new file mode 100644
index 00000000000..cd388b4a76a
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx
@@ -0,0 +1,764 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# This code was automatically generated with version 12.9.1. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6baa85b885ea8a9f8fc01db7ce4c55af185d9080c0856563f15cc15d115db48f
+
+
+# <<<< PREAMBLE CONTENT >>>>
+
+cdef extern from * nogil:
+ """
+ #if defined(_MSC_VER) && !defined(__clang__)
+ #include
+ static __forceinline int atomic_int_load(int *p) {
+ int v = *(int volatile *)p; _ReadBarrier(); return v;
+ }
+ static __forceinline void atomic_int_store(int *p, int v) {
+ _WriteBarrier(); *(int volatile *)p = v;
+ }
+ #elif defined(__cplusplus)
+ /* GCC/Clang __atomic builtins work in any C++ standard without headers */
+ static inline int atomic_int_load(int *p) {
+ return __atomic_load_n(p, __ATOMIC_ACQUIRE);
+ }
+ static inline void atomic_int_store(int *p, int v) {
+ __atomic_store_n(p, v, __ATOMIC_RELEASE);
+ }
+ #else
+ #include
+ static inline int atomic_int_load(int *p) {
+ return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire);
+ }
+ static inline void atomic_int_store(int *p, int v) {
+ atomic_store_explicit((atomic_int *)p, v, memory_order_release);
+ }
+ #endif
+
+ """
+ cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil
+ cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil
+
+cdef extern from "":
+ void* _cyb_dlsym "dlsym"(void*, const char*) nogil
+ const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT"
+
+cimport cython as _cyb_cython
+from libc.stdint cimport intptr_t
+from libcpp cimport bool as _cyb_bool
+
+import threading as _cyb_threading
+
+cdef int _cyb___py_cufile_init = 0
+cdef dict _cyb_func_ptrs = None
+cdef object _cyb_symbol_lock = _cyb_threading.Lock()
+
+# <<<< END OF PREAMBLE CONTENT >>>>
+
+from libc.stdint cimport uintptr_t
+
+from .utils import FunctionNotFoundError, NotSupportedError
+from cuda.pathfinder import load_nvidia_dynamic_lib
+
+
+###############################################################################
+# Wrapper init
+###############################################################################
+
+
+cdef void* __cuFileHandleRegister = NULL
+cdef void* __cuFileHandleDeregister = NULL
+cdef void* __cuFileBufRegister = NULL
+cdef void* __cuFileBufDeregister = NULL
+cdef void* __cuFileRead = NULL
+cdef void* __cuFileWrite = NULL
+cdef void* __cuFileDriverOpen = NULL
+cdef void* __cuFileDriverClose = NULL
+cdef void* __cuFileDriverClose_v2 = NULL
+cdef void* __cuFileUseCount = NULL
+cdef void* __cuFileDriverGetProperties = NULL
+cdef void* __cuFileDriverSetPollMode = NULL
+cdef void* __cuFileDriverSetMaxDirectIOSize = NULL
+cdef void* __cuFileDriverSetMaxCacheSize = NULL
+cdef void* __cuFileDriverSetMaxPinnedMemSize = NULL
+cdef void* __cuFileBatchIOSetUp = NULL
+cdef void* __cuFileBatchIOSubmit = NULL
+cdef void* __cuFileBatchIOGetStatus = NULL
+cdef void* __cuFileBatchIOCancel = NULL
+cdef void* __cuFileBatchIODestroy = NULL
+cdef void* __cuFileReadAsync = NULL
+cdef void* __cuFileWriteAsync = NULL
+cdef void* __cuFileStreamRegister = NULL
+cdef void* __cuFileStreamDeregister = NULL
+cdef void* __cuFileGetVersion = NULL
+cdef void* __cuFileGetParameterSizeT = NULL
+cdef void* __cuFileGetParameterBool = NULL
+cdef void* __cuFileGetParameterString = NULL
+cdef void* __cuFileSetParameterSizeT = NULL
+cdef void* __cuFileSetParameterBool = NULL
+cdef void* __cuFileSetParameterString = NULL
+
+cdef int _init_cufile() except -1 nogil:
+ global _cyb___py_cufile_init
+ cdef void* handle = NULL
+ with gil, _cyb_symbol_lock:
+ if _cyb___py_cufile_init: return 0
+
+ global __cuFileHandleRegister
+ __cuFileHandleRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileHandleRegister')
+ if __cuFileHandleRegister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileHandleRegister = _cyb_dlsym(handle, 'cuFileHandleRegister')
+
+ global __cuFileHandleDeregister
+ __cuFileHandleDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileHandleDeregister')
+ if __cuFileHandleDeregister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileHandleDeregister = _cyb_dlsym(handle, 'cuFileHandleDeregister')
+
+ global __cuFileBufRegister
+ __cuFileBufRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBufRegister')
+ if __cuFileBufRegister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBufRegister = _cyb_dlsym(handle, 'cuFileBufRegister')
+
+ global __cuFileBufDeregister
+ __cuFileBufDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBufDeregister')
+ if __cuFileBufDeregister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBufDeregister = _cyb_dlsym(handle, 'cuFileBufDeregister')
+
+ global __cuFileRead
+ __cuFileRead = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileRead')
+ if __cuFileRead == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileRead = _cyb_dlsym(handle, 'cuFileRead')
+
+ global __cuFileWrite
+ __cuFileWrite = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileWrite')
+ if __cuFileWrite == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileWrite = _cyb_dlsym(handle, 'cuFileWrite')
+
+ global __cuFileDriverOpen
+ __cuFileDriverOpen = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverOpen')
+ if __cuFileDriverOpen == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverOpen = _cyb_dlsym(handle, 'cuFileDriverOpen')
+
+ global __cuFileDriverClose
+ __cuFileDriverClose = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverClose')
+ if __cuFileDriverClose == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverClose = _cyb_dlsym(handle, 'cuFileDriverClose')
+
+ global __cuFileDriverClose_v2
+ __cuFileDriverClose_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverClose_v2')
+ if __cuFileDriverClose_v2 == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverClose_v2 = _cyb_dlsym(handle, 'cuFileDriverClose_v2')
+
+ global __cuFileUseCount
+ __cuFileUseCount = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileUseCount')
+ if __cuFileUseCount == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileUseCount = _cyb_dlsym(handle, 'cuFileUseCount')
+
+ global __cuFileDriverGetProperties
+ __cuFileDriverGetProperties = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverGetProperties')
+ if __cuFileDriverGetProperties == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverGetProperties = _cyb_dlsym(handle, 'cuFileDriverGetProperties')
+
+ global __cuFileDriverSetPollMode
+ __cuFileDriverSetPollMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetPollMode')
+ if __cuFileDriverSetPollMode == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverSetPollMode = _cyb_dlsym(handle, 'cuFileDriverSetPollMode')
+
+ global __cuFileDriverSetMaxDirectIOSize
+ __cuFileDriverSetMaxDirectIOSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize')
+ if __cuFileDriverSetMaxDirectIOSize == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverSetMaxDirectIOSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxDirectIOSize')
+
+ global __cuFileDriverSetMaxCacheSize
+ __cuFileDriverSetMaxCacheSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize')
+ if __cuFileDriverSetMaxCacheSize == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverSetMaxCacheSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxCacheSize')
+
+ global __cuFileDriverSetMaxPinnedMemSize
+ __cuFileDriverSetMaxPinnedMemSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize')
+ if __cuFileDriverSetMaxPinnedMemSize == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileDriverSetMaxPinnedMemSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize')
+
+ global __cuFileBatchIOSetUp
+ __cuFileBatchIOSetUp = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOSetUp')
+ if __cuFileBatchIOSetUp == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBatchIOSetUp = _cyb_dlsym(handle, 'cuFileBatchIOSetUp')
+
+ global __cuFileBatchIOSubmit
+ __cuFileBatchIOSubmit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOSubmit')
+ if __cuFileBatchIOSubmit == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBatchIOSubmit = _cyb_dlsym(handle, 'cuFileBatchIOSubmit')
+
+ global __cuFileBatchIOGetStatus
+ __cuFileBatchIOGetStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOGetStatus')
+ if __cuFileBatchIOGetStatus == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBatchIOGetStatus = _cyb_dlsym(handle, 'cuFileBatchIOGetStatus')
+
+ global __cuFileBatchIOCancel
+ __cuFileBatchIOCancel = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOCancel')
+ if __cuFileBatchIOCancel == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBatchIOCancel = _cyb_dlsym(handle, 'cuFileBatchIOCancel')
+
+ global __cuFileBatchIODestroy
+ __cuFileBatchIODestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIODestroy')
+ if __cuFileBatchIODestroy == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileBatchIODestroy = _cyb_dlsym(handle, 'cuFileBatchIODestroy')
+
+ global __cuFileReadAsync
+ __cuFileReadAsync = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileReadAsync')
+ if __cuFileReadAsync == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileReadAsync = _cyb_dlsym(handle, 'cuFileReadAsync')
+
+ global __cuFileWriteAsync
+ __cuFileWriteAsync = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileWriteAsync')
+ if __cuFileWriteAsync == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileWriteAsync = _cyb_dlsym(handle, 'cuFileWriteAsync')
+
+ global __cuFileStreamRegister
+ __cuFileStreamRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileStreamRegister')
+ if __cuFileStreamRegister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileStreamRegister = _cyb_dlsym(handle, 'cuFileStreamRegister')
+
+ global __cuFileStreamDeregister
+ __cuFileStreamDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileStreamDeregister')
+ if __cuFileStreamDeregister == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileStreamDeregister = _cyb_dlsym(handle, 'cuFileStreamDeregister')
+
+ global __cuFileGetVersion
+ __cuFileGetVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetVersion')
+ if __cuFileGetVersion == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileGetVersion = _cyb_dlsym(handle, 'cuFileGetVersion')
+
+ global __cuFileGetParameterSizeT
+ __cuFileGetParameterSizeT = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterSizeT')
+ if __cuFileGetParameterSizeT == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileGetParameterSizeT = _cyb_dlsym(handle, 'cuFileGetParameterSizeT')
+
+ global __cuFileGetParameterBool
+ __cuFileGetParameterBool = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterBool')
+ if __cuFileGetParameterBool == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileGetParameterBool = _cyb_dlsym(handle, 'cuFileGetParameterBool')
+
+ global __cuFileGetParameterString
+ __cuFileGetParameterString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterString')
+ if __cuFileGetParameterString == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileGetParameterString = _cyb_dlsym(handle, 'cuFileGetParameterString')
+
+ global __cuFileSetParameterSizeT
+ __cuFileSetParameterSizeT = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterSizeT')
+ if __cuFileSetParameterSizeT == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileSetParameterSizeT = _cyb_dlsym(handle, 'cuFileSetParameterSizeT')
+
+ global __cuFileSetParameterBool
+ __cuFileSetParameterBool = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterBool')
+ if __cuFileSetParameterBool == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileSetParameterBool = _cyb_dlsym(handle, 'cuFileSetParameterBool')
+
+ global __cuFileSetParameterString
+ __cuFileSetParameterString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterString')
+ if __cuFileSetParameterString == NULL:
+ if handle == NULL:
+ handle = load_library()
+ __cuFileSetParameterString = _cyb_dlsym(handle, 'cuFileSetParameterString')
+
+ _cyb_atomic_int_store(&_cyb___py_cufile_init, 1)
+ return 0
+
+cdef inline int _check_or_init_cufile() except -1 nogil:
+ if _cyb_atomic_int_load(&_cyb___py_cufile_init):
+ return 0
+
+ return _init_cufile()
+
+
+cpdef dict _inspect_function_pointers():
+ global _cyb_func_ptrs
+ if _cyb_func_ptrs is not None:
+ return _cyb_func_ptrs
+
+ _check_or_init_cufile()
+ cdef dict data = {}
+ global __cuFileHandleRegister
+ data["__cuFileHandleRegister"] = __cuFileHandleRegister
+
+ global __cuFileHandleDeregister
+ data["__cuFileHandleDeregister"] = __cuFileHandleDeregister
+
+ global __cuFileBufRegister
+ data["__cuFileBufRegister"] = __cuFileBufRegister
+
+ global __cuFileBufDeregister
+ data["__cuFileBufDeregister"] = __cuFileBufDeregister
+
+ global __cuFileRead
+ data["__cuFileRead"] = __cuFileRead
+
+ global __cuFileWrite
+ data["__cuFileWrite"] = __cuFileWrite
+
+ global __cuFileDriverOpen
+ data["__cuFileDriverOpen"] = __cuFileDriverOpen
+
+ global __cuFileDriverClose
+ data["__cuFileDriverClose"] = __cuFileDriverClose
+
+ global __cuFileDriverClose_v2
+ data["__cuFileDriverClose_v2"] = __cuFileDriverClose_v2
+
+ global __cuFileUseCount
+ data["__cuFileUseCount"] = __cuFileUseCount
+
+ global __cuFileDriverGetProperties
+ data["__cuFileDriverGetProperties"] = __cuFileDriverGetProperties
+
+ global __cuFileDriverSetPollMode
+ data["__cuFileDriverSetPollMode"] = __cuFileDriverSetPollMode
+
+ global __cuFileDriverSetMaxDirectIOSize
+ data["__cuFileDriverSetMaxDirectIOSize"] = __cuFileDriverSetMaxDirectIOSize
+
+ global __cuFileDriverSetMaxCacheSize
+ data["__cuFileDriverSetMaxCacheSize"] = __cuFileDriverSetMaxCacheSize
+
+ global __cuFileDriverSetMaxPinnedMemSize
+ data["__cuFileDriverSetMaxPinnedMemSize"] = __cuFileDriverSetMaxPinnedMemSize
+
+ global __cuFileBatchIOSetUp
+ data["__cuFileBatchIOSetUp"] = __cuFileBatchIOSetUp
+
+ global __cuFileBatchIOSubmit
+ data["__cuFileBatchIOSubmit"] = __cuFileBatchIOSubmit
+
+ global __cuFileBatchIOGetStatus
+ data["__cuFileBatchIOGetStatus"] = __cuFileBatchIOGetStatus
+
+ global __cuFileBatchIOCancel
+ data["__cuFileBatchIOCancel"] = __cuFileBatchIOCancel
+
+ global __cuFileBatchIODestroy
+ data["__cuFileBatchIODestroy"] = __cuFileBatchIODestroy
+
+ global __cuFileReadAsync
+ data["__cuFileReadAsync"] = __cuFileReadAsync
+
+ global __cuFileWriteAsync
+ data["__cuFileWriteAsync"] = __cuFileWriteAsync
+
+ global __cuFileStreamRegister
+ data["__cuFileStreamRegister"] = __cuFileStreamRegister
+
+ global __cuFileStreamDeregister
+ data["__cuFileStreamDeregister"] = __cuFileStreamDeregister
+
+ global __cuFileGetVersion
+ data["__cuFileGetVersion"] = __cuFileGetVersion
+
+ global __cuFileGetParameterSizeT
+ data["__cuFileGetParameterSizeT"] = __cuFileGetParameterSizeT
+
+ global __cuFileGetParameterBool
+ data["__cuFileGetParameterBool"] = __cuFileGetParameterBool
+
+ global __cuFileGetParameterString
+ data["__cuFileGetParameterString"] = __cuFileGetParameterString
+
+ global __cuFileSetParameterSizeT
+ data["__cuFileSetParameterSizeT"] = __cuFileSetParameterSizeT
+
+ global __cuFileSetParameterBool
+ data["__cuFileSetParameterBool"] = __cuFileSetParameterBool
+
+ global __cuFileSetParameterString
+ data["__cuFileSetParameterString"] = __cuFileSetParameterString
+ _cyb_func_ptrs = data
+ return data
+
+
+cpdef _inspect_function_pointer(str name):
+ global _cyb_func_ptrs
+ if _cyb_func_ptrs is None:
+ _cyb_func_ptrs = _inspect_function_pointers()
+ return _cyb_func_ptrs[name]
+
+
+
+
+cdef void* load_library() except* with gil:
+ cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint
+ return handle
+
+
+###############################################################################
+# Wrapper functions
+
+cdef CUfileError_t _cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileHandleRegister
+ _check_or_init_cufile()
+ if __cuFileHandleRegister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileHandleRegister is not found")
+ return (__cuFileHandleRegister)(
+ fh, descr)
+
+
+@_cyb_cython.show_performance_hints(False)
+cdef void _cuFileHandleDeregister(CUfileHandle_t fh) except* nogil:
+ global __cuFileHandleDeregister
+ _check_or_init_cufile()
+ if __cuFileHandleDeregister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileHandleDeregister is not found")
+ (__cuFileHandleDeregister)(
+ fh)
+
+
+cdef CUfileError_t _cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBufRegister
+ _check_or_init_cufile()
+ if __cuFileBufRegister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBufRegister is not found")
+ return (__cuFileBufRegister)(
+ bufPtr_base, length, flags)
+
+
+cdef CUfileError_t _cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBufDeregister
+ _check_or_init_cufile()
+ if __cuFileBufDeregister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBufDeregister is not found")
+ return (__cuFileBufDeregister)(
+ bufPtr_base)
+
+
+cdef ssize_t _cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil:
+ global __cuFileRead
+ _check_or_init_cufile()
+ if __cuFileRead == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileRead is not found")
+ return (__cuFileRead)(
+ fh, bufPtr_base, size, file_offset, bufPtr_offset)
+
+
+cdef ssize_t _cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil:
+ global __cuFileWrite
+ _check_or_init_cufile()
+ if __cuFileWrite == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileWrite is not found")
+ return (__cuFileWrite)(
+ fh, bufPtr_base, size, file_offset, bufPtr_offset)
+
+
+cdef CUfileError_t _cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverOpen
+ _check_or_init_cufile()
+ if __cuFileDriverOpen == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverOpen is not found")
+ return (__cuFileDriverOpen)(
+ )
+
+
+cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverClose
+ _check_or_init_cufile()
+ if __cuFileDriverClose == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverClose is not found")
+ return (__cuFileDriverClose)(
+ )
+
+
+cdef CUfileError_t _cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverClose_v2
+ _check_or_init_cufile()
+ if __cuFileDriverClose_v2 == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverClose_v2 is not found")
+ return (__cuFileDriverClose_v2)(
+ )
+
+
+cdef long _cuFileUseCount() except* nogil:
+ global __cuFileUseCount
+ _check_or_init_cufile()
+ if __cuFileUseCount == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileUseCount is not found")
+ return (__cuFileUseCount)(
+ )
+
+
+cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverGetProperties
+ _check_or_init_cufile()
+ if __cuFileDriverGetProperties == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverGetProperties is not found")
+ return (__cuFileDriverGetProperties)(
+ props)
+
+
+cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverSetPollMode
+ _check_or_init_cufile()
+ if __cuFileDriverSetPollMode == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverSetPollMode is not found")
+ return (__cuFileDriverSetPollMode)(
+ poll, poll_threshold_size)
+
+
+cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverSetMaxDirectIOSize
+ _check_or_init_cufile()
+ if __cuFileDriverSetMaxDirectIOSize == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverSetMaxDirectIOSize is not found")
+ return (__cuFileDriverSetMaxDirectIOSize)(
+ max_direct_io_size)
+
+
+cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverSetMaxCacheSize
+ _check_or_init_cufile()
+ if __cuFileDriverSetMaxCacheSize == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverSetMaxCacheSize is not found")
+ return (__cuFileDriverSetMaxCacheSize)(
+ max_cache_size)
+
+
+cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileDriverSetMaxPinnedMemSize
+ _check_or_init_cufile()
+ if __cuFileDriverSetMaxPinnedMemSize == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileDriverSetMaxPinnedMemSize is not found")
+ return (__cuFileDriverSetMaxPinnedMemSize)(
+ max_pinned_size)
+
+
+cdef CUfileError_t _cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBatchIOSetUp
+ _check_or_init_cufile()
+ if __cuFileBatchIOSetUp == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBatchIOSetUp is not found")
+ return (__cuFileBatchIOSetUp)(
+ batch_idp, nr)
+
+
+cdef CUfileError_t _cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBatchIOSubmit
+ _check_or_init_cufile()
+ if __cuFileBatchIOSubmit == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBatchIOSubmit is not found")
+ return (__cuFileBatchIOSubmit)(
+ batch_idp, nr, iocbp, flags)
+
+
+cdef CUfileError_t _cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBatchIOGetStatus
+ _check_or_init_cufile()
+ if __cuFileBatchIOGetStatus == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBatchIOGetStatus is not found")
+ return (__cuFileBatchIOGetStatus)(
+ batch_idp, min_nr, nr, iocbp, timeout)
+
+
+cdef CUfileError_t _cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileBatchIOCancel
+ _check_or_init_cufile()
+ if __cuFileBatchIOCancel == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBatchIOCancel is not found")
+ return (__cuFileBatchIOCancel)(
+ batch_idp)
+
+
+@_cyb_cython.show_performance_hints(False)
+cdef void _cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil:
+ global __cuFileBatchIODestroy
+ _check_or_init_cufile()
+ if __cuFileBatchIODestroy == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileBatchIODestroy is not found")
+ (__cuFileBatchIODestroy)(
+ batch_idp)
+
+
+cdef CUfileError_t _cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileReadAsync
+ _check_or_init_cufile()
+ if __cuFileReadAsync == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileReadAsync is not found")
+ return (__cuFileReadAsync)(
+ fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_read_p, stream)
+
+
+cdef CUfileError_t _cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileWriteAsync
+ _check_or_init_cufile()
+ if __cuFileWriteAsync == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileWriteAsync is not found")
+ return (__cuFileWriteAsync)(
+ fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_written_p, stream)
+
+
+cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileStreamRegister
+ _check_or_init_cufile()
+ if __cuFileStreamRegister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileStreamRegister is not found")
+ return (__cuFileStreamRegister)(
+ stream, flags)
+
+
+cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileStreamDeregister
+ _check_or_init_cufile()
+ if __cuFileStreamDeregister == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileStreamDeregister is not found")
+ return (__cuFileStreamDeregister)(
+ stream)
+
+
+cdef CUfileError_t _cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileGetVersion
+ _check_or_init_cufile()
+ if __cuFileGetVersion == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileGetVersion is not found")
+ return (__cuFileGetVersion)(
+ version)
+
+
+cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileGetParameterSizeT
+ _check_or_init_cufile()
+ if __cuFileGetParameterSizeT == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileGetParameterSizeT is not found")
+ return (__cuFileGetParameterSizeT)(
+ param, value)
+
+
+cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileGetParameterBool
+ _check_or_init_cufile()
+ if __cuFileGetParameterBool == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileGetParameterBool is not found")
+ return (__cuFileGetParameterBool)(
+ param, value)
+
+
+cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileGetParameterString
+ _check_or_init_cufile()
+ if __cuFileGetParameterString == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileGetParameterString is not found")
+ return (__cuFileGetParameterString)(
+ param, desc_str, len)
+
+
+cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileSetParameterSizeT
+ _check_or_init_cufile()
+ if __cuFileSetParameterSizeT == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileSetParameterSizeT is not found")
+ return (__cuFileSetParameterSizeT)(
+ param, value)
+
+
+cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileSetParameterBool
+ _check_or_init_cufile()
+ if __cuFileSetParameterBool == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileSetParameterBool is not found")
+ return (__cuFileSetParameterBool)(
+ param, value)
+
+
+cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil:
+ global __cuFileSetParameterString
+ _check_or_init_cufile()
+ if __cuFileSetParameterString == NULL:
+ with gil:
+ raise FunctionNotFoundError("function cuFileSetParameterString is not found")
+ return (__cuFileSetParameterString)(
+ param, desc_str)
diff --git a/cuda_bindings_12/cuda/bindings/_internal/driver.pxd b/cuda_bindings_12/cuda/bindings/_internal/driver.pxd
new file mode 100644
index 00000000000..6efac7bc551
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_internal/driver.pxd
@@ -0,0 +1,497 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=395f93ae98b3b074267a9275aa19aff34b001e2b982b686301aace8270e40ea1
+from ..cydriver cimport *
+
+
+###############################################################################
+# Wrapper functions
+###############################################################################
+
+cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceTotalMem_v2(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remaining, unsigned int useFlags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
+cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
diff --git a/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx
new file mode 100644
index 00000000000..34c448c5cc5
--- /dev/null
+++ b/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx
@@ -0,0 +1,8336 @@
+# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# This code was automatically generated with version 12.9.0. Do not modify it directly.
+# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4957d188c7c3258823fd50e2eb0cba162810911af7294ab726f1e49769642c8
+
+
+# <<<< PREAMBLE CONTENT >>>>
+
+cdef extern from * nogil:
+ """
+ #if defined(_MSC_VER) && !defined(__clang__)
+ #include
+ static __forceinline int atomic_int_load(int *p) {
+ int v = *(int volatile *)p; _ReadBarrier(); return v;
+ }
+ static __forceinline void atomic_int_store(int *p, int v) {
+ _WriteBarrier(); *(int volatile *)p = v;
+ }
+ #elif defined(__cplusplus)
+ /* GCC/Clang __atomic builtins work in any C++ standard without headers */
+ static inline int atomic_int_load(int *p) {
+ return __atomic_load_n(p, __ATOMIC_ACQUIRE);
+ }
+ static inline void atomic_int_store(int *p, int v) {
+ __atomic_store_n(p, v, __ATOMIC_RELEASE);
+ }
+ #else
+ #include
+ static inline int atomic_int_load(int *p) {
+ return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire);
+ }
+ static inline void atomic_int_store(int *p, int v) {
+ atomic_store_explicit((atomic_int *)p, v, memory_order_release);
+ }
+ #endif
+
+ """
+ cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil
+ cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil
+
+cdef extern from "":
+ void* _cyb_dlsym "dlsym"(void*, const char*) nogil
+
+from libc.stdint cimport intptr_t
+
+from os import getenv as _cyb_getenv
+import threading as _cyb_threading
+
+ctypedef int (*_cyb_cuGetProcAddress_v2_T)(const char *, void **, int, cuuint64_t, CUdriverProcAddressQueryResult *)except?CUDA_ERROR_NOT_FOUND nogil
+
+cdef int _cyb___py_driver_init = 0
+cdef dict _cyb_func_ptrs = None
+cdef object _cyb_symbol_lock = _cyb_threading.Lock()
+
+# <<<< END OF PREAMBLE CONTENT >>>>
+
+from libc.stdint cimport uintptr_t
+
+from .utils import FunctionNotFoundError, NotSupportedError
+from cuda.pathfinder import load_nvidia_dynamic_lib
+
+
+###############################################################################
+# Wrapper init
+###############################################################################
+
+
+cdef void* __cuGetErrorString = NULL
+cdef void* __cuGetErrorName = NULL
+cdef void* __cuInit = NULL
+cdef void* __cuDriverGetVersion = NULL
+cdef void* __cuDeviceGet = NULL
+cdef void* __cuDeviceGetCount = NULL
+cdef void* __cuDeviceGetName = NULL
+cdef void* __cuDeviceGetUuid = NULL
+cdef void* __cuDeviceGetUuid_v2 = NULL
+cdef void* __cuDeviceGetLuid = NULL
+cdef void* __cuDeviceTotalMem_v2 = NULL
+cdef void* __cuDeviceGetTexture1DLinearMaxWidth = NULL
+cdef void* __cuDeviceGetAttribute = NULL
+cdef void* __cuDeviceGetNvSciSyncAttributes = NULL
+cdef void* __cuDeviceSetMemPool = NULL
+cdef void* __cuDeviceGetMemPool = NULL
+cdef void* __cuDeviceGetDefaultMemPool = NULL
+cdef void* __cuDeviceGetExecAffinitySupport = NULL
+cdef void* __cuFlushGPUDirectRDMAWrites = NULL
+cdef void* __cuDeviceGetProperties = NULL
+cdef void* __cuDeviceComputeCapability = NULL
+cdef void* __cuDevicePrimaryCtxRetain = NULL
+cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL
+cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL
+cdef void* __cuDevicePrimaryCtxGetState = NULL
+cdef void* __cuDevicePrimaryCtxReset_v2 = NULL
+cdef void* __cuCtxCreate_v2 = NULL
+cdef void* __cuCtxCreate_v3 = NULL
+cdef void* __cuCtxCreate_v4 = NULL
+cdef void* __cuCtxDestroy_v2 = NULL
+cdef void* __cuCtxPushCurrent_v2 = NULL
+cdef void* __cuCtxPopCurrent_v2 = NULL
+cdef void* __cuCtxSetCurrent = NULL
+cdef void* __cuCtxGetCurrent = NULL
+cdef void* __cuCtxGetDevice = NULL
+cdef void* __cuCtxGetFlags = NULL
+cdef void* __cuCtxSetFlags = NULL
+cdef void* __cuCtxGetId = NULL
+cdef void* __cuCtxSynchronize = NULL
+cdef void* __cuCtxSetLimit = NULL
+cdef void* __cuCtxGetLimit = NULL
+cdef void* __cuCtxGetCacheConfig = NULL
+cdef void* __cuCtxSetCacheConfig = NULL
+cdef void* __cuCtxGetApiVersion = NULL
+cdef void* __cuCtxGetStreamPriorityRange = NULL
+cdef void* __cuCtxResetPersistingL2Cache = NULL
+cdef void* __cuCtxGetExecAffinity = NULL
+cdef void* __cuCtxRecordEvent = NULL
+cdef void* __cuCtxWaitEvent = NULL
+cdef void* __cuCtxAttach = NULL
+cdef void* __cuCtxDetach = NULL
+cdef void* __cuCtxGetSharedMemConfig = NULL
+cdef void* __cuCtxSetSharedMemConfig = NULL
+cdef void* __cuModuleLoad = NULL
+cdef void* __cuModuleLoadData = NULL
+cdef void* __cuModuleLoadDataEx = NULL
+cdef void* __cuModuleLoadFatBinary = NULL
+cdef void* __cuModuleUnload = NULL
+cdef void* __cuModuleGetLoadingMode = NULL
+cdef void* __cuModuleGetFunction = NULL
+cdef void* __cuModuleGetFunctionCount = NULL
+cdef void* __cuModuleEnumerateFunctions = NULL
+cdef void* __cuModuleGetGlobal_v2 = NULL
+cdef void* __cuLinkCreate_v2 = NULL
+cdef void* __cuLinkAddData_v2 = NULL
+cdef void* __cuLinkAddFile_v2 = NULL
+cdef void* __cuLinkComplete = NULL
+cdef void* __cuLinkDestroy = NULL
+cdef void* __cuModuleGetTexRef = NULL
+cdef void* __cuModuleGetSurfRef = NULL
+cdef void* __cuLibraryLoadData = NULL
+cdef void* __cuLibraryLoadFromFile = NULL
+cdef void* __cuLibraryUnload = NULL
+cdef void* __cuLibraryGetKernel = NULL
+cdef void* __cuLibraryGetKernelCount = NULL
+cdef void* __cuLibraryEnumerateKernels = NULL
+cdef void* __cuLibraryGetModule = NULL
+cdef void* __cuKernelGetFunction = NULL
+cdef void* __cuKernelGetLibrary = NULL
+cdef void* __cuLibraryGetGlobal = NULL
+cdef void* __cuLibraryGetManaged = NULL
+cdef void* __cuLibraryGetUnifiedFunction = NULL
+cdef void* __cuKernelGetAttribute = NULL
+cdef void* __cuKernelSetAttribute = NULL
+cdef void* __cuKernelSetCacheConfig = NULL
+cdef void* __cuKernelGetName = NULL
+cdef void* __cuKernelGetParamInfo = NULL
+cdef void* __cuMemGetInfo_v2 = NULL
+cdef void* __cuMemAlloc_v2 = NULL
+cdef void* __cuMemAllocPitch_v2 = NULL
+cdef void* __cuMemFree_v2 = NULL
+cdef void* __cuMemGetAddressRange_v2 = NULL
+cdef void* __cuMemAllocHost_v2 = NULL
+cdef void* __cuMemFreeHost = NULL
+cdef void* __cuMemHostAlloc = NULL
+cdef void* __cuMemHostGetDevicePointer_v2 = NULL
+cdef void* __cuMemHostGetFlags = NULL
+cdef void* __cuMemAllocManaged = NULL
+cdef void* __cuDeviceRegisterAsyncNotification = NULL
+cdef void* __cuDeviceUnregisterAsyncNotification = NULL
+cdef void* __cuDeviceGetByPCIBusId = NULL
+cdef void* __cuDeviceGetPCIBusId = NULL
+cdef void* __cuIpcGetEventHandle = NULL
+cdef void* __cuIpcOpenEventHandle = NULL
+cdef void* __cuIpcGetMemHandle = NULL
+cdef void* __cuIpcOpenMemHandle_v2 = NULL
+cdef void* __cuIpcCloseMemHandle = NULL
+cdef void* __cuMemHostRegister_v2 = NULL
+cdef void* __cuMemHostUnregister = NULL
+cdef void* __cuMemcpy = NULL
+cdef void* __cuMemcpyPeer = NULL
+cdef void* __cuMemcpyHtoD_v2 = NULL
+cdef void* __cuMemcpyDtoH_v2 = NULL
+cdef void* __cuMemcpyDtoD_v2 = NULL
+cdef void* __cuMemcpyDtoA_v2 = NULL
+cdef void* __cuMemcpyAtoD_v2 = NULL
+cdef void* __cuMemcpyHtoA_v2 = NULL
+cdef void* __cuMemcpyAtoH_v2 = NULL
+cdef void* __cuMemcpyAtoA_v2 = NULL
+cdef void* __cuMemcpy2D_v2 = NULL
+cdef void* __cuMemcpy2DUnaligned_v2 = NULL
+cdef void* __cuMemcpy3D_v2 = NULL
+cdef void* __cuMemcpy3DPeer = NULL
+cdef void* __cuMemcpyAsync = NULL
+cdef void* __cuMemcpyPeerAsync = NULL
+cdef void* __cuMemcpyHtoDAsync_v2 = NULL
+cdef void* __cuMemcpyDtoHAsync_v2 = NULL
+cdef void* __cuMemcpyDtoDAsync_v2 = NULL
+cdef void* __cuMemcpyHtoAAsync_v2 = NULL
+cdef void* __cuMemcpyAtoHAsync_v2 = NULL
+cdef void* __cuMemcpy2DAsync_v2 = NULL
+cdef void* __cuMemcpy3DAsync_v2 = NULL
+cdef void* __cuMemcpy3DPeerAsync = NULL
+cdef void* __cuMemcpyBatchAsync = NULL
+cdef void* __cuMemcpy3DBatchAsync = NULL
+cdef void* __cuMemsetD8_v2 = NULL
+cdef void* __cuMemsetD16_v2 = NULL
+cdef void* __cuMemsetD32_v2 = NULL
+cdef void* __cuMemsetD2D8_v2 = NULL
+cdef void* __cuMemsetD2D16_v2 = NULL
+cdef void* __cuMemsetD2D32_v2 = NULL
+cdef void* __cuMemsetD8Async = NULL
+cdef void* __cuMemsetD16Async = NULL
+cdef void* __cuMemsetD32Async = NULL
+cdef void* __cuMemsetD2D8Async = NULL
+cdef void* __cuMemsetD2D16Async = NULL
+cdef void* __cuMemsetD2D32Async = NULL
+cdef void* __cuArrayCreate_v2 = NULL
+cdef void* __cuArrayGetDescriptor_v2 = NULL
+cdef void* __cuArrayGetSparseProperties = NULL
+cdef void* __cuMipmappedArrayGetSparseProperties = NULL
+cdef void* __cuArrayGetMemoryRequirements = NULL
+cdef void* __cuMipmappedArrayGetMemoryRequirements = NULL
+cdef void* __cuArrayGetPlane = NULL
+cdef void* __cuArrayDestroy = NULL
+cdef void* __cuArray3DCreate_v2 = NULL
+cdef void* __cuArray3DGetDescriptor_v2 = NULL
+cdef void* __cuMipmappedArrayCreate = NULL
+cdef void* __cuMipmappedArrayGetLevel = NULL
+cdef void* __cuMipmappedArrayDestroy = NULL
+cdef void* __cuMemGetHandleForAddressRange = NULL
+cdef void* __cuMemBatchDecompressAsync = NULL
+cdef void* __cuMemAddressReserve = NULL
+cdef void* __cuMemAddressFree = NULL
+cdef void* __cuMemCreate = NULL
+cdef void* __cuMemRelease = NULL
+cdef void* __cuMemMap = NULL
+cdef void* __cuMemMapArrayAsync = NULL
+cdef void* __cuMemUnmap = NULL
+cdef void* __cuMemSetAccess = NULL
+cdef void* __cuMemGetAccess = NULL
+cdef void* __cuMemExportToShareableHandle = NULL
+cdef void* __cuMemImportFromShareableHandle = NULL
+cdef void* __cuMemGetAllocationGranularity = NULL
+cdef void* __cuMemGetAllocationPropertiesFromHandle = NULL
+cdef void* __cuMemRetainAllocationHandle = NULL
+cdef void* __cuMemFreeAsync = NULL
+cdef void* __cuMemAllocAsync = NULL
+cdef void* __cuMemPoolTrimTo = NULL
+cdef void* __cuMemPoolSetAttribute = NULL
+cdef void* __cuMemPoolGetAttribute = NULL
+cdef void* __cuMemPoolSetAccess = NULL
+cdef void* __cuMemPoolGetAccess = NULL
+cdef void* __cuMemPoolCreate = NULL
+cdef void* __cuMemPoolDestroy = NULL
+cdef void* __cuMemAllocFromPoolAsync = NULL
+cdef void* __cuMemPoolExportToShareableHandle = NULL
+cdef void* __cuMemPoolImportFromShareableHandle = NULL
+cdef void* __cuMemPoolExportPointer = NULL
+cdef void* __cuMemPoolImportPointer = NULL
+cdef void* __cuMulticastCreate = NULL
+cdef void* __cuMulticastAddDevice = NULL
+cdef void* __cuMulticastBindMem = NULL
+cdef void* __cuMulticastBindAddr = NULL
+cdef void* __cuMulticastUnbind = NULL
+cdef void* __cuMulticastGetGranularity = NULL
+cdef void* __cuPointerGetAttribute = NULL
+cdef void* __cuMemPrefetchAsync = NULL
+cdef void* __cuMemPrefetchAsync_v2 = NULL
+cdef void* __cuMemAdvise = NULL
+cdef void* __cuMemAdvise_v2 = NULL
+cdef void* __cuMemRangeGetAttribute = NULL
+cdef void* __cuMemRangeGetAttributes = NULL
+cdef void* __cuPointerSetAttribute = NULL
+cdef void* __cuPointerGetAttributes = NULL
+cdef void* __cuStreamCreate = NULL
+cdef void* __cuStreamCreateWithPriority = NULL
+cdef void* __cuStreamGetPriority = NULL
+cdef void* __cuStreamGetDevice = NULL
+cdef void* __cuStreamGetFlags = NULL
+cdef void* __cuStreamGetId = NULL
+cdef void* __cuStreamGetCtx = NULL
+cdef void* __cuStreamGetCtx_v2 = NULL
+cdef void* __cuStreamWaitEvent = NULL
+cdef void* __cuStreamAddCallback = NULL
+cdef void* __cuStreamBeginCapture_v2 = NULL
+cdef void* __cuStreamBeginCaptureToGraph = NULL
+cdef void* __cuThreadExchangeStreamCaptureMode = NULL
+cdef void* __cuStreamEndCapture = NULL
+cdef void* __cuStreamIsCapturing = NULL
+cdef void* __cuStreamGetCaptureInfo_v2 = NULL
+cdef void* __cuStreamGetCaptureInfo_v3 = NULL
+cdef void* __cuStreamUpdateCaptureDependencies = NULL
+cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL
+cdef void* __cuStreamAttachMemAsync = NULL
+cdef void* __cuStreamQuery = NULL
+cdef void* __cuStreamSynchronize = NULL
+cdef void* __cuStreamDestroy_v2 = NULL
+cdef void* __cuStreamCopyAttributes = NULL
+cdef void* __cuStreamGetAttribute = NULL
+cdef void* __cuStreamSetAttribute = NULL
+cdef void* __cuEventCreate = NULL
+cdef void* __cuEventRecord = NULL
+cdef void* __cuEventRecordWithFlags = NULL
+cdef void* __cuEventQuery = NULL
+cdef void* __cuEventSynchronize = NULL
+cdef void* __cuEventDestroy_v2 = NULL
+cdef void* __cuEventElapsedTime = NULL
+cdef void* __cuEventElapsedTime_v2 = NULL
+cdef void* __cuImportExternalMemory = NULL
+cdef void* __cuExternalMemoryGetMappedBuffer = NULL
+cdef void* __cuExternalMemoryGetMappedMipmappedArray = NULL
+cdef void* __cuDestroyExternalMemory = NULL
+cdef void* __cuImportExternalSemaphore = NULL
+cdef void* __cuSignalExternalSemaphoresAsync = NULL
+cdef void* __cuWaitExternalSemaphoresAsync = NULL
+cdef void* __cuDestroyExternalSemaphore = NULL
+cdef void* __cuStreamWaitValue32_v2 = NULL
+cdef void* __cuStreamWaitValue64_v2 = NULL
+cdef void* __cuStreamWriteValue32_v2 = NULL
+cdef void* __cuStreamWriteValue64_v2 = NULL
+cdef void* __cuStreamBatchMemOp_v2 = NULL
+cdef void* __cuFuncGetAttribute = NULL
+cdef void* __cuFuncSetAttribute = NULL
+cdef void* __cuFuncSetCacheConfig = NULL
+cdef void* __cuFuncGetModule = NULL
+cdef void* __cuFuncGetName = NULL
+cdef void* __cuFuncGetParamInfo = NULL
+cdef void* __cuFuncIsLoaded = NULL
+cdef void* __cuFuncLoad = NULL
+cdef void* __cuLaunchKernel = NULL
+cdef void* __cuLaunchKernelEx = NULL
+cdef void* __cuLaunchCooperativeKernel = NULL
+cdef void* __cuLaunchCooperativeKernelMultiDevice = NULL
+cdef void* __cuLaunchHostFunc = NULL
+cdef void* __cuFuncSetBlockShape = NULL
+cdef void* __cuFuncSetSharedSize = NULL
+cdef void* __cuParamSetSize = NULL
+cdef void* __cuParamSeti = NULL
+cdef void* __cuParamSetf = NULL
+cdef void* __cuParamSetv = NULL
+cdef void* __cuLaunch = NULL
+cdef void* __cuLaunchGrid = NULL
+cdef void* __cuLaunchGridAsync = NULL
+cdef void* __cuParamSetTexRef = NULL
+cdef void* __cuFuncSetSharedMemConfig = NULL
+cdef void* __cuGraphCreate = NULL
+cdef void* __cuGraphAddKernelNode_v2 = NULL
+cdef void* __cuGraphKernelNodeGetParams_v2 = NULL
+cdef void* __cuGraphKernelNodeSetParams_v2 = NULL
+cdef void* __cuGraphAddMemcpyNode = NULL
+cdef void* __cuGraphMemcpyNodeGetParams = NULL
+cdef void* __cuGraphMemcpyNodeSetParams = NULL
+cdef void* __cuGraphAddMemsetNode = NULL
+cdef void* __cuGraphMemsetNodeGetParams = NULL
+cdef void* __cuGraphMemsetNodeSetParams = NULL
+cdef void* __cuGraphAddHostNode = NULL
+cdef void* __cuGraphHostNodeGetParams = NULL
+cdef void* __cuGraphHostNodeSetParams = NULL
+cdef void* __cuGraphAddChildGraphNode = NULL
+cdef void* __cuGraphChildGraphNodeGetGraph = NULL
+cdef void* __cuGraphAddEmptyNode = NULL
+cdef void* __cuGraphAddEventRecordNode = NULL
+cdef void* __cuGraphEventRecordNodeGetEvent = NULL
+cdef void* __cuGraphEventRecordNodeSetEvent = NULL
+cdef void* __cuGraphAddEventWaitNode = NULL
+cdef void* __cuGraphEventWaitNodeGetEvent = NULL
+cdef void* __cuGraphEventWaitNodeSetEvent = NULL
+cdef void* __cuGraphAddExternalSemaphoresSignalNode = NULL
+cdef void* __cuGraphExternalSemaphoresSignalNodeGetParams = NULL
+cdef void* __cuGraphExternalSemaphoresSignalNodeSetParams = NULL
+cdef void* __cuGraphAddExternalSemaphoresWaitNode = NULL
+cdef void* __cuGraphExternalSemaphoresWaitNodeGetParams = NULL
+cdef void* __cuGraphExternalSemaphoresWaitNodeSetParams = NULL
+cdef void* __cuGraphAddBatchMemOpNode = NULL
+cdef void* __cuGraphBatchMemOpNodeGetParams = NULL
+cdef void* __cuGraphBatchMemOpNodeSetParams = NULL
+cdef void* __cuGraphExecBatchMemOpNodeSetParams = NULL
+cdef void* __cuGraphAddMemAllocNode = NULL
+cdef void* __cuGraphMemAllocNodeGetParams = NULL
+cdef void* __cuGraphAddMemFreeNode = NULL
+cdef void* __cuGraphMemFreeNodeGetParams = NULL
+cdef void* __cuDeviceGraphMemTrim = NULL
+cdef void* __cuDeviceGetGraphMemAttribute = NULL
+cdef void* __cuDeviceSetGraphMemAttribute = NULL
+cdef void* __cuGraphClone = NULL
+cdef void* __cuGraphNodeFindInClone = NULL
+cdef void* __cuGraphNodeGetType = NULL
+cdef void* __cuGraphGetNodes = NULL
+cdef void* __cuGraphGetRootNodes = NULL
+cdef void* __cuGraphGetEdges = NULL
+cdef void* __cuGraphGetEdges_v2 = NULL
+cdef void* __cuGraphNodeGetDependencies = NULL
+cdef void* __cuGraphNodeGetDependencies_v2 = NULL
+cdef void* __cuGraphNodeGetDependentNodes = NULL
+cdef void* __cuGraphNodeGetDependentNodes_v2 = NULL
+cdef void* __cuGraphAddDependencies = NULL
+cdef void* __cuGraphAddDependencies_v2 = NULL
+cdef void* __cuGraphRemoveDependencies = NULL
+cdef void* __cuGraphRemoveDependencies_v2 = NULL
+cdef void* __cuGraphDestroyNode = NULL
+cdef void* __cuGraphInstantiateWithFlags = NULL
+cdef void* __cuGraphInstantiateWithParams = NULL
+cdef void* __cuGraphExecGetFlags = NULL
+cdef void* __cuGraphExecKernelNodeSetParams_v2 = NULL
+cdef void* __cuGraphExecMemcpyNodeSetParams = NULL
+cdef void* __cuGraphExecMemsetNodeSetParams = NULL
+cdef void* __cuGraphExecHostNodeSetParams = NULL
+cdef void* __cuGraphExecChildGraphNodeSetParams = NULL
+cdef void* __cuGraphExecEventRecordNodeSetEvent = NULL
+cdef void* __cuGraphExecEventWaitNodeSetEvent = NULL
+cdef void* __cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL
+cdef void* __cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL
+cdef void* __cuGraphNodeSetEnabled = NULL
+cdef void* __cuGraphNodeGetEnabled = NULL
+cdef void* __cuGraphUpload = NULL
+cdef void* __cuGraphLaunch = NULL
+cdef void* __cuGraphExecDestroy = NULL
+cdef void* __cuGraphDestroy = NULL
+cdef void* __cuGraphExecUpdate_v2 = NULL
+cdef void* __cuGraphKernelNodeCopyAttributes = NULL
+cdef void* __cuGraphKernelNodeGetAttribute = NULL
+cdef void* __cuGraphKernelNodeSetAttribute = NULL
+cdef void* __cuGraphDebugDotPrint = NULL
+cdef void* __cuUserObjectCreate = NULL
+cdef void* __cuUserObjectRetain = NULL
+cdef void* __cuUserObjectRelease = NULL
+cdef void* __cuGraphRetainUserObject = NULL
+cdef void* __cuGraphReleaseUserObject = NULL
+cdef void* __cuGraphAddNode = NULL
+cdef void* __cuGraphAddNode_v2 = NULL
+cdef void* __cuGraphNodeSetParams = NULL
+cdef void* __cuGraphExecNodeSetParams = NULL
+cdef void* __cuGraphConditionalHandleCreate = NULL
+cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL
+cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL
+cdef void* __cuOccupancyMaxPotentialBlockSize = NULL
+cdef void* __cuOccupancyMaxPotentialBlockSizeWithFlags = NULL
+cdef void* __cuOccupancyAvailableDynamicSMemPerBlock = NULL
+cdef void* __cuOccupancyMaxPotentialClusterSize = NULL
+cdef void* __cuOccupancyMaxActiveClusters = NULL
+cdef void* __cuTexRefSetArray = NULL
+cdef void* __cuTexRefSetMipmappedArray = NULL
+cdef void* __cuTexRefSetAddress_v2 = NULL
+cdef void* __cuTexRefSetAddress2D_v3 = NULL
+cdef void* __cuTexRefSetFormat = NULL
+cdef void* __cuTexRefSetAddressMode = NULL
+cdef void* __cuTexRefSetFilterMode = NULL
+cdef void* __cuTexRefSetMipmapFilterMode = NULL
+cdef void* __cuTexRefSetMipmapLevelBias = NULL
+cdef void* __cuTexRefSetMipmapLevelClamp = NULL
+cdef void* __cuTexRefSetMaxAnisotropy = NULL
+cdef void* __cuTexRefSetBorderColor = NULL
+cdef void* __cuTexRefSetFlags = NULL
+cdef void* __cuTexRefGetAddress_v2 = NULL
+cdef void* __cuTexRefGetArray = NULL
+cdef void* __cuTexRefGetMipmappedArray = NULL
+cdef void* __cuTexRefGetAddressMode = NULL
+cdef void* __cuTexRefGetFilterMode = NULL
+cdef void* __cuTexRefGetFormat = NULL
+cdef void* __cuTexRefGetMipmapFilterMode = NULL
+cdef void* __cuTexRefGetMipmapLevelBias = NULL
+cdef void* __cuTexRefGetMipmapLevelClamp = NULL
+cdef void* __cuTexRefGetMaxAnisotropy = NULL
+cdef void* __cuTexRefGetBorderColor = NULL
+cdef void* __cuTexRefGetFlags = NULL
+cdef void* __cuTexRefCreate = NULL
+cdef void* __cuTexRefDestroy = NULL
+cdef void* __cuSurfRefSetArray = NULL
+cdef void* __cuSurfRefGetArray = NULL
+cdef void* __cuTexObjectCreate = NULL
+cdef void* __cuTexObjectDestroy = NULL
+cdef void* __cuTexObjectGetResourceDesc = NULL
+cdef void* __cuTexObjectGetTextureDesc = NULL
+cdef void* __cuTexObjectGetResourceViewDesc = NULL
+cdef void* __cuSurfObjectCreate = NULL
+cdef void* __cuSurfObjectDestroy = NULL
+cdef void* __cuSurfObjectGetResourceDesc = NULL
+cdef void* __cuTensorMapEncodeTiled = NULL
+cdef void* __cuTensorMapEncodeIm2col = NULL
+cdef void* __cuTensorMapEncodeIm2colWide = NULL
+cdef void* __cuTensorMapReplaceAddress = NULL
+cdef void* __cuDeviceCanAccessPeer = NULL
+cdef void* __cuCtxEnablePeerAccess = NULL
+cdef void* __cuCtxDisablePeerAccess = NULL
+cdef void* __cuDeviceGetP2PAttribute = NULL
+cdef void* __cuGraphicsUnregisterResource = NULL
+cdef void* __cuGraphicsSubResourceGetMappedArray = NULL
+cdef void* __cuGraphicsResourceGetMappedMipmappedArray = NULL
+cdef void* __cuGraphicsResourceGetMappedPointer_v2 = NULL
+cdef void* __cuGraphicsResourceSetMapFlags_v2 = NULL
+cdef void* __cuGraphicsMapResources = NULL
+cdef void* __cuGraphicsUnmapResources = NULL
+cdef void* __cuGetProcAddress_v2 = NULL
+cdef void* __cuCoredumpGetAttribute = NULL
+cdef void* __cuCoredumpGetAttributeGlobal = NULL
+cdef void* __cuCoredumpSetAttribute = NULL
+cdef void* __cuCoredumpSetAttributeGlobal = NULL
+cdef void* __cuGetExportTable = NULL
+cdef void* __cuGreenCtxCreate = NULL
+cdef void* __cuGreenCtxDestroy = NULL
+cdef void* __cuCtxFromGreenCtx = NULL
+cdef void* __cuDeviceGetDevResource = NULL
+cdef void* __cuCtxGetDevResource = NULL
+cdef void* __cuGreenCtxGetDevResource = NULL
+cdef void* __cuDevSmResourceSplitByCount = NULL
+cdef void* __cuDevResourceGenerateDesc = NULL
+cdef void* __cuGreenCtxRecordEvent = NULL
+cdef void* __cuGreenCtxWaitEvent = NULL
+cdef void* __cuStreamGetGreenCtx = NULL
+cdef void* __cuGreenCtxStreamCreate = NULL
+cdef void* __cuLogsRegisterCallback = NULL
+cdef void* __cuLogsUnregisterCallback = NULL
+cdef void* __cuLogsCurrent = NULL
+cdef void* __cuLogsDumpToFile = NULL
+cdef void* __cuLogsDumpToMemory = NULL
+cdef void* __cuCheckpointProcessGetRestoreThreadId = NULL
+cdef void* __cuCheckpointProcessGetState = NULL
+cdef void* __cuCheckpointProcessLock = NULL
+cdef void* __cuCheckpointProcessCheckpoint = NULL
+cdef void* __cuCheckpointProcessRestore = NULL
+cdef void* __cuCheckpointProcessUnlock = NULL
+cdef void* __cuGraphicsEGLRegisterImage = NULL
+cdef void* __cuEGLStreamConsumerConnect = NULL
+cdef void* __cuEGLStreamConsumerConnectWithFlags = NULL
+cdef void* __cuEGLStreamConsumerDisconnect = NULL
+cdef void* __cuEGLStreamConsumerAcquireFrame = NULL
+cdef void* __cuEGLStreamConsumerReleaseFrame = NULL
+cdef void* __cuEGLStreamProducerConnect = NULL
+cdef void* __cuEGLStreamProducerDisconnect = NULL
+cdef void* __cuEGLStreamProducerPresentFrame = NULL
+cdef void* __cuEGLStreamProducerReturnFrame = NULL
+cdef void* __cuGraphicsResourceGetMappedEglFrame = NULL
+cdef void* __cuEventCreateFromEGLSync = NULL
+cdef void* __cuGraphicsGLRegisterBuffer = NULL
+cdef void* __cuGraphicsGLRegisterImage = NULL
+cdef void* __cuGLGetDevices_v2 = NULL
+cdef void* __cuGLCtxCreate_v2 = NULL
+cdef void* __cuGLInit = NULL
+cdef void* __cuGLRegisterBufferObject = NULL
+cdef void* __cuGLMapBufferObject_v2 = NULL
+cdef void* __cuGLUnmapBufferObject = NULL
+cdef void* __cuGLUnregisterBufferObject = NULL
+cdef void* __cuGLSetBufferObjectMapFlags = NULL
+cdef void* __cuGLMapBufferObjectAsync_v2 = NULL
+cdef void* __cuGLUnmapBufferObjectAsync = NULL
+cdef void* __cuProfilerInitialize = NULL
+cdef void* __cuProfilerStart = NULL
+cdef void* __cuProfilerStop = NULL
+cdef void* __cuVDPAUGetDevice = NULL
+cdef void* __cuVDPAUCtxCreate_v2 = NULL
+cdef void* __cuGraphicsVDPAURegisterVideoSurface = NULL
+cdef void* __cuGraphicsVDPAURegisterOutputSurface = NULL
+
+cdef int _init_driver() except -1 nogil:
+ global _cyb___py_driver_init
+ cdef void* handle = NULL
+ cdef int ptds_mode
+ cdef _cyb_cuGetProcAddress_v2_T cuGetProcAddress_v2
+ with gil, _cyb_symbol_lock:
+ if _cyb___py_driver_init: return 0
+
+ handle = load_library()
+ if handle == NULL:
+ raise RuntimeError('Failed to open cuda')
+ # Get latest cuGetProcAddress_v2
+ cuGetProcAddress_v2 = <_cyb_cuGetProcAddress_v2_T>_cyb_dlsym(handle, 'cuGetProcAddress_v2')
+ if cuGetProcAddress_v2 == NULL:
+ raise RuntimeError("Failed to get cuGetProcAddress_v2")
+ if bool(int(_cyb_getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))):
+ ptds_mode = CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM
+ else:
+ ptds_mode = CU_GET_PROC_ADDRESS_DEFAULT
+ global __cuGetErrorString
+ cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, ptds_mode, NULL)
+
+ global __cuGetErrorName
+ cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, ptds_mode, NULL)
+
+ global __cuInit
+ cuGetProcAddress_v2('cuInit', &__cuInit, 2000, ptds_mode, NULL)
+
+ global __cuDriverGetVersion
+ cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, ptds_mode, NULL)
+
+ global __cuDeviceGet
+ cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, ptds_mode, NULL)
+
+ global __cuDeviceGetCount
+ cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, ptds_mode, NULL)
+
+ global __cuDeviceGetName
+ cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, ptds_mode, NULL)
+
+ global __cuDeviceGetUuid
+ cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, ptds_mode, NULL)
+
+ global __cuDeviceGetUuid_v2
+ cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, ptds_mode, NULL)
+
+ global __cuDeviceGetLuid
+ cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, ptds_mode, NULL)
+
+ global __cuDeviceTotalMem_v2
+ cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, ptds_mode, NULL)
+
+ global __cuDeviceGetTexture1DLinearMaxWidth
+ cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, ptds_mode, NULL)
+
+ global __cuDeviceGetAttribute
+ cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, ptds_mode, NULL)
+
+ global __cuDeviceGetNvSciSyncAttributes
+ cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, ptds_mode, NULL)
+
+ global __cuDeviceSetMemPool
+ cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, ptds_mode, NULL)
+
+ global __cuDeviceGetMemPool
+ cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, ptds_mode, NULL)
+
+ global __cuDeviceGetDefaultMemPool
+ cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, ptds_mode, NULL)
+
+ global __cuDeviceGetExecAffinitySupport
+ cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, ptds_mode, NULL)
+
+ global __cuFlushGPUDirectRDMAWrites
+ cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, ptds_mode, NULL)
+
+ global __cuDeviceGetProperties
+ cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, ptds_mode, NULL)
+
+ global __cuDeviceComputeCapability
+ cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, ptds_mode, NULL)
+
+ global __cuDevicePrimaryCtxRetain
+ cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, ptds_mode, NULL)
+
+ global __cuDevicePrimaryCtxRelease_v2
+ cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, ptds_mode, NULL)
+
+ global __cuDevicePrimaryCtxSetFlags_v2
+ cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, ptds_mode, NULL)
+
+ global __cuDevicePrimaryCtxGetState
+ cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, ptds_mode, NULL)
+
+ global __cuDevicePrimaryCtxReset_v2
+ cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL)
+
+ global __cuCtxCreate_v2
+ cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, ptds_mode, NULL)
+
+ global __cuCtxCreate_v3
+ cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, ptds_mode, NULL)
+
+ global __cuCtxCreate_v4
+ cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, ptds_mode, NULL)
+
+ global __cuCtxDestroy_v2
+ cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, ptds_mode, NULL)
+
+ global __cuCtxPushCurrent_v2
+ cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, ptds_mode, NULL)
+
+ global __cuCtxPopCurrent_v2
+ cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, ptds_mode, NULL)
+
+ global __cuCtxSetCurrent
+ cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, ptds_mode, NULL)
+
+ global __cuCtxGetCurrent
+ cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, ptds_mode, NULL)
+
+ global __cuCtxGetDevice
+ cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, ptds_mode, NULL)
+
+ global __cuCtxGetFlags
+ cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, ptds_mode, NULL)
+
+ global __cuCtxSetFlags
+ cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, ptds_mode, NULL)
+
+ global __cuCtxGetId
+ cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, ptds_mode, NULL)
+
+ global __cuCtxSynchronize
+ cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, ptds_mode, NULL)
+
+ global __cuCtxSetLimit
+ cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, ptds_mode, NULL)
+
+ global __cuCtxGetLimit
+ cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, ptds_mode, NULL)
+
+ global __cuCtxGetCacheConfig
+ cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, ptds_mode, NULL)
+
+ global __cuCtxSetCacheConfig
+ cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, ptds_mode, NULL)
+
+ global __cuCtxGetApiVersion
+ cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, ptds_mode, NULL)
+
+ global __cuCtxGetStreamPriorityRange
+ cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, ptds_mode, NULL)
+
+ global __cuCtxResetPersistingL2Cache
+ cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, ptds_mode, NULL)
+
+ global __cuCtxGetExecAffinity
+ cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, ptds_mode, NULL)
+
+ global __cuCtxRecordEvent
+ cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, ptds_mode, NULL)
+
+ global __cuCtxWaitEvent
+ cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, ptds_mode, NULL)
+
+ global __cuCtxAttach
+ cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, ptds_mode, NULL)
+
+ global __cuCtxDetach
+ cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, ptds_mode, NULL)
+
+ global __cuCtxGetSharedMemConfig
+ cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, ptds_mode, NULL)
+
+ global __cuCtxSetSharedMemConfig
+ cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, ptds_mode, NULL)
+
+ global __cuModuleLoad
+ cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, ptds_mode, NULL)
+
+ global __cuModuleLoadData
+ cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, ptds_mode, NULL)
+
+ global __cuModuleLoadDataEx
+ cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, ptds_mode, NULL)
+
+ global __cuModuleLoadFatBinary
+ cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, ptds_mode, NULL)
+
+ global __cuModuleUnload
+ cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, ptds_mode, NULL)
+
+ global __cuModuleGetLoadingMode
+ cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, ptds_mode, NULL)
+
+ global __cuModuleGetFunction
+ cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, ptds_mode, NULL)
+
+ global __cuModuleGetFunctionCount
+ cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, ptds_mode, NULL)
+
+ global __cuModuleEnumerateFunctions
+ cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, ptds_mode, NULL)
+
+ global __cuModuleGetGlobal_v2
+ cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, ptds_mode, NULL)
+
+ global __cuLinkCreate_v2
+ cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, ptds_mode, NULL)
+
+ global __cuLinkAddData_v2
+ cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, ptds_mode, NULL)
+
+ global __cuLinkAddFile_v2
+ cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, ptds_mode, NULL)
+
+ global __cuLinkComplete
+ cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, ptds_mode, NULL)
+
+ global __cuLinkDestroy
+ cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, ptds_mode, NULL)
+
+ global __cuModuleGetTexRef
+ cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, ptds_mode, NULL)
+
+ global __cuModuleGetSurfRef
+ cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, ptds_mode, NULL)
+
+ global __cuLibraryLoadData
+ cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, ptds_mode, NULL)
+
+ global __cuLibraryLoadFromFile
+ cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, ptds_mode, NULL)
+
+ global __cuLibraryUnload
+ cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, ptds_mode, NULL)
+
+ global __cuLibraryGetKernel
+ cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, ptds_mode, NULL)
+
+ global __cuLibraryGetKernelCount
+ cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, ptds_mode, NULL)
+
+ global __cuLibraryEnumerateKernels
+ cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, ptds_mode, NULL)
+
+ global __cuLibraryGetModule
+ cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, ptds_mode, NULL)
+
+ global __cuKernelGetFunction
+ cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, ptds_mode, NULL)
+
+ global __cuKernelGetLibrary
+ cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, ptds_mode, NULL)
+
+ global __cuLibraryGetGlobal
+ cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, ptds_mode, NULL)
+
+ global __cuLibraryGetManaged
+ cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, ptds_mode, NULL)
+
+ global __cuLibraryGetUnifiedFunction
+ cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, ptds_mode, NULL)
+
+ global __cuKernelGetAttribute
+ cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, ptds_mode, NULL)
+
+ global __cuKernelSetAttribute
+ cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, ptds_mode, NULL)
+
+ global __cuKernelSetCacheConfig
+ cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, ptds_mode, NULL)
+
+ global __cuKernelGetName
+ cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, ptds_mode, NULL)
+
+ global __cuKernelGetParamInfo
+ cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, ptds_mode, NULL)
+
+ global __cuMemGetInfo_v2
+ cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemAlloc_v2
+ cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemAllocPitch_v2
+ cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemFree_v2
+ cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemGetAddressRange_v2
+ cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemAllocHost_v2
+ cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemFreeHost
+ cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, ptds_mode, NULL)
+
+ global __cuMemHostAlloc
+ cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, ptds_mode, NULL)
+
+ global __cuMemHostGetDevicePointer_v2
+ cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, ptds_mode, NULL)
+
+ global __cuMemHostGetFlags
+ cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, ptds_mode, NULL)
+
+ global __cuMemAllocManaged
+ cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, ptds_mode, NULL)
+
+ global __cuDeviceRegisterAsyncNotification
+ cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, ptds_mode, NULL)
+
+ global __cuDeviceUnregisterAsyncNotification
+ cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, ptds_mode, NULL)
+
+ global __cuDeviceGetByPCIBusId
+ cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, ptds_mode, NULL)
+
+ global __cuDeviceGetPCIBusId
+ cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, ptds_mode, NULL)
+
+ global __cuIpcGetEventHandle
+ cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, ptds_mode, NULL)
+
+ global __cuIpcOpenEventHandle
+ cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, ptds_mode, NULL)
+
+ global __cuIpcGetMemHandle
+ cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, ptds_mode, NULL)
+
+ global __cuIpcOpenMemHandle_v2
+ cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, ptds_mode, NULL)
+
+ global __cuIpcCloseMemHandle
+ cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, ptds_mode, NULL)
+
+ global __cuMemHostRegister_v2
+ cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, ptds_mode, NULL)
+
+ global __cuMemHostUnregister
+ cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, ptds_mode, NULL)
+
+ global __cuMemcpy
+ cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL)
+
+ global __cuMemcpyPeer
+ cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL)
+
+ global __cuMemcpyHtoD_v2
+ cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyDtoH_v2
+ cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyDtoD_v2
+ cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyDtoA_v2
+ cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyAtoD_v2
+ cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyHtoA_v2
+ cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyAtoH_v2
+ cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpyAtoA_v2
+ cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpy2D_v2
+ cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpy2DUnaligned_v2
+ cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpy3D_v2
+ cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL)
+
+ global __cuMemcpy3DPeer
+ cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL)
+
+ global __cuMemcpyAsync
+ cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL)
+
+ global __cuMemcpyPeerAsync
+ cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL)
+
+ global __cuMemcpyHtoDAsync_v2
+ cuGetProcAddress_v2('cuMemcpyHtoDAsync',