From 01f33cdce0b783e721e55b779c0713b7415d105f Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 24 Mar 2026 16:47:01 -0700 Subject: [PATCH 01/14] build: use cuda.pathfinder.get_cuda_path_or_home in build hooks Pin cuda-pathfinder>=1.5 in both build-system.requires and project.dependencies. Made-with: Cursor --- cuda_bindings/build_hooks.py | 32 ++++++++++++++++++++++++----- cuda_bindings/pyproject.toml | 3 ++- cuda_core/build_hooks.py | 32 ++++++++++++++++++++++++----- cuda_core/pyproject.toml | 3 ++- cuda_core/tests/test_build_hooks.py | 7 ++++++- 5 files changed, 64 insertions(+), 13 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index a48aa0f0e9..1bd2b37424 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -33,13 +33,35 @@ _extensions = None +# Please keep in sync with the copy in cuda_core/build_hooks.py. +def _import_get_cuda_path_or_home(): + """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. + + In isolated build environments, backend-path=["."] causes the ``cuda`` + namespace package to resolve to only the project's ``cuda/`` directory, + hiding ``cuda.pathfinder`` installed in the build-env's site-packages. + Fix by replacing ``cuda.__path__`` with a plain list that includes the + site-packages ``cuda/`` directory. + """ + try: + import cuda.pathfinder + except ModuleNotFoundError: + import cuda + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + import cuda.pathfinder + + return cuda.pathfinder.get_cuda_path_or_home + + @functools.cache def _get_cuda_path() -> str: - # Not using cuda.pathfinder.get_cuda_path_or_home() here because this - # build backend runs in an isolated venv where the cuda namespace package - # from backend-path shadows the installed cuda-pathfinder. See #1803 for - # a workaround to apply after cuda-pathfinder >= 1.5 is released. - cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")) + get_cuda_path_or_home = _import_get_cuda_path_or_home() + cuda_path = get_cuda_path_or_home() if not cuda_path: raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") print("CUDA path:", cuda_path) diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 96cfb4dd07..9a4f189815 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -6,6 +6,7 @@ requires = [ "setuptools_scm[simple]>=8", "cython>=3.2,<3.3", "pyclibrary>=0.1.7", + "cuda-pathfinder>=1.5", ] build-backend = "build_hooks" backend-path = ["."] @@ -31,7 +32,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA", ] dynamic = ["version", "readme"] -dependencies = ["cuda-pathfinder >=1.4.2"] +dependencies = ["cuda-pathfinder >=1.5"] [project.optional-dependencies] all = [ diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index b368b02759..912848317a 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -28,13 +28,35 @@ COMPILE_FOR_COVERAGE = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0"))) +# Please keep in sync with the copy in cuda_bindings/build_hooks.py. +def _import_get_cuda_path_or_home(): + """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. + + In isolated build environments, backend-path=["."] causes the ``cuda`` + namespace package to resolve to only the project's ``cuda/`` directory, + hiding ``cuda.pathfinder`` installed in the build-env's site-packages. + Fix by replacing ``cuda.__path__`` with a plain list that includes the + site-packages ``cuda/`` directory. + """ + try: + import cuda.pathfinder + except ModuleNotFoundError: + import cuda + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + import cuda.pathfinder + + return cuda.pathfinder.get_cuda_path_or_home + + @functools.cache def _get_cuda_path() -> str: - # Not using cuda.pathfinder.get_cuda_path_or_home() here because this - # build backend runs in an isolated venv where the cuda namespace package - # from backend-path shadows the installed cuda-pathfinder. See #1803 for - # a workaround to apply after cuda-pathfinder >= 1.5 is released. - cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")) + get_cuda_path_or_home = _import_get_cuda_path_or_home() + cuda_path = get_cuda_path_or_home() if not cuda_path: raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") print("CUDA path:", cuda_path) diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 107c2ffb92..dc418342b5 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -7,6 +7,7 @@ requires = [ "setuptools>=80", "setuptools-scm[simple]>=8", "Cython>=3.2,<3.3", + "cuda-pathfinder>=1.5" ] build-backend = "build_hooks" backend-path = ["."] @@ -47,7 +48,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA :: 13", ] dependencies = [ - "cuda-pathfinder >=1.4.2", + "cuda-pathfinder >=1.5", "numpy", ] diff --git a/cuda_core/tests/test_build_hooks.py b/cuda_core/tests/test_build_hooks.py index b298e7a977..121ed1be05 100644 --- a/cuda_core/tests/test_build_hooks.py +++ b/cuda_core/tests/test_build_hooks.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Tests for build_hooks.py build infrastructure. @@ -24,6 +24,8 @@ import pytest +from cuda.pathfinder import get_cuda_path_or_home + # build_hooks.py imports Cython and setuptools at the top level, so skip if not available pytest.importorskip("Cython") pytest.importorskip("setuptools") @@ -68,6 +70,7 @@ def _check_version_detection( build_hooks._get_cuda_path.cache_clear() build_hooks._determine_cuda_major_version.cache_clear() + get_cuda_path_or_home.cache_clear() mock_env = { k: v @@ -92,6 +95,7 @@ def test_env_var_override(self, version): """CUDA_CORE_BUILD_MAJOR env var override works with various versions.""" build_hooks._get_cuda_path.cache_clear() build_hooks._determine_cuda_major_version.cache_clear() + get_cuda_path_or_home.cache_clear() with mock.patch.dict(os.environ, {"CUDA_CORE_BUILD_MAJOR": version}, clear=False): result = build_hooks._determine_cuda_major_version() assert result == version @@ -125,6 +129,7 @@ def test_missing_cuda_path_raises_error(self): """RuntimeError is raised when CUDA_PATH/CUDA_HOME not set and no env var override.""" build_hooks._get_cuda_path.cache_clear() build_hooks._determine_cuda_major_version.cache_clear() + get_cuda_path_or_home.cache_clear() with ( mock.patch.dict(os.environ, {}, clear=True), pytest.raises(RuntimeError, match="CUDA_PATH or CUDA_HOME"), From 0fc45970483957817d5e7c78086afc68027cf605 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 24 Mar 2026 16:53:24 -0700 Subject: [PATCH 02/14] chore: update stale pixi package version to 1.5.0 The previous 1.3.4a0 was a stale value that could confuse someone. Made-with: Cursor --- cuda_pathfinder/pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_pathfinder/pixi.toml b/cuda_pathfinder/pixi.toml index 0d780290b6..961450699c 100644 --- a/cuda_pathfinder/pixi.toml +++ b/cuda_pathfinder/pixi.toml @@ -36,7 +36,7 @@ cu12 = { features = ["cu12", "test"], solve-group = "cu12" } # TODO: check if these can be extracted from pyproject.toml [package] name = "cuda-pathfinder" -version = "1.3.4a0" +version = "1.5.0" [package.build] backend = { name = "pixi-build-python", version = "*" } From 3d422de019926291c9107598918393b4c8584525 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 25 Mar 2026 11:18:42 -0700 Subject: [PATCH 03/14] build: raise actionable error when cuda-pathfinder not found on sys.path Made-with: Cursor --- cuda_bindings/build_hooks.py | 5 +++++ cuda_core/build_hooks.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 1bd2b37424..9e592431ee 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -53,6 +53,11 @@ def _import_get_cuda_path_or_home(): if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): cuda.__path__ = list(cuda.__path__) + [sp_cuda] break + else: + raise ModuleNotFoundError( + "cuda-pathfinder is not installed in the build environment. " + "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." + ) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index 912848317a..d5f2bb43a2 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -48,6 +48,11 @@ def _import_get_cuda_path_or_home(): if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): cuda.__path__ = list(cuda.__path__) + [sp_cuda] break + else: + raise ModuleNotFoundError( + "cuda-pathfinder is not installed in the build environment. " + "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." + ) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home From 6892ae01391c92f30a28699f1e710120451b8037 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 25 Mar 2026 12:37:22 -0700 Subject: [PATCH 04/14] build: replace inline docstring with reference to issue #1824 Made-with: Cursor --- cuda_bindings/build_hooks.py | 6 +----- cuda_core/build_hooks.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 9e592431ee..9c6710a264 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -37,11 +37,7 @@ def _import_get_cuda_path_or_home(): """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. - In isolated build environments, backend-path=["."] causes the ``cuda`` - namespace package to resolve to only the project's ``cuda/`` directory, - hiding ``cuda.pathfinder`` installed in the build-env's site-packages. - Fix by replacing ``cuda.__path__`` with a plain list that includes the - site-packages ``cuda/`` directory. + See https://github.com/NVIDIA/cuda-python/issues/1824 for why this helper is needed. """ try: import cuda.pathfinder diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index d5f2bb43a2..ce77de3c17 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -32,11 +32,7 @@ def _import_get_cuda_path_or_home(): """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. - In isolated build environments, backend-path=["."] causes the ``cuda`` - namespace package to resolve to only the project's ``cuda/`` directory, - hiding ``cuda.pathfinder`` installed in the build-env's site-packages. - Fix by replacing ``cuda.__path__`` with a plain list that includes the - site-packages ``cuda/`` directory. + See https://github.com/NVIDIA/cuda-python/issues/1824 for why this helper is needed. """ try: import cuda.pathfinder From b779d0d99a90a155b8fd9a242c13f5b4d6d872fb Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 08:41:32 -0700 Subject: [PATCH 05/14] build: narrow except to only catch cuda.pathfinder-not-found Made-with: Cursor --- cuda_bindings/build_hooks.py | 4 +++- cuda_core/build_hooks.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 9c6710a264..398d0d7f62 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -41,7 +41,9 @@ def _import_get_cuda_path_or_home(): """ try: import cuda.pathfinder - except ModuleNotFoundError: + except ModuleNotFoundError as exc: + if exc.name != "cuda.pathfinder": + raise import cuda for p in sys.path: diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index ce77de3c17..6b51d02b30 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -36,7 +36,9 @@ def _import_get_cuda_path_or_home(): """ try: import cuda.pathfinder - except ModuleNotFoundError: + except ModuleNotFoundError as exc: + if exc.name != "cuda.pathfinder": + raise import cuda for p in sys.path: From 6facaa5272c289e3d93576a446567871a4ca732c Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 08:52:40 -0700 Subject: [PATCH 06/14] build: use importlib.metadata to locate cuda-pathfinder instead of scanning sys.path Made-with: Cursor --- cuda_bindings/build_hooks.py | 18 +++++++++++------- cuda_core/build_hooks.py | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 398d0d7f62..07c370c5ee 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -44,18 +44,22 @@ def _import_get_cuda_path_or_home(): except ModuleNotFoundError as exc: if exc.name != "cuda.pathfinder": raise + from importlib.metadata import PackageNotFoundError, distribution + from pathlib import Path + import cuda - for p in sys.path: - sp_cuda = os.path.join(p, "cuda") - if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): - cuda.__path__ = list(cuda.__path__) + [sp_cuda] - break - else: + try: + dist = distribution("cuda-pathfinder") + except PackageNotFoundError: raise ModuleNotFoundError( "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." - ) + ) from None + site_cuda = str(dist.locate_file(Path("cuda"))) + cuda_paths = list(cuda.__path__) + if site_cuda not in cuda_paths: + cuda.__path__ = cuda_paths + [site_cuda] import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index 6b51d02b30..3483f7d041 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -39,18 +39,22 @@ def _import_get_cuda_path_or_home(): except ModuleNotFoundError as exc: if exc.name != "cuda.pathfinder": raise + from importlib.metadata import PackageNotFoundError, distribution + from pathlib import Path + import cuda - for p in sys.path: - sp_cuda = os.path.join(p, "cuda") - if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): - cuda.__path__ = list(cuda.__path__) + [sp_cuda] - break - else: + try: + dist = distribution("cuda-pathfinder") + except PackageNotFoundError: raise ModuleNotFoundError( "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." - ) + ) from None + site_cuda = str(dist.locate_file(Path("cuda"))) + cuda_paths = list(cuda.__path__) + if site_cuda not in cuda_paths: + cuda.__path__ = cuda_paths + [site_cuda] import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home From f1ef076d5063a16c5224fbacb185aaeac4f0ab5f Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 09:40:54 -0700 Subject: [PATCH 07/14] build: produce actionable error when cuda namespace is entirely absent Made-with: Cursor --- cuda_bindings/build_hooks.py | 6 +++--- cuda_core/build_hooks.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 07c370c5ee..81a112e022 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -42,13 +42,11 @@ def _import_get_cuda_path_or_home(): try: import cuda.pathfinder except ModuleNotFoundError as exc: - if exc.name != "cuda.pathfinder": + if exc.name not in ("cuda", "cuda.pathfinder"): raise from importlib.metadata import PackageNotFoundError, distribution from pathlib import Path - import cuda - try: dist = distribution("cuda-pathfinder") except PackageNotFoundError: @@ -56,6 +54,8 @@ def _import_get_cuda_path_or_home(): "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." ) from None + import cuda + site_cuda = str(dist.locate_file(Path("cuda"))) cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index 3483f7d041..fcca21ad95 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -37,13 +37,11 @@ def _import_get_cuda_path_or_home(): try: import cuda.pathfinder except ModuleNotFoundError as exc: - if exc.name != "cuda.pathfinder": + if exc.name not in ("cuda", "cuda.pathfinder"): raise from importlib.metadata import PackageNotFoundError, distribution from pathlib import Path - import cuda - try: dist = distribution("cuda-pathfinder") except PackageNotFoundError: @@ -51,6 +49,8 @@ def _import_get_cuda_path_or_home(): "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." ) from None + import cuda + site_cuda = str(dist.locate_file(Path("cuda"))) cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: From 3cb0313301d2b3ce1dd822542d8fced87546cbd5 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 10:02:48 -0700 Subject: [PATCH 08/14] build: diagnostic for importlib.metadata locate_file in PEP 517 builds Made-with: Cursor --- cuda_bindings/build_hooks.py | 19 ++++++++++++++++++- cuda_core/build_hooks.py | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 81a112e022..1a59777aeb 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -56,10 +56,27 @@ def _import_get_cuda_path_or_home(): ) from None import cuda - site_cuda = str(dist.locate_file(Path("cuda"))) + locate_result = str(dist.locate_file(Path("cuda"))) + print(f"[diag] dist._path: {dist._path}", flush=True) + print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True) + print(f"[diag] locate_file('cuda'): {locate_result}", flush=True) + print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True) + print( + f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}", + flush=True, + ) + print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True) + print("[diag] sys.path:", flush=True) + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder")) + print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True) + + site_cuda = locate_result cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: cuda.__path__ = cuda_paths + [site_cuda] + print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index fcca21ad95..6b4a117faa 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -51,10 +51,27 @@ def _import_get_cuda_path_or_home(): ) from None import cuda - site_cuda = str(dist.locate_file(Path("cuda"))) + locate_result = str(dist.locate_file(Path("cuda"))) + print(f"[diag] dist._path: {dist._path}", flush=True) + print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True) + print(f"[diag] locate_file('cuda'): {locate_result}", flush=True) + print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True) + print( + f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}", + flush=True, + ) + print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True) + print("[diag] sys.path:", flush=True) + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder")) + print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True) + + site_cuda = locate_result cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: cuda.__path__ = cuda_paths + [site_cuda] + print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home From a9995acafe50dc42d359054acf4cb0244eee5176 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 12:14:23 -0700 Subject: [PATCH 09/14] Revert "build: diagnostic for importlib.metadata locate_file in PEP 517 builds" This reverts commit 3cb0313301d2b3ce1dd822542d8fced87546cbd5. --- cuda_bindings/build_hooks.py | 19 +------------------ cuda_core/build_hooks.py | 19 +------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 1a59777aeb..81a112e022 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -56,27 +56,10 @@ def _import_get_cuda_path_or_home(): ) from None import cuda - locate_result = str(dist.locate_file(Path("cuda"))) - print(f"[diag] dist._path: {dist._path}", flush=True) - print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True) - print(f"[diag] locate_file('cuda'): {locate_result}", flush=True) - print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True) - print( - f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}", - flush=True, - ) - print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True) - print("[diag] sys.path:", flush=True) - for p in sys.path: - sp_cuda = os.path.join(p, "cuda") - has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder")) - print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True) - - site_cuda = locate_result + site_cuda = str(dist.locate_file(Path("cuda"))) cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: cuda.__path__ = cuda_paths + [site_cuda] - print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index 6b4a117faa..fcca21ad95 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -51,27 +51,10 @@ def _import_get_cuda_path_or_home(): ) from None import cuda - locate_result = str(dist.locate_file(Path("cuda"))) - print(f"[diag] dist._path: {dist._path}", flush=True) - print(f"[diag] dist._path.parent: {dist._path.parent}", flush=True) - print(f"[diag] locate_file('cuda'): {locate_result}", flush=True) - print(f"[diag] locate_file exists: {os.path.isdir(locate_result)}", flush=True) - print( - f"[diag] locate_file/pathfinder exists: {os.path.isdir(os.path.join(locate_result, 'pathfinder'))}", - flush=True, - ) - print(f"[diag] cuda.__path__ (before): {cuda.__path__}", flush=True) - print("[diag] sys.path:", flush=True) - for p in sys.path: - sp_cuda = os.path.join(p, "cuda") - has_pf = os.path.isdir(os.path.join(sp_cuda, "pathfinder")) - print(f"[diag] {p} -> cuda/pathfinder exists: {has_pf}", flush=True) - - site_cuda = locate_result + site_cuda = str(dist.locate_file(Path("cuda"))) cuda_paths = list(cuda.__path__) if site_cuda not in cuda_paths: cuda.__path__ = cuda_paths + [site_cuda] - print(f"[diag] cuda.__path__ (after): {cuda.__path__}", flush=True) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home From cb5ffbb136ea6559fbe62ec085327116e58bda11 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 31 Mar 2026 12:18:11 -0700 Subject: [PATCH 10/14] build: revert to sys.path scan, importlib.metadata finds wrong dist-info See https://github.com/NVIDIA/cuda-python/pull/1817#discussion_r3017709196 See https://github.com/NVIDIA/cuda-python/pull/1817#discussion_r3017746666 Made-with: Cursor --- cuda_bindings/build_hooks.py | 23 +++++++++++------------ cuda_core/build_hooks.py | 23 +++++++++++------------ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index 81a112e022..b08b0d24d8 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -44,22 +44,21 @@ def _import_get_cuda_path_or_home(): except ModuleNotFoundError as exc: if exc.name not in ("cuda", "cuda.pathfinder"): raise - from importlib.metadata import PackageNotFoundError, distribution - from pathlib import Path - try: - dist = distribution("cuda-pathfinder") - except PackageNotFoundError: + import cuda + except ModuleNotFoundError: + cuda = None + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + else: raise ModuleNotFoundError( "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." - ) from None - import cuda - - site_cuda = str(dist.locate_file(Path("cuda"))) - cuda_paths = list(cuda.__path__) - if site_cuda not in cuda_paths: - cuda.__path__ = cuda_paths + [site_cuda] + ) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index fcca21ad95..491879c2ab 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -39,22 +39,21 @@ def _import_get_cuda_path_or_home(): except ModuleNotFoundError as exc: if exc.name not in ("cuda", "cuda.pathfinder"): raise - from importlib.metadata import PackageNotFoundError, distribution - from pathlib import Path - try: - dist = distribution("cuda-pathfinder") - except PackageNotFoundError: + import cuda + except ModuleNotFoundError: + cuda = None + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + else: raise ModuleNotFoundError( "cuda-pathfinder is not installed in the build environment. " "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." - ) from None - import cuda - - site_cuda = str(dist.locate_file(Path("cuda"))) - cuda_paths = list(cuda.__path__) - if site_cuda not in cuda_paths: - cuda.__path__ = cuda_paths + [site_cuda] + ) import cuda.pathfinder return cuda.pathfinder.get_cuda_path_or_home From 62d334eed6391c28b18d3590d4cb2508d1fca278 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 8 Apr 2026 15:28:56 -0700 Subject: [PATCH 11/14] Revert changes to cuda-pathfinder runtime dependency pinning. --- cuda_bindings/pyproject.toml | 2 +- cuda_core/pyproject.toml | 2 +- cuda_pathfinder/pixi.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 0fcc007d24..3aa9c62556 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA", ] dynamic = ["version", "readme"] -dependencies = ["cuda-pathfinder >=1.5"] +dependencies = ["cuda-pathfinder >=1.4.2"] [project.optional-dependencies] all = [ diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index e779bda126..660c2a577f 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -48,7 +48,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA :: 13", ] dependencies = [ - "cuda-pathfinder >=1.5", + "cuda-pathfinder >=1.4.2", "numpy", ] diff --git a/cuda_pathfinder/pixi.toml b/cuda_pathfinder/pixi.toml index 86b296072e..7ebcc9644d 100644 --- a/cuda_pathfinder/pixi.toml +++ b/cuda_pathfinder/pixi.toml @@ -59,7 +59,7 @@ nvidia-sphinx-theme = "*" # TODO: check if these can be extracted from pyproject.toml [package] name = "cuda-pathfinder" -version = "1.5.0" +version = "1.3.4a0" [package.build] backend = { name = "pixi-build-python", version = "*" } From 937ff7fad754718457c72faa82bf5ae02885e234 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 8 Apr 2026 21:40:12 -0700 Subject: [PATCH 12/14] Exclude broken cuda-toolkit patch releases from dependency specs. Use exclusion-style constraints in cuda_bindings, cuda_core, and cuda_pathfinder so CI avoids cuda-toolkit 12.9.2 and 13.0.3 while still allowing newer good patch releases. Made-with: Cursor --- cuda_bindings/pyproject.toml | 4 ++-- cuda_core/pyproject.toml | 8 ++++---- cuda_pathfinder/pyproject.toml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 3aa9c62556..7e1a239339 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -36,8 +36,8 @@ dependencies = ["cuda-pathfinder >=1.4.2"] [project.optional-dependencies] all = [ - "cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*", - "cuda-toolkit[cufile]==13.*; sys_platform == 'linux'", + "cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*,!=13.0.3", + "cuda-toolkit[cufile]==13.*,!=13.0.3; sys_platform == 'linux'", ] [dependency-groups] diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 660c2a577f..b229b67a5b 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -59,12 +59,12 @@ cu13 = ["cuda-bindings[all]==13.*"] [dependency-groups] test = ["cython>=3.2,<3.3", "setuptools", "pytest>=6.2.4", "pytest-benchmark", "pytest-randomly", "pytest-repeat", "pytest-rerunfailures", "cloudpickle", "psutil", "cffi"] ml-dtypes = ["ml-dtypes>=0.5.4,<0.6.0"] -test-cu12 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy -test-cu13 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy +test-cu12 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*,!=12.9.2"] # runtime headers needed by CuPy +test-cu13 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*,!=13.0.3"] # runtime headers needed by CuPy # free threaded build, cupy doesn't support free-threaded builds yet, so avoid installing it for now # TODO: cupy should support free threaded builds -test-cu12-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==12.*"] -test-cu13-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==13.*"] +test-cu12-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==12.*,!=12.9.2"] +test-cu13-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==13.*,!=13.0.3"] [tool.uv] conflicts = [ diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 7d96e72023..801834f52c 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -19,8 +19,8 @@ test = [ ] # Internal organization of test dependencies. cu12 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler]==12.*", - "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler]==12.*,!=12.9.2", + "cuda-toolkit[cufile]==12.*,!=12.9.2; sys_platform != 'win32'", "cutensor-cu12", "nvidia-cublasmp-cu12; sys_platform != 'win32'", "nvidia-cudss-cu12", @@ -32,8 +32,8 @@ cu12 = [ "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] cu13 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler,nvvm]==13.*", - "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler,nvvm]==13.*,!=13.0.3", + "cuda-toolkit[cufile]==13.*,!=13.0.3; sys_platform != 'win32'", "cutensor-cu13", "nvidia-cublasmp-cu13; sys_platform != 'win32'", "nvidia-cudla; platform_system == 'Linux' and platform_machine == 'aarch64'", From 96e1b69bf43cc6566d3beb52882b60735c1cbc5a Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 9 Apr 2026 09:12:23 -0700 Subject: [PATCH 13/14] Revert "Exclude broken cuda-toolkit patch releases from dependency specs." This reverts commit 937ff7fad754718457c72faa82bf5ae02885e234. --- cuda_bindings/pyproject.toml | 4 ++-- cuda_core/pyproject.toml | 8 ++++---- cuda_pathfinder/pyproject.toml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 7e1a239339..3aa9c62556 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -36,8 +36,8 @@ dependencies = ["cuda-pathfinder >=1.4.2"] [project.optional-dependencies] all = [ - "cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*,!=13.0.3", - "cuda-toolkit[cufile]==13.*,!=13.0.3; sys_platform == 'linux'", + "cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*", + "cuda-toolkit[cufile]==13.*; sys_platform == 'linux'", ] [dependency-groups] diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index b229b67a5b..660c2a577f 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -59,12 +59,12 @@ cu13 = ["cuda-bindings[all]==13.*"] [dependency-groups] test = ["cython>=3.2,<3.3", "setuptools", "pytest>=6.2.4", "pytest-benchmark", "pytest-randomly", "pytest-repeat", "pytest-rerunfailures", "cloudpickle", "psutil", "cffi"] ml-dtypes = ["ml-dtypes>=0.5.4,<0.6.0"] -test-cu12 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*,!=12.9.2"] # runtime headers needed by CuPy -test-cu13 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*,!=13.0.3"] # runtime headers needed by CuPy +test-cu12 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy +test-cu13 = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy # free threaded build, cupy doesn't support free-threaded builds yet, so avoid installing it for now # TODO: cupy should support free threaded builds -test-cu12-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==12.*,!=12.9.2"] -test-cu13-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==13.*,!=13.0.3"] +test-cu12-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==12.*"] +test-cu13-ft = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cuda-toolkit[cudart]==13.*"] [tool.uv] conflicts = [ diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 801834f52c..7d96e72023 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -19,8 +19,8 @@ test = [ ] # Internal organization of test dependencies. cu12 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler]==12.*,!=12.9.2", - "cuda-toolkit[cufile]==12.*,!=12.9.2; sys_platform != 'win32'", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler]==12.*", + "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", "cutensor-cu12", "nvidia-cublasmp-cu12; sys_platform != 'win32'", "nvidia-cudss-cu12", @@ -32,8 +32,8 @@ cu12 = [ "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] cu13 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler,nvvm]==13.*,!=13.0.3", - "cuda-toolkit[cufile]==13.*,!=13.0.3; sys_platform != 'win32'", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,cupti,profiler,nvvm]==13.*", + "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", "cutensor-cu13", "nvidia-cublasmp-cu13; sys_platform != 'win32'", "nvidia-cudla; platform_system == 'Linux' and platform_machine == 'aarch64'", From c5cb5103f3f43b0f8af356c6cc6a1bb976e28bb5 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 9 Apr 2026 18:40:02 -0400 Subject: [PATCH 14/14] Move cuda_bindings to a src/ layout --- .gitignore | 68 +- cuda_bindings/MANIFEST.in | 8 +- cuda_bindings/build_hooks.py | 69 +- cuda_bindings/pyproject.toml | 3 +- cuda_bindings/setup.py | 1 + .../{ => src}/cuda/bindings/__init__.pxd | 0 .../{ => src}/cuda/bindings/__init__.py | 2 +- .../cuda/bindings/_bindings/__init__.py | 0 .../cuda/bindings/_bindings/cydriver.pxd.in | 1 - .../cuda/bindings/_bindings/cydriver.pyx.in | 0 .../cuda/bindings/_bindings/cynvrtc.pxd.in | 1 - .../cuda/bindings/_bindings/cynvrtc.pyx.in | 0 .../cuda/bindings/_bindings/cyruntime.pxd.in | 0 .../cuda/bindings/_bindings/cyruntime.pyx.in | 0 .../bindings/_bindings/cyruntime_ptds.pxd.in | 0 .../bindings/_bindings/cyruntime_ptds.pyx.in | 0 .../cuda/bindings/_bindings/loader.cpp | 2 +- .../cuda/bindings/_bindings/loader.h | 2 +- .../cuda/bindings/_bindings/loader.pxd | 2 +- .../bindings/_example_helpers/__init__.py | 0 .../cuda/bindings/_example_helpers/common.py | 0 .../bindings/_example_helpers/helper_cuda.py | 0 .../_example_helpers/helper_string.py | 0 .../cuda/bindings/_internal/__init__.py | 0 .../cuda/bindings/_internal/_fast_enum.py | 0 .../cuda/bindings/_internal/cufile.pxd | 0 .../cuda/bindings/_internal/cufile_linux.pyx | 0 .../cuda/bindings/_internal/nvfatbin.pxd | 0 .../bindings/_internal/nvfatbin_linux.pyx | 0 .../bindings/_internal/nvfatbin_windows.pyx | 0 .../cuda/bindings/_internal/nvjitlink.pxd | 0 .../bindings/_internal/nvjitlink_linux.pyx | 0 .../bindings/_internal/nvjitlink_windows.pyx | 0 .../cuda/bindings/_internal/nvml.pxd | 0 .../cuda/bindings/_internal/nvml_linux.pyx | 0 .../cuda/bindings/_internal/nvml_windows.pyx | 0 .../cuda/bindings/_internal/nvvm.pxd | 0 .../cuda/bindings/_internal/nvvm_linux.pyx | 0 .../cuda/bindings/_internal/nvvm_windows.pyx | 0 .../cuda/bindings/_internal/utils.pxd | 2 +- .../cuda/bindings/_internal/utils.pyx | 0 .../{ => src}/cuda/bindings/_lib/__init__.py | 0 .../bindings/_lib/cyruntime/cyruntime.pxd | 2 +- .../bindings/_lib/cyruntime/cyruntime.pxi | 2 +- .../{ => src}/cuda/bindings/_lib/dlfcn.pxd | 2 +- .../cuda/bindings/_lib/param_packer.h | 2 +- .../cuda/bindings/_lib/param_packer.pxd | 2 +- .../{ => src}/cuda/bindings/_lib/utils.pxd.in | 2 +- .../{ => src}/cuda/bindings/_lib/utils.pxi.in | 6 +- .../{ => src}/cuda/bindings/_lib/windll.pxd | 2 +- .../cuda/bindings/_test_helpers/__init__.py | 0 .../cuda/bindings/_test_helpers/arch_check.py | 0 .../cuda/bindings/_test_helpers/pep723.py | 0 .../{ => src}/cuda/bindings/cufile.pxd | 0 .../{ => src}/cuda/bindings/cufile.pyx | 0 .../{ => src}/cuda/bindings/cycufile.pxd | 0 .../{ => src}/cuda/bindings/cycufile.pyx | 0 .../{ => src}/cuda/bindings/cydriver.pxd.in | 2 +- .../cuda/bindings/cydriver.pyx} | 1473 ----------------- .../{ => src}/cuda/bindings/cynvfatbin.pxd | 0 .../{ => src}/cuda/bindings/cynvfatbin.pyx | 0 .../{ => src}/cuda/bindings/cynvjitlink.pxd | 0 .../{ => src}/cuda/bindings/cynvjitlink.pyx | 0 .../{ => src}/cuda/bindings/cynvml.pxd | 0 .../{ => src}/cuda/bindings/cynvml.pyx | 0 .../{ => src}/cuda/bindings/cynvrtc.pxd.in | 1 - .../{ => src}/cuda/bindings/cynvrtc.pyx.in | 0 .../{ => src}/cuda/bindings/cynvvm.pxd | 0 .../{ => src}/cuda/bindings/cynvvm.pyx | 0 .../{ => src}/cuda/bindings/cyruntime.pxd.in | 2 +- .../{ => src}/cuda/bindings/cyruntime.pyx.in | 0 .../cuda/bindings/cyruntime_functions.pxi.in | 1 - .../cuda/bindings/cyruntime_types.pxi} | 0 .../{ => src}/cuda/bindings/driver.pxd.in | 0 .../{ => src}/cuda/bindings/driver.pyx.in | 7 +- .../{ => src}/cuda/bindings/nvfatbin.pxd | 0 .../{ => src}/cuda/bindings/nvfatbin.pyx | 0 .../{ => src}/cuda/bindings/nvjitlink.pxd | 0 .../{ => src}/cuda/bindings/nvjitlink.pyx | 0 .../{ => src}/cuda/bindings/nvml.pxd | 0 .../{ => src}/cuda/bindings/nvml.pyx | 0 .../{ => src}/cuda/bindings/nvrtc.pxd.in | 0 .../{ => src}/cuda/bindings/nvrtc.pyx.in | 4 +- .../{ => src}/cuda/bindings/nvvm.pxd | 0 .../{ => src}/cuda/bindings/nvvm.pyx | 0 .../{ => src}/cuda/bindings/runtime.pxd.in | 0 .../{ => src}/cuda/bindings/runtime.pyx.in | 7 +- .../{ => src}/cuda/bindings/utils/__init__.py | 2 +- .../cuda/bindings/utils/_ptx_utils.py | 2 +- .../cuda/bindings/utils/_version_check.py | 2 +- 90 files changed, 91 insertions(+), 1593 deletions(-) rename cuda_bindings/{ => src}/cuda/bindings/__init__.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/__init__.py (73%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/__init__.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cydriver.pxd.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cydriver.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cynvrtc.pxd.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cynvrtc.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cyruntime.pxd.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cyruntime.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cyruntime_ptds.pxd.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/cyruntime_ptds.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/loader.cpp (99%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/loader.h (88%) rename cuda_bindings/{ => src}/cuda/bindings/_bindings/loader.pxd (74%) rename cuda_bindings/{ => src}/cuda/bindings/_example_helpers/__init__.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_example_helpers/common.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_example_helpers/helper_cuda.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_example_helpers/helper_string.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/__init__.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/_fast_enum.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/cufile.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/cufile_linux.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvfatbin.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvfatbin_linux.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvfatbin_windows.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvjitlink.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvjitlink_linux.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvjitlink_windows.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvml.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvml_linux.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvml_windows.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvvm.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvvm_linux.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/nvvm_windows.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/utils.pxd (98%) rename cuda_bindings/{ => src}/cuda/bindings/_internal/utils.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/__init__.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/cyruntime/cyruntime.pxd (98%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/cyruntime/cyruntime.pxi (99%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/dlfcn.pxd (84%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/param_packer.h (98%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/param_packer.pxd (82%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/utils.pxd.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/utils.pxi.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/_lib/windll.pxd (95%) rename cuda_bindings/{ => src}/cuda/bindings/_test_helpers/__init__.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_test_helpers/arch_check.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/_test_helpers/pep723.py (100%) rename cuda_bindings/{ => src}/cuda/bindings/cufile.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cufile.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cycufile.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cycufile.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cydriver.pxd.in (99%) rename cuda_bindings/{cuda/bindings/cydriver.pyx.in => src/cuda/bindings/cydriver.pyx} (77%) rename cuda_bindings/{ => src}/cuda/bindings/cynvfatbin.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvfatbin.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvjitlink.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvjitlink.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvml.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvml.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvrtc.pxd.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/cynvrtc.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvvm.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/cynvvm.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/cyruntime.pxd.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/cyruntime.pyx.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/cyruntime_functions.pxi.in (99%) rename cuda_bindings/{cuda/bindings/cyruntime_types.pxi.in => src/cuda/bindings/cyruntime_types.pxi} (100%) rename cuda_bindings/{ => src}/cuda/bindings/driver.pxd.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/driver.pyx.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/nvfatbin.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvfatbin.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvjitlink.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvjitlink.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvml.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvml.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvrtc.pxd.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvrtc.pyx.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/nvvm.pxd (100%) rename cuda_bindings/{ => src}/cuda/bindings/nvvm.pyx (100%) rename cuda_bindings/{ => src}/cuda/bindings/runtime.pxd.in (100%) rename cuda_bindings/{ => src}/cuda/bindings/runtime.pyx.in (99%) rename cuda_bindings/{ => src}/cuda/bindings/utils/__init__.py (89%) rename cuda_bindings/{ => src}/cuda/bindings/utils/_ptx_utils.py (96%) rename cuda_bindings/{ => src}/cuda/bindings/utils/_version_check.py (95%) diff --git a/.gitignore b/.gitignore index 9bead862d8..6e3022484f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,45 +12,45 @@ __pycache__/ .benchmarks/ *.cpp !*_impl.cpp -!cuda_bindings/cuda/bindings/_lib/param_packer.cpp -!cuda_bindings/cuda/bindings/_bindings/loader.cpp +!cuda_bindings/src/cuda/bindings/_lib/param_packer.cpp +!cuda_bindings/src/cuda/bindings/_bindings/loader.cpp cache_driver cache_runtime cache_nvrtc -cuda_bindings/cuda/bindings/_lib/utils.pxi +cuda_bindings/src/cuda/bindings/_lib/utils.pxi # CUDA Python specific (auto-generated) -cuda_bindings/cuda/bindings/_bindings/cydriver.pxd -cuda_bindings/cuda/bindings/_bindings/cydriver.pyx -cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd -cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx -cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd -cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx -cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd -cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx -cuda_bindings/cuda/bindings/_internal/_nvml.pyx -cuda_bindings/cuda/bindings/_internal/cufile.pyx -cuda_bindings/cuda/bindings/_internal/nvfatbin.pyx -cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx -cuda_bindings/cuda/bindings/_internal/nvml.pyx -cuda_bindings/cuda/bindings/_internal/nvvm.pyx -cuda_bindings/cuda/bindings/_lib/utils.pxd -cuda_bindings/cuda/bindings/_lib/utils.pyx -cuda_bindings/cuda/bindings/cydriver.pxd -cuda_bindings/cuda/bindings/cydriver.pyx -cuda_bindings/cuda/bindings/cyruntime.pxd -cuda_bindings/cuda/bindings/cyruntime.pyx -cuda_bindings/cuda/bindings/cyruntime_functions.pxi -cuda_bindings/cuda/bindings/cyruntime_types.pxi -cuda_bindings/cuda/bindings/cynvrtc.pxd -cuda_bindings/cuda/bindings/cynvrtc.pyx -cuda_bindings/cuda/bindings/driver.pxd -cuda_bindings/cuda/bindings/driver.pyx -cuda_bindings/cuda/bindings/runtime.pxd -cuda_bindings/cuda/bindings/runtime.pyx -cuda_bindings/cuda/bindings/nvrtc.pxd -cuda_bindings/cuda/bindings/nvrtc.pyx -cuda_bindings/cuda/bindings/utils/_get_handle.pyx +cuda_bindings/src/cuda/bindings/_bindings/cydriver.pxd +cuda_bindings/src/cuda/bindings/_bindings/cydriver.pyx +cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pxd +cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pyx +cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pxd +cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pyx +cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pxd +cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pyx +cuda_bindings/src/cuda/bindings/_internal/_nvml.pyx +cuda_bindings/src/cuda/bindings/_internal/cufile.pyx +cuda_bindings/src/cuda/bindings/_internal/nvfatbin.pyx +cuda_bindings/src/cuda/bindings/_internal/nvjitlink.pyx +cuda_bindings/src/cuda/bindings/_internal/nvml.pyx +cuda_bindings/src/cuda/bindings/_internal/nvvm.pyx +cuda_bindings/src/cuda/bindings/_lib/utils.pxd +cuda_bindings/src/cuda/bindings/_lib/utils.pyx +cuda_bindings/src/cuda/bindings/cydriver.pxd +cuda_bindings/src/cuda/bindings/cydriver.pyx +cuda_bindings/src/cuda/bindings/cyruntime.pxd +cuda_bindings/src/cuda/bindings/cyruntime.pyx +cuda_bindings/src/cuda/bindings/cyruntime_functions.pxi +cuda_bindings/src/cuda/bindings/cyruntime_types.pxi +cuda_bindings/src/cuda/bindings/cynvrtc.pxd +cuda_bindings/src/cuda/bindings/cynvrtc.pyx +cuda_bindings/src/cuda/bindings/driver.pxd +cuda_bindings/src/cuda/bindings/driver.pyx +cuda_bindings/src/cuda/bindings/runtime.pxd +cuda_bindings/src/cuda/bindings/runtime.pyx +cuda_bindings/src/cuda/bindings/nvrtc.pxd +cuda_bindings/src/cuda/bindings/nvrtc.pyx +cuda_bindings/src/cuda/bindings/utils/_get_handle.pyx # Version files from setuptools_scm _version.py diff --git a/cuda_bindings/MANIFEST.in b/cuda_bindings/MANIFEST.in index 39073c42fd..cf965dfd0a 100644 --- a/cuda_bindings/MANIFEST.in +++ b/cuda_bindings/MANIFEST.in @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -recursive-include cuda/ *.pyx *.pxd *.pxi *.pyx.in *.pxd.in *.pxi.in *.h +recursive-include src/cuda/ *.pyx *.pxd *.pxi *.pyx.in *.pxd.in *.pxi.in *.h # 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 +exclude src/cuda/bindings src?cuda?bindings +exclude src/cuda/bindings/_bindings src?cuda?bindings?_bindings diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index b08b0d24d8..d055a5d795 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -33,40 +33,10 @@ _extensions = None -# Please keep in sync with the copy in cuda_core/build_hooks.py. -def _import_get_cuda_path_or_home(): - """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. - - See https://github.com/NVIDIA/cuda-python/issues/1824 for why this helper is needed. - """ - try: - import cuda.pathfinder - except ModuleNotFoundError as exc: - if exc.name not in ("cuda", "cuda.pathfinder"): - raise - try: - import cuda - except ModuleNotFoundError: - cuda = None - - for p in sys.path: - sp_cuda = os.path.join(p, "cuda") - if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): - cuda.__path__ = list(cuda.__path__) + [sp_cuda] - break - else: - raise ModuleNotFoundError( - "cuda-pathfinder is not installed in the build environment. " - "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." - ) - import cuda.pathfinder - - return cuda.pathfinder.get_cuda_path_or_home - - @functools.cache def _get_cuda_path() -> str: - get_cuda_path_or_home = _import_get_cuda_path_or_home() + from cuda.pathfinder import get_cuda_path_or_home + cuda_path = get_cuda_path_or_home() if not cuda_path: raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") @@ -266,7 +236,7 @@ def _generate_output(infile, template_vars): def _rename_architecture_specific_files(): - path = os.path.join("cuda", "bindings", "_internal") + path = os.path.join("src", "cuda", "bindings", "_internal") if sys.platform == "linux": src_files = glob.glob(os.path.join(path, "*_linux.pyx")) elif sys.platform == "win32": @@ -290,7 +260,10 @@ def _prep_extensions(sources, libraries, include_dirs, library_dirs, extra_compi libraries = libraries if libraries else [] exts = [] for pyx in files: - mod_name = pyx.replace(".pyx", "").replace(os.sep, ".").replace("/", ".") + mod_path = pyx.replace(".pyx", "").replace(os.sep, "/") + if mod_path.startswith("src/"): + mod_path = mod_path[len("src/") :] + mod_name = mod_path.replace("/", ".") exts.append( Extension( mod_name, @@ -346,12 +319,12 @@ def _build_cuda_bindings(strip=False): # 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"), + os.path.join("src", "cuda"), + os.path.join("src", "cuda", "bindings"), + os.path.join("src", "cuda", "bindings", "_bindings"), + os.path.join("src", "cuda", "bindings", "_internal"), + os.path.join("src", "cuda", "bindings", "_lib"), + os.path.join("src", "cuda", "bindings", "utils"), ] input_files = [] for path in path_list: @@ -375,6 +348,7 @@ def _build_cuda_bindings(strip=False): # Prepare compile/link arguments include_dirs = [ os.path.dirname(sysconfig.get_path("include")), + "src", ] + 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"] @@ -415,21 +389,21 @@ def _cleanup_dst_files(): # 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") + cuda_bindings_files = glob.glob("src/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/cydriver.pyx", "cuda/bindings/_bindings/loader.cpp"], None), - (["cuda/bindings/_bindings/cynvrtc.pyx"], None), - (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), - (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), + (["src/cuda/bindings/_bindings/cydriver.pyx", "src/cuda/bindings/_bindings/loader.cpp"], None), + (["src/cuda/bindings/_bindings/cynvrtc.pyx"], None), + (["src/cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), + (["src/cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils - (["cuda/bindings/utils/*.pyx"], None), + (["src/cuda/bindings/utils/*.pyx"], None), # public *(([f], None) for f in cuda_bindings_files), # internal files used by generated bindings - (["cuda/bindings/_internal/utils.pyx"], None), + (["src/cuda/bindings/_internal/utils.pyx"], None), *(([f], None) for f in dst_files if f.endswith(".pyx")), ] @@ -446,6 +420,7 @@ def _cleanup_dst_files(): _extensions = cythonize( extensions, nthreads=nthreads, + include_path=["src"], build_dir="." if compile_for_coverage else "build/cython", compiler_directives=cython_directives, **extra_cythonize_kwargs, diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 3aa9c62556..4eff7bab1f 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -58,6 +58,7 @@ Repository = "https://github.com/NVIDIA/cuda-python" Documentation = "https://nvidia.github.io/cuda-python/" [tool.setuptools.packages.find] +where = ["src"] include = ["cuda*"] [tool.setuptools] @@ -92,7 +93,7 @@ xfail_strict = true [tool.setuptools_scm] root = ".." -version_file = "cuda/bindings/_version.py" +version_file = "src/cuda/bindings/_version.py" # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. tag_regex = "^(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)" git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"] diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 2f6069c738..76d037ee58 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -59,6 +59,7 @@ def finalize_options(self): setup( ext_modules=build_hooks._extensions, + package_dir={"": "src"}, cmdclass={ "build_ext": build_ext, "build_py": build_py, diff --git a/cuda_bindings/cuda/bindings/__init__.pxd b/cuda_bindings/src/cuda/bindings/__init__.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/__init__.pxd rename to cuda_bindings/src/cuda/bindings/__init__.pxd diff --git a/cuda_bindings/cuda/bindings/__init__.py b/cuda_bindings/src/cuda/bindings/__init__.py similarity index 73% rename from cuda_bindings/cuda/bindings/__init__.py rename to cuda_bindings/src/cuda/bindings/__init__.py index 38d71fcfde..103ebbb2de 100644 --- a/cuda_bindings/cuda/bindings/__init__.py +++ b/cuda_bindings/src/cuda/bindings/__init__.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE from cuda.bindings import utils diff --git a/cuda_bindings/cuda/bindings/_bindings/__init__.py b/cuda_bindings/src/cuda/bindings/_bindings/__init__.py similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/__init__.py rename to cuda_bindings/src/cuda/bindings/_bindings/__init__.py diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in b/cuda_bindings/src/cuda/bindings/_bindings/cydriver.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in rename to cuda_bindings/src/cuda/bindings/_bindings/cydriver.pxd.in index 0b19de67d0..aaacdaa95a 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in +++ b/cuda_bindings/src/cuda/bindings/_bindings/cydriver.pxd.in @@ -2458,4 +2458,3 @@ cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaReso cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} - diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/src/cuda/bindings/_bindings/cydriver.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in rename to cuda_bindings/src/cuda/bindings/_bindings/cydriver.pyx.in diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in b/cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in rename to cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pxd.in index 5a53b926d1..1eca8180fe 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in +++ b/cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pxd.in @@ -133,4 +133,3 @@ cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) e cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil {{endif}} - diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in rename to cuda_bindings/src/cuda/bindings/_bindings/cynvrtc.pyx.in diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pxd.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in rename to cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pxd.in diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in rename to cuda_bindings/src/cuda/bindings/_bindings/cyruntime.pyx.in diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in b/cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pxd.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in rename to cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pxd.in diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in b/cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in rename to cuda_bindings/src/cuda/bindings/_bindings/cyruntime_ptds.pyx.in diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.cpp b/cuda_bindings/src/cuda/bindings/_bindings/loader.cpp similarity index 99% rename from cuda_bindings/cuda/bindings/_bindings/loader.cpp rename to cuda_bindings/src/cuda/bindings/_bindings/loader.cpp index a692eddc93..fa009af6be 100644 --- a/cuda_bindings/cuda/bindings/_bindings/loader.cpp +++ b/cuda_bindings/src/cuda/bindings/_bindings/loader.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE #include diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.h b/cuda_bindings/src/cuda/bindings/_bindings/loader.h similarity index 88% rename from cuda_bindings/cuda/bindings/_bindings/loader.h rename to cuda_bindings/src/cuda/bindings/_bindings/loader.h index 2411037b03..dd6d3d0334 100644 --- a/cuda_bindings/cuda/bindings/_bindings/loader.h +++ b/cuda_bindings/src/cuda/bindings/_bindings/loader.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE // // Please refer to the NVIDIA end user license agreement (EULA) associated diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.pxd b/cuda_bindings/src/cuda/bindings/_bindings/loader.pxd similarity index 74% rename from cuda_bindings/cuda/bindings/_bindings/loader.pxd rename to cuda_bindings/src/cuda/bindings/_bindings/loader.pxd index 805b849cc6..3e0d58f367 100644 --- a/cuda_bindings/cuda/bindings/_bindings/loader.pxd +++ b/cuda_bindings/src/cuda/bindings/_bindings/loader.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE cdef extern from "loader.h": diff --git a/cuda_bindings/cuda/bindings/_example_helpers/__init__.py b/cuda_bindings/src/cuda/bindings/_example_helpers/__init__.py similarity index 100% rename from cuda_bindings/cuda/bindings/_example_helpers/__init__.py rename to cuda_bindings/src/cuda/bindings/_example_helpers/__init__.py diff --git a/cuda_bindings/cuda/bindings/_example_helpers/common.py b/cuda_bindings/src/cuda/bindings/_example_helpers/common.py similarity index 100% rename from cuda_bindings/cuda/bindings/_example_helpers/common.py rename to cuda_bindings/src/cuda/bindings/_example_helpers/common.py diff --git a/cuda_bindings/cuda/bindings/_example_helpers/helper_cuda.py b/cuda_bindings/src/cuda/bindings/_example_helpers/helper_cuda.py similarity index 100% rename from cuda_bindings/cuda/bindings/_example_helpers/helper_cuda.py rename to cuda_bindings/src/cuda/bindings/_example_helpers/helper_cuda.py diff --git a/cuda_bindings/cuda/bindings/_example_helpers/helper_string.py b/cuda_bindings/src/cuda/bindings/_example_helpers/helper_string.py similarity index 100% rename from cuda_bindings/cuda/bindings/_example_helpers/helper_string.py rename to cuda_bindings/src/cuda/bindings/_example_helpers/helper_string.py diff --git a/cuda_bindings/cuda/bindings/_internal/__init__.py b/cuda_bindings/src/cuda/bindings/_internal/__init__.py similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/__init__.py rename to cuda_bindings/src/cuda/bindings/_internal/__init__.py diff --git a/cuda_bindings/cuda/bindings/_internal/_fast_enum.py b/cuda_bindings/src/cuda/bindings/_internal/_fast_enum.py similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/_fast_enum.py rename to cuda_bindings/src/cuda/bindings/_internal/_fast_enum.py diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/src/cuda/bindings/_internal/cufile.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/cufile.pxd rename to cuda_bindings/src/cuda/bindings/_internal/cufile.pxd diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/src/cuda/bindings/_internal/cufile_linux.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx rename to cuda_bindings/src/cuda/bindings/_internal/cufile_linux.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings/src/cuda/bindings/_internal/nvfatbin.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd rename to cuda_bindings/src/cuda/bindings/_internal/nvfatbin.pxd diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvfatbin_linux.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvfatbin_linux.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvfatbin_windows.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvfatbin_windows.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/src/cuda/bindings/_internal/nvjitlink.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd rename to cuda_bindings/src/cuda/bindings/_internal/nvjitlink.pxd diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvjitlink_linux.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvjitlink_linux.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvjitlink_windows.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvjitlink_windows.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvml.pxd b/cuda_bindings/src/cuda/bindings/_internal/nvml.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvml.pxd rename to cuda_bindings/src/cuda/bindings/_internal/nvml.pxd diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvml_linux.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvml_linux.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvml_windows.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvml_windows.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/src/cuda/bindings/_internal/nvvm.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvvm.pxd rename to cuda_bindings/src/cuda/bindings/_internal/nvvm.pxd diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvvm_linux.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvvm_linux.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/src/cuda/bindings/_internal/nvvm_windows.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx rename to cuda_bindings/src/cuda/bindings/_internal/nvvm_windows.pyx diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pxd b/cuda_bindings/src/cuda/bindings/_internal/utils.pxd similarity index 98% rename from cuda_bindings/cuda/bindings/_internal/utils.pxd rename to cuda_bindings/src/cuda/bindings/_internal/utils.pxd index 50484727b7..46a785b33a 100644 --- a/cuda_bindings/cuda/bindings/_internal/utils.pxd +++ b/cuda_bindings/src/cuda/bindings/_internal/utils.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pyx b/cuda_bindings/src/cuda/bindings/_internal/utils.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/_internal/utils.pyx rename to cuda_bindings/src/cuda/bindings/_internal/utils.pyx diff --git a/cuda_bindings/cuda/bindings/_lib/__init__.py b/cuda_bindings/src/cuda/bindings/_lib/__init__.py similarity index 100% rename from cuda_bindings/cuda/bindings/_lib/__init__.py rename to cuda_bindings/src/cuda/bindings/_lib/__init__.py diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxd similarity index 98% rename from cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd rename to cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxd index 48f87f29ca..8818189a6f 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd +++ b/cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE cimport cuda.bindings.cyruntime as cyruntime diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi b/cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxi similarity index 99% rename from cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi rename to cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxi index c18bd1ca2e..05cc23db6f 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi +++ b/cuda_bindings/src/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # These graphics API are the reimplemented version of what's supported by CUDA Runtime. diff --git a/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd b/cuda_bindings/src/cuda/bindings/_lib/dlfcn.pxd similarity index 84% rename from cuda_bindings/cuda/bindings/_lib/dlfcn.pxd rename to cuda_bindings/src/cuda/bindings/_lib/dlfcn.pxd index 2ae9581439..11b16b0a00 100644 --- a/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd +++ b/cuda_bindings/src/cuda/bindings/_lib/dlfcn.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE cdef extern from "" nogil: diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.h b/cuda_bindings/src/cuda/bindings/_lib/param_packer.h similarity index 98% rename from cuda_bindings/cuda/bindings/_lib/param_packer.h rename to cuda_bindings/src/cuda/bindings/_lib/param_packer.h index 96c56b4fe4..d6f413d587 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.h +++ b/cuda_bindings/src/cuda/bindings/_lib/param_packer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE // Please refer to the NVIDIA end user license agreement (EULA) associated diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings/src/cuda/bindings/_lib/param_packer.pxd similarity index 82% rename from cuda_bindings/cuda/bindings/_lib/param_packer.pxd rename to cuda_bindings/src/cuda/bindings/_lib/param_packer.pxd index ad7fd95668..2e70b454d8 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd +++ b/cuda_bindings/src/cuda/bindings/_lib/param_packer.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # Include "param_packer.h" so its contents get compiled into every diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in b/cuda_bindings/src/cuda/bindings/_lib/utils.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/_lib/utils.pxd.in rename to cuda_bindings/src/cuda/bindings/_lib/utils.pxd.in index 353a07a09c..69bc885504 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in +++ b/cuda_bindings/src/cuda/bindings/_lib/utils.pxd.in @@ -19,7 +19,7 @@ cdef struct _HelperInputVoidPtrStruct: Py_buffer _pybuffer cdef class _HelperInputVoidPtr: - cdef _HelperInputVoidPtrStruct _helper + cdef _HelperInputVoidPtrStruct _helper cdef void* _cptr cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *buffer) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in b/cuda_bindings/src/cuda/bindings/_lib/utils.pxi.in similarity index 99% rename from cuda_bindings/cuda/bindings/_lib/utils.pxi.in rename to cuda_bindings/src/cuda/bindings/_lib/utils.pxi.in index c88ec49721..1d63ca307b 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in +++ b/cuda_bindings/src/cuda/bindings/_lib/utils.pxi.in @@ -135,13 +135,13 @@ cdef class _HelperInputVoidPtr: @property def cptr(self): - return self._cptr + return self._cptr cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *helper): helper[0]._pybuffer.buf = NULL try: - return ptr + return ptr except: if ptr is None: return NULL @@ -633,7 +633,7 @@ cdef class _HelperCUcoredumpSettings: {{if 'CU_COREDUMP_ENABLE_USER_TRIGGER' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,{{endif}}): if self._is_getter == False: self._bool = init_value - + self._cptr = &self._bool self._size = 1 else: diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/src/cuda/bindings/_lib/windll.pxd similarity index 95% rename from cuda_bindings/cuda/bindings/_lib/windll.pxd rename to cuda_bindings/src/cuda/bindings/_lib/windll.pxd index 7b190f3595..2e226e3103 100644 --- a/cuda_bindings/cuda/bindings/_lib/windll.pxd +++ b/cuda_bindings/src/cuda/bindings/_lib/windll.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE from libc.stddef cimport wchar_t diff --git a/cuda_bindings/cuda/bindings/_test_helpers/__init__.py b/cuda_bindings/src/cuda/bindings/_test_helpers/__init__.py similarity index 100% rename from cuda_bindings/cuda/bindings/_test_helpers/__init__.py rename to cuda_bindings/src/cuda/bindings/_test_helpers/__init__.py diff --git a/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py b/cuda_bindings/src/cuda/bindings/_test_helpers/arch_check.py similarity index 100% rename from cuda_bindings/cuda/bindings/_test_helpers/arch_check.py rename to cuda_bindings/src/cuda/bindings/_test_helpers/arch_check.py diff --git a/cuda_bindings/cuda/bindings/_test_helpers/pep723.py b/cuda_bindings/src/cuda/bindings/_test_helpers/pep723.py similarity index 100% rename from cuda_bindings/cuda/bindings/_test_helpers/pep723.py rename to cuda_bindings/src/cuda/bindings/_test_helpers/pep723.py diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/src/cuda/bindings/cufile.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cufile.pxd rename to cuda_bindings/src/cuda/bindings/cufile.pxd diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/src/cuda/bindings/cufile.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cufile.pyx rename to cuda_bindings/src/cuda/bindings/cufile.pyx diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/src/cuda/bindings/cycufile.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cycufile.pxd rename to cuda_bindings/src/cuda/bindings/cycufile.pxd diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/src/cuda/bindings/cycufile.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cycufile.pyx rename to cuda_bindings/src/cuda/bindings/cycufile.pyx diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd.in b/cuda_bindings/src/cuda/bindings/cydriver.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/cydriver.pxd.in rename to cuda_bindings/src/cuda/bindings/cydriver.pxd.in index 6ed16b51ba..c811fcbe51 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd.in +++ b/cuda_bindings/src/cuda/bindings/cydriver.pxd.in @@ -5409,4 +5409,4 @@ cdef enum: CU_DEVICE_INVALID = -2 cdef enum: MAX_PLANES = 3 -cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 \ No newline at end of file +cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 diff --git a/cuda_bindings/cuda/bindings/cydriver.pyx.in b/cuda_bindings/src/cuda/bindings/cydriver.pyx similarity index 77% rename from cuda_bindings/cuda/bindings/cydriver.pyx.in rename to cuda_bindings/src/cuda/bindings/cydriver.pyx index 527fd10d05..e8b6aafe2b 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pyx.in +++ b/cuda_bindings/src/cuda/bindings/cydriver.pyx @@ -4,2948 +4,1475 @@ # This code was automatically generated with version 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. cimport cuda.bindings._bindings.cydriver as cydriver -{{if 'cuGetErrorString' in found_functions}} - cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGetErrorString(error, pStr) -{{endif}} - -{{if 'cuGetErrorName' in found_functions}} cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGetErrorName(error, pStr) -{{endif}} - -{{if 'cuInit' in found_functions}} cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuInit(Flags) -{{endif}} - -{{if 'cuDriverGetVersion' in found_functions}} cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDriverGetVersion(driverVersion) -{{endif}} - -{{if 'cuDeviceGet' in found_functions}} cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGet(device, ordinal) -{{endif}} - -{{if 'cuDeviceGetCount' in found_functions}} cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetCount(count) -{{endif}} - -{{if 'cuDeviceGetName' in found_functions}} cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetName(name, length, dev) -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetUuid_v2(uuid, dev) -{{endif}} - -{{if 'cuDeviceGetLuid' in found_functions}} cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetLuid(luid, deviceNodeMask, dev) -{{endif}} - -{{if 'cuDeviceTotalMem_v2' in found_functions}} cdef CUresult cuDeviceTotalMem(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceTotalMem_v2(numbytes, dev) -{{endif}} - -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, pformat, numChannels, dev) -{{endif}} - -{{if 'cuDeviceGetAttribute' in found_functions}} cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetAttribute(pi, attrib, dev) -{{endif}} - -{{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} cdef CUresult cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetHostAtomicCapabilities(capabilities, operations, count, dev) -{{endif}} - -{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, flags) -{{endif}} - -{{if 'cuDeviceSetMemPool' in found_functions}} cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceSetMemPool(dev, pool) -{{endif}} - -{{if 'cuDeviceGetMemPool' in found_functions}} cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetMemPool(pool, dev) -{{endif}} - -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetDefaultMemPool(pool_out, dev) -{{endif}} - -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetExecAffinitySupport(pi, typename, dev) -{{endif}} - -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFlushGPUDirectRDMAWrites(target, scope) -{{endif}} - -{{if 'cuDeviceGetProperties' in found_functions}} cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetProperties(prop, dev) -{{endif}} - -{{if 'cuDeviceComputeCapability' in found_functions}} cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceComputeCapability(major, minor, dev) -{{endif}} - -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevicePrimaryCtxRetain(pctx, dev) -{{endif}} - -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevicePrimaryCtxRelease_v2(dev) -{{endif}} - -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevicePrimaryCtxSetFlags_v2(dev, flags) -{{endif}} - -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevicePrimaryCtxGetState(dev, flags, active) -{{endif}} - -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevicePrimaryCtxReset_v2(dev) -{{endif}} - -{{if 'cuCtxCreate_v4' in found_functions}} cdef CUresult cuCtxCreate(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxCreate_v4(pctx, ctxCreateParams, flags, dev) -{{endif}} - -{{if 'cuCtxDestroy_v2' in found_functions}} cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxDestroy_v2(ctx) -{{endif}} - -{{if 'cuCtxPushCurrent_v2' in found_functions}} cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxPushCurrent_v2(ctx) -{{endif}} - -{{if 'cuCtxPopCurrent_v2' in found_functions}} cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxPopCurrent_v2(pctx) -{{endif}} - -{{if 'cuCtxSetCurrent' in found_functions}} cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSetCurrent(ctx) -{{endif}} - -{{if 'cuCtxGetCurrent' in found_functions}} cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetCurrent(pctx) -{{endif}} - -{{if 'cuCtxGetDevice' in found_functions}} cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetDevice(device) -{{endif}} - -{{if 'cuCtxGetDevice_v2' in found_functions}} cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetDevice_v2(device, ctx) -{{endif}} - -{{if 'cuCtxGetFlags' in found_functions}} cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetFlags(flags) -{{endif}} - -{{if 'cuCtxSetFlags' in found_functions}} cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSetFlags(flags) -{{endif}} - -{{if 'cuCtxGetId' in found_functions}} cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetId(ctx, ctxId) -{{endif}} - -{{if 'cuCtxSynchronize' in found_functions}} cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSynchronize() -{{endif}} - -{{if 'cuCtxSynchronize_v2' in found_functions}} cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSynchronize_v2(ctx) -{{endif}} - -{{if 'cuCtxSetLimit' in found_functions}} cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSetLimit(limit, value) -{{endif}} - -{{if 'cuCtxGetLimit' in found_functions}} cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetLimit(pvalue, limit) -{{endif}} - -{{if 'cuCtxGetCacheConfig' in found_functions}} cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetCacheConfig(pconfig) -{{endif}} - -{{if 'cuCtxSetCacheConfig' in found_functions}} cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSetCacheConfig(config) -{{endif}} - -{{if 'cuCtxGetApiVersion' in found_functions}} cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetApiVersion(ctx, version) -{{endif}} - -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority) -{{endif}} - -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxResetPersistingL2Cache() -{{endif}} - -{{if 'cuCtxGetExecAffinity' in found_functions}} cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetExecAffinity(pExecAffinity, typename) -{{endif}} - -{{if 'cuCtxRecordEvent' in found_functions}} cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxRecordEvent(hCtx, hEvent) -{{endif}} - -{{if 'cuCtxWaitEvent' in found_functions}} cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxWaitEvent(hCtx, hEvent) -{{endif}} - -{{if 'cuCtxAttach' in found_functions}} cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxAttach(pctx, flags) -{{endif}} - -{{if 'cuCtxDetach' in found_functions}} cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxDetach(ctx) -{{endif}} - -{{if 'cuCtxGetSharedMemConfig' in found_functions}} cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetSharedMemConfig(pConfig) -{{endif}} - -{{if 'cuCtxSetSharedMemConfig' in found_functions}} cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxSetSharedMemConfig(config) -{{endif}} - -{{if 'cuModuleLoad' in found_functions}} cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleLoad(module, fname) -{{endif}} - -{{if 'cuModuleLoadData' in found_functions}} cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleLoadData(module, image) -{{endif}} - -{{if 'cuModuleLoadDataEx' in found_functions}} cdef CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleLoadDataEx(module, image, numOptions, options, optionValues) -{{endif}} - -{{if 'cuModuleLoadFatBinary' in found_functions}} cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleLoadFatBinary(module, fatCubin) -{{endif}} - -{{if 'cuModuleUnload' in found_functions}} cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleUnload(hmod) -{{endif}} - -{{if 'cuModuleGetLoadingMode' in found_functions}} cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetLoadingMode(mode) -{{endif}} - -{{if 'cuModuleGetFunction' in found_functions}} cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetFunction(hfunc, hmod, name) -{{endif}} - -{{if 'cuModuleGetFunctionCount' in found_functions}} cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetFunctionCount(count, mod) -{{endif}} - -{{if 'cuModuleEnumerateFunctions' in found_functions}} cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleEnumerateFunctions(functions, numFunctions, mod) -{{endif}} - -{{if 'cuModuleGetGlobal_v2' in found_functions}} cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetGlobal_v2(dptr, numbytes, hmod, name) -{{endif}} - -{{if 'cuLinkCreate_v2' in found_functions}} cdef CUresult cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLinkCreate_v2(numOptions, options, optionValues, stateOut) -{{endif}} - -{{if 'cuLinkAddData_v2' in found_functions}} cdef CUresult cuLinkAddData(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLinkAddData_v2(state, typename, data, size, name, numOptions, options, optionValues) -{{endif}} - -{{if 'cuLinkAddFile_v2' in found_functions}} cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLinkAddFile_v2(state, typename, path, numOptions, options, optionValues) -{{endif}} - -{{if 'cuLinkComplete' in found_functions}} cdef CUresult cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLinkComplete(state, cubinOut, sizeOut) -{{endif}} - -{{if 'cuLinkDestroy' in found_functions}} cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLinkDestroy(state) -{{endif}} - -{{if 'cuModuleGetTexRef' in found_functions}} cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetTexRef(pTexRef, hmod, name) -{{endif}} - -{{if 'cuModuleGetSurfRef' in found_functions}} cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuModuleGetSurfRef(pSurfRef, hmod, name) -{{endif}} - -{{if 'cuLibraryLoadData' in found_functions}} 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: return cydriver._cuLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{endif}} - -{{if 'cuLibraryLoadFromFile' in found_functions}} 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: return cydriver._cuLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{endif}} - -{{if 'cuLibraryUnload' in found_functions}} cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryUnload(library) -{{endif}} - -{{if 'cuLibraryGetKernel' in found_functions}} cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetKernel(pKernel, library, name) -{{endif}} - -{{if 'cuLibraryGetKernelCount' in found_functions}} cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetKernelCount(count, lib) -{{endif}} - -{{if 'cuLibraryEnumerateKernels' in found_functions}} cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryEnumerateKernels(kernels, numKernels, lib) -{{endif}} - -{{if 'cuLibraryGetModule' in found_functions}} cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetModule(pMod, library) -{{endif}} - -{{if 'cuKernelGetFunction' in found_functions}} cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetFunction(pFunc, kernel) -{{endif}} - -{{if 'cuKernelGetLibrary' in found_functions}} cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetLibrary(pLib, kernel) -{{endif}} - -{{if 'cuLibraryGetGlobal' in found_functions}} cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetGlobal(dptr, numbytes, library, name) -{{endif}} - -{{if 'cuLibraryGetManaged' in found_functions}} cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetManaged(dptr, numbytes, library, name) -{{endif}} - -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLibraryGetUnifiedFunction(fptr, library, symbol) -{{endif}} - -{{if 'cuKernelGetAttribute' in found_functions}} cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetAttribute(pi, attrib, kernel, dev) -{{endif}} - -{{if 'cuKernelSetAttribute' in found_functions}} cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelSetAttribute(attrib, val, kernel, dev) -{{endif}} - -{{if 'cuKernelSetCacheConfig' in found_functions}} cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelSetCacheConfig(kernel, config, dev) -{{endif}} - -{{if 'cuKernelGetName' in found_functions}} cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetName(name, hfunc) -{{endif}} - -{{if 'cuKernelGetParamInfo' in found_functions}} cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetParamInfo(kernel, paramIndex, paramOffset, paramSize) -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuKernelGetParamCount(kernel, paramCount) -{{endif}} - -{{if 'cuMemGetInfo_v2' in found_functions}} cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetInfo_v2(free, total) -{{endif}} - -{{if 'cuMemAlloc_v2' in found_functions}} cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAlloc_v2(dptr, bytesize) -{{endif}} - -{{if 'cuMemAllocPitch_v2' in found_functions}} cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAllocPitch_v2(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) -{{endif}} - -{{if 'cuMemFree_v2' in found_functions}} cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemFree_v2(dptr) -{{endif}} - -{{if 'cuMemGetAddressRange_v2' in found_functions}} cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetAddressRange_v2(pbase, psize, dptr) -{{endif}} - -{{if 'cuMemAllocHost_v2' in found_functions}} cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAllocHost_v2(pp, bytesize) -{{endif}} - -{{if 'cuMemFreeHost' in found_functions}} cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemFreeHost(p) -{{endif}} - -{{if 'cuMemHostAlloc' in found_functions}} cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemHostAlloc(pp, bytesize, Flags) -{{endif}} - -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemHostGetDevicePointer_v2(pdptr, p, Flags) -{{endif}} - -{{if 'cuMemHostGetFlags' in found_functions}} cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemHostGetFlags(pFlags, p) -{{endif}} - -{{if 'cuMemAllocManaged' in found_functions}} cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAllocManaged(dptr, bytesize, flags) -{{endif}} - -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) -{{endif}} - -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceUnregisterAsyncNotification(device, callback) -{{endif}} - -{{if 'cuDeviceGetByPCIBusId' in found_functions}} cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetByPCIBusId(dev, pciBusId) -{{endif}} - -{{if 'cuDeviceGetPCIBusId' in found_functions}} cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetPCIBusId(pciBusId, length, dev) -{{endif}} - -{{if 'cuIpcGetEventHandle' in found_functions}} cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuIpcGetEventHandle(pHandle, event) -{{endif}} - -{{if 'cuIpcOpenEventHandle' in found_functions}} cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuIpcOpenEventHandle(phEvent, handle) -{{endif}} - -{{if 'cuIpcGetMemHandle' in found_functions}} cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuIpcGetMemHandle(pHandle, dptr) -{{endif}} - -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuIpcOpenMemHandle_v2(pdptr, handle, Flags) -{{endif}} - -{{if 'cuIpcCloseMemHandle' in found_functions}} cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuIpcCloseMemHandle(dptr) -{{endif}} - -{{if 'cuMemHostRegister_v2' in found_functions}} cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemHostRegister_v2(p, bytesize, Flags) -{{endif}} - -{{if 'cuMemHostUnregister' in found_functions}} cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemHostUnregister(p) -{{endif}} - -{{if 'cuMemcpy' in found_functions}} cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy(dst, src, ByteCount) -{{endif}} - -{{if 'cuMemcpyPeer' in found_functions}} cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, ByteCount) -{{endif}} - -{{if 'cuMemcpyHtoD_v2' in found_functions}} cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyHtoD_v2(dstDevice, srcHost, ByteCount) -{{endif}} - -{{if 'cuMemcpyDtoH_v2' in found_functions}} cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyDtoH_v2(dstHost, srcDevice, ByteCount) -{{endif}} - -{{if 'cuMemcpyDtoD_v2' in found_functions}} cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyDtoD_v2(dstDevice, srcDevice, ByteCount) -{{endif}} - -{{if 'cuMemcpyDtoA_v2' in found_functions}} cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyDtoA_v2(dstArray, dstOffset, srcDevice, ByteCount) -{{endif}} - -{{if 'cuMemcpyAtoD_v2' in found_functions}} cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyAtoD_v2(dstDevice, srcArray, srcOffset, ByteCount) -{{endif}} - -{{if 'cuMemcpyHtoA_v2' in found_functions}} cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyHtoA_v2(dstArray, dstOffset, srcHost, ByteCount) -{{endif}} - -{{if 'cuMemcpyAtoH_v2' in found_functions}} cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyAtoH_v2(dstHost, srcArray, srcOffset, ByteCount) -{{endif}} - -{{if 'cuMemcpyAtoA_v2' in found_functions}} cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyAtoA_v2(dstArray, dstOffset, srcArray, srcOffset, ByteCount) -{{endif}} - -{{if 'cuMemcpy2D_v2' in found_functions}} cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy2D_v2(pCopy) -{{endif}} - -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy2DUnaligned_v2(pCopy) -{{endif}} - -{{if 'cuMemcpy3D_v2' in found_functions}} cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3D_v2(pCopy) -{{endif}} - -{{if 'cuMemcpy3DPeer' in found_functions}} cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3DPeer(pCopy) -{{endif}} - -{{if 'cuMemcpyAsync' in found_functions}} cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyAsync(dst, src, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyPeerAsync' in found_functions}} cdef CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyHtoDAsync_v2(dstDevice, srcHost, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyDtoHAsync_v2(dstHost, srcDevice, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyDtoDAsync_v2(dstDevice, srcDevice, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyHtoAAsync_v2(dstArray, dstOffset, srcHost, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyAtoHAsync_v2(dstHost, srcArray, srcOffset, ByteCount, hStream) -{{endif}} - -{{if 'cuMemcpy2DAsync_v2' in found_functions}} cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy2DAsync_v2(pCopy, hStream) -{{endif}} - -{{if 'cuMemcpy3DAsync_v2' in found_functions}} cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3DAsync_v2(pCopy, hStream) -{{endif}} - -{{if 'cuMemcpy3DPeerAsync' in found_functions}} cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3DPeerAsync(pCopy, hStream) -{{endif}} - -{{if 'cuMemcpyBatchAsync_v2' in found_functions}} cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyBatchAsync_v2(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) -{{endif}} - -{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3DBatchAsync_v2(numOps, opList, flags, hStream) -{{endif}} - -{{if 'cuMemcpyWithAttributesAsync' in found_functions}} cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpyWithAttributesAsync(dst, src, size, attr, hStream) -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemcpy3DWithAttributesAsync(op, flags, hStream) -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD8_v2(dstDevice, uc, N) -{{endif}} - -{{if 'cuMemsetD16_v2' in found_functions}} cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD16_v2(dstDevice, us, N) -{{endif}} - -{{if 'cuMemsetD32_v2' in found_functions}} cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD32_v2(dstDevice, ui, N) -{{endif}} - -{{if 'cuMemsetD2D8_v2' in found_functions}} cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD2D8_v2(dstDevice, dstPitch, uc, Width, Height) -{{endif}} - -{{if 'cuMemsetD2D16_v2' in found_functions}} cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD2D16_v2(dstDevice, dstPitch, us, Width, Height) -{{endif}} - -{{if 'cuMemsetD2D32_v2' in found_functions}} cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD2D32_v2(dstDevice, dstPitch, ui, Width, Height) -{{endif}} - -{{if 'cuMemsetD8Async' in found_functions}} cdef CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD8Async(dstDevice, uc, N, hStream) -{{endif}} - -{{if 'cuMemsetD16Async' in found_functions}} cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD16Async(dstDevice, us, N, hStream) -{{endif}} - -{{if 'cuMemsetD32Async' in found_functions}} cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemsetD32Async(dstDevice, ui, N, hStream) -{{endif}} - -{{if 'cuMemsetD2D8Async' in found_functions}} 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: return cydriver._cuMemsetD2D8Async(dstDevice, dstPitch, uc, Width, Height, hStream) -{{endif}} - -{{if 'cuMemsetD2D16Async' in found_functions}} 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: return cydriver._cuMemsetD2D16Async(dstDevice, dstPitch, us, Width, Height, hStream) -{{endif}} - -{{if 'cuMemsetD2D32Async' in found_functions}} 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: return cydriver._cuMemsetD2D32Async(dstDevice, dstPitch, ui, Width, Height, hStream) -{{endif}} - -{{if 'cuArrayCreate_v2' in found_functions}} cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayCreate_v2(pHandle, pAllocateArray) -{{endif}} - -{{if 'cuArrayGetDescriptor_v2' in found_functions}} cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayGetDescriptor_v2(pArrayDescriptor, hArray) -{{endif}} - -{{if 'cuArrayGetSparseProperties' in found_functions}} cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayGetSparseProperties(sparseProperties, array) -{{endif}} - -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMipmappedArrayGetSparseProperties(sparseProperties, mipmap) -{{endif}} - -{{if 'cuArrayGetMemoryRequirements' in found_functions}} cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayGetMemoryRequirements(memoryRequirements, array, device) -{{endif}} - -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) -{{endif}} - -{{if 'cuArrayGetPlane' in found_functions}} cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayGetPlane(pPlaneArray, hArray, planeIdx) -{{endif}} - -{{if 'cuArrayDestroy' in found_functions}} cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArrayDestroy(hArray) -{{endif}} - -{{if 'cuArray3DCreate_v2' in found_functions}} cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArray3DCreate_v2(pHandle, pAllocateArray) -{{endif}} - -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuArray3DGetDescriptor_v2(pArrayDescriptor, hArray) -{{endif}} - -{{if 'cuMipmappedArrayCreate' in found_functions}} cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMipmappedArrayCreate(pHandle, pMipmappedArrayDesc, numMipmapLevels) -{{endif}} - -{{if 'cuMipmappedArrayGetLevel' in found_functions}} cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMipmappedArrayGetLevel(pLevelArray, hMipmappedArray, level) -{{endif}} - -{{if 'cuMipmappedArrayDestroy' in found_functions}} cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMipmappedArrayDestroy(hMipmappedArray) -{{endif}} - -{{if 'cuMemGetHandleForAddressRange' in found_functions}} cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetHandleForAddressRange(handle, dptr, size, handleType, flags) -{{endif}} - -{{if 'cuMemBatchDecompressAsync' in found_functions}} cdef CUresult cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemBatchDecompressAsync(paramsArray, count, flags, errorIndex, stream) -{{endif}} - -{{if 'cuMemAddressReserve' in found_functions}} cdef CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAddressReserve(ptr, size, alignment, addr, flags) -{{endif}} - -{{if 'cuMemAddressFree' in found_functions}} cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAddressFree(ptr, size) -{{endif}} - -{{if 'cuMemCreate' in found_functions}} cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemCreate(handle, size, prop, flags) -{{endif}} - -{{if 'cuMemRelease' in found_functions}} cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemRelease(handle) -{{endif}} - -{{if 'cuMemMap' in found_functions}} cdef CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemMap(ptr, size, offset, handle, flags) -{{endif}} - -{{if 'cuMemMapArrayAsync' in found_functions}} cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemMapArrayAsync(mapInfoList, count, hStream) -{{endif}} - -{{if 'cuMemUnmap' in found_functions}} cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemUnmap(ptr, size) -{{endif}} - -{{if 'cuMemSetAccess' in found_functions}} cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemSetAccess(ptr, size, desc, count) -{{endif}} - -{{if 'cuMemGetAccess' in found_functions}} cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetAccess(flags, location, ptr) -{{endif}} - -{{if 'cuMemExportToShareableHandle' in found_functions}} cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemExportToShareableHandle(shareableHandle, handle, handleType, flags) -{{endif}} - -{{if 'cuMemImportFromShareableHandle' in found_functions}} cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemImportFromShareableHandle(handle, osHandle, shHandleType) -{{endif}} - -{{if 'cuMemGetAllocationGranularity' in found_functions}} cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetAllocationGranularity(granularity, prop, option) -{{endif}} - -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetAllocationPropertiesFromHandle(prop, handle) -{{endif}} - -{{if 'cuMemRetainAllocationHandle' in found_functions}} cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemRetainAllocationHandle(handle, addr) -{{endif}} - -{{if 'cuMemFreeAsync' in found_functions}} cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemFreeAsync(dptr, hStream) -{{endif}} - -{{if 'cuMemAllocAsync' in found_functions}} cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAllocAsync(dptr, bytesize, hStream) -{{endif}} - -{{if 'cuMemPoolTrimTo' in found_functions}} cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolTrimTo(pool, minBytesToKeep) -{{endif}} - -{{if 'cuMemPoolSetAttribute' in found_functions}} cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolSetAttribute(pool, attr, value) -{{endif}} - -{{if 'cuMemPoolGetAttribute' in found_functions}} cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolGetAttribute(pool, attr, value) -{{endif}} - -{{if 'cuMemPoolSetAccess' in found_functions}} cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolSetAccess(pool, map, count) -{{endif}} - -{{if 'cuMemPoolGetAccess' in found_functions}} cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolGetAccess(flags, memPool, location) -{{endif}} - -{{if 'cuMemPoolCreate' in found_functions}} cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolCreate(pool, poolProps) -{{endif}} - -{{if 'cuMemPoolDestroy' in found_functions}} cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolDestroy(pool) -{{endif}} - -{{if 'cuMemGetDefaultMemPool' in found_functions}} cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetDefaultMemPool(pool_out, location, typename) -{{endif}} - -{{if 'cuMemGetMemPool' in found_functions}} cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemGetMemPool(pool, location, typename) -{{endif}} - -{{if 'cuMemSetMemPool' in found_functions}} cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemSetMemPool(location, typename, pool) -{{endif}} - -{{if 'cuMemAllocFromPoolAsync' in found_functions}} cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAllocFromPoolAsync(dptr, bytesize, pool, hStream) -{{endif}} - -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} cdef CUresult cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolExportToShareableHandle(handle_out, pool, handleType, flags) -{{endif}} - -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} cdef CUresult cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolImportFromShareableHandle(pool_out, handle, handleType, flags) -{{endif}} - -{{if 'cuMemPoolExportPointer' in found_functions}} cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolExportPointer(shareData_out, ptr) -{{endif}} - -{{if 'cuMemPoolImportPointer' in found_functions}} cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPoolImportPointer(ptr_out, pool, shareData) -{{endif}} - -{{if 'cuMulticastCreate' in found_functions}} cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastCreate(mcHandle, prop) -{{endif}} - -{{if 'cuMulticastAddDevice' in found_functions}} cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastAddDevice(mcHandle, dev) -{{endif}} - -{{if 'cuMulticastBindMem' in found_functions}} 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: return cydriver._cuMulticastBindMem(mcHandle, mcOffset, memHandle, memOffset, size, flags) -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastBindMem_v2(mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) -{{endif}} - -{{if 'cuMulticastBindAddr' in found_functions}} cdef CUresult cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastBindAddr(mcHandle, mcOffset, memptr, size, flags) -{{endif}} - -{{if 'cuMulticastBindAddr_v2' in found_functions}} cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastBindAddr_v2(mcHandle, dev, mcOffset, memptr, size, flags) -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} cdef CUresult cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastUnbind(mcHandle, dev, mcOffset, size) -{{endif}} - -{{if 'cuMulticastGetGranularity' in found_functions}} cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMulticastGetGranularity(granularity, prop, option) -{{endif}} - -{{if 'cuPointerGetAttribute' in found_functions}} cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuPointerGetAttribute(data, attribute, ptr) -{{endif}} - -{{if 'cuMemPrefetchAsync_v2' in found_functions}} cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPrefetchAsync_v2(devPtr, count, location, flags, hStream) -{{endif}} - -{{if 'cuMemAdvise_v2' in found_functions}} cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemAdvise_v2(devPtr, count, advice, location) -{{endif}} - -{{if 'cuMemPrefetchBatchAsync' in found_functions}} cdef CUresult cuMemPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) -{{endif}} - -{{if 'cuMemDiscardBatchAsync' in found_functions}} cdef CUresult cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemDiscardBatchAsync(dptrs, sizes, count, flags, hStream) -{{endif}} - -{{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} cdef CUresult cuMemDiscardAndPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) -{{endif}} - -{{if 'cuMemRangeGetAttribute' in found_functions}} cdef CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) -{{endif}} - -{{if 'cuMemRangeGetAttributes' in found_functions}} 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: return cydriver._cuMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) -{{endif}} - -{{if 'cuPointerSetAttribute' in found_functions}} cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuPointerSetAttribute(value, attribute, ptr) -{{endif}} - -{{if 'cuPointerGetAttributes' in found_functions}} cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuPointerGetAttributes(numAttributes, attributes, data, ptr) -{{endif}} - -{{if 'cuStreamCreate' in found_functions}} cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamCreate(phStream, Flags) -{{endif}} - -{{if 'cuStreamCreateWithPriority' in found_functions}} cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamCreateWithPriority(phStream, flags, priority) -{{endif}} - -{{if 'cuStreamBeginCaptureToCig' in found_functions}} cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams) -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamEndCaptureToCig(hStream) -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetPriority(hStream, priority) -{{endif}} - -{{if 'cuStreamGetDevice' in found_functions}} cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetDevice(hStream, device) -{{endif}} - -{{if 'cuStreamGetFlags' in found_functions}} cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetFlags(hStream, flags) -{{endif}} - -{{if 'cuStreamGetId' in found_functions}} cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetId(hStream, streamId) -{{endif}} - -{{if 'cuStreamGetCtx' in found_functions}} cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetCtx(hStream, pctx) -{{endif}} - -{{if 'cuStreamGetCtx_v2' in found_functions}} cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetCtx_v2(hStream, pCtx, pGreenCtx) -{{endif}} - -{{if 'cuStreamWaitEvent' in found_functions}} cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamWaitEvent(hStream, hEvent, Flags) -{{endif}} - -{{if 'cuStreamAddCallback' in found_functions}} cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamAddCallback(hStream, callback, userData, flags) -{{endif}} - -{{if 'cuStreamBeginCapture_v2' in found_functions}} cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamBeginCapture_v2(hStream, mode) -{{endif}} - -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} cdef CUresult cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode) -{{endif}} - -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuThreadExchangeStreamCaptureMode(mode) -{{endif}} - -{{if 'cuStreamEndCapture' in found_functions}} cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamEndCapture(hStream, phGraph) -{{endif}} - -{{if 'cuStreamIsCapturing' in found_functions}} cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamIsCapturing(hStream, captureStatus) -{{endif}} - -{{if 'cuStreamGetCaptureInfo_v3' in found_functions}} cdef CUresult cuStreamGetCaptureInfo(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: return cydriver._cuStreamGetCaptureInfo_v3(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) -{{endif}} - -{{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamUpdateCaptureDependencies_v2(hStream, dependencies, dependencyData, numDependencies, flags) -{{endif}} - -{{if 'cuStreamAttachMemAsync' in found_functions}} cdef CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamAttachMemAsync(hStream, dptr, length, flags) -{{endif}} - -{{if 'cuStreamQuery' in found_functions}} cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamQuery(hStream) -{{endif}} - -{{if 'cuStreamSynchronize' in found_functions}} cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamSynchronize(hStream) -{{endif}} - -{{if 'cuStreamDestroy_v2' in found_functions}} cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamDestroy_v2(hStream) -{{endif}} - -{{if 'cuStreamCopyAttributes' in found_functions}} cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamCopyAttributes(dst, src) -{{endif}} - -{{if 'cuStreamGetAttribute' in found_functions}} cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetAttribute(hStream, attr, value_out) -{{endif}} - -{{if 'cuStreamSetAttribute' in found_functions}} cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamSetAttribute(hStream, attr, value) -{{endif}} - -{{if 'cuEventCreate' in found_functions}} cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventCreate(phEvent, Flags) -{{endif}} - -{{if 'cuEventRecord' in found_functions}} cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventRecord(hEvent, hStream) -{{endif}} - -{{if 'cuEventRecordWithFlags' in found_functions}} cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventRecordWithFlags(hEvent, hStream, flags) -{{endif}} - -{{if 'cuEventQuery' in found_functions}} cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventQuery(hEvent) -{{endif}} - -{{if 'cuEventSynchronize' in found_functions}} cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventSynchronize(hEvent) -{{endif}} - -{{if 'cuEventDestroy_v2' in found_functions}} cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventDestroy_v2(hEvent) -{{endif}} - -{{if 'cuEventElapsedTime_v2' in found_functions}} cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventElapsedTime_v2(pMilliseconds, hStart, hEnd) -{{endif}} - -{{if 'cuImportExternalMemory' in found_functions}} cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuImportExternalMemory(extMem_out, memHandleDesc) -{{endif}} - -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) -{{endif}} - -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} cdef CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) -{{endif}} - -{{if 'cuDestroyExternalMemory' in found_functions}} cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDestroyExternalMemory(extMem) -{{endif}} - -{{if 'cuImportExternalSemaphore' in found_functions}} cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuImportExternalSemaphore(extSem_out, semHandleDesc) -{{endif}} - -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}} cdef CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{endif}} - -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}} cdef CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{endif}} - -{{if 'cuDestroyExternalSemaphore' in found_functions}} cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDestroyExternalSemaphore(extSem) -{{endif}} - -{{if 'cuStreamWaitValue32_v2' in found_functions}} cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamWaitValue32_v2(stream, addr, value, flags) -{{endif}} - -{{if 'cuStreamWaitValue64_v2' in found_functions}} cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamWaitValue64_v2(stream, addr, value, flags) -{{endif}} - -{{if 'cuStreamWriteValue32_v2' in found_functions}} cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamWriteValue32_v2(stream, addr, value, flags) -{{endif}} - -{{if 'cuStreamWriteValue64_v2' in found_functions}} cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamWriteValue64_v2(stream, addr, value, flags) -{{endif}} - -{{if 'cuStreamBatchMemOp_v2' in found_functions}} cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamBatchMemOp_v2(stream, count, paramArray, flags) -{{endif}} - -{{if 'cuFuncGetAttribute' in found_functions}} cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncGetAttribute(pi, attrib, hfunc) -{{endif}} - -{{if 'cuFuncSetAttribute' in found_functions}} cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncSetAttribute(hfunc, attrib, value) -{{endif}} - -{{if 'cuFuncSetCacheConfig' in found_functions}} cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncSetCacheConfig(hfunc, config) -{{endif}} - -{{if 'cuFuncGetModule' in found_functions}} cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncGetModule(hmod, hfunc) -{{endif}} - -{{if 'cuFuncGetName' in found_functions}} cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncGetName(name, hfunc) -{{endif}} - -{{if 'cuFuncGetParamInfo' in found_functions}} cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncGetParamInfo(func, paramIndex, paramOffset, paramSize) -{{endif}} - -{{if 'cuFuncGetParamCount' in found_functions}} cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncGetParamCount(func, paramCount) -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncIsLoaded(state, function) -{{endif}} - -{{if 'cuFuncLoad' in found_functions}} cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncLoad(function) -{{endif}} - -{{if 'cuLaunchKernel' in found_functions}} 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: return cydriver._cuLaunchKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) -{{endif}} - -{{if 'cuLaunchKernelEx' in found_functions}} cdef CUresult cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchKernelEx(config, f, kernelParams, extra) -{{endif}} - -{{if 'cuLaunchCooperativeKernel' in found_functions}} 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: return cydriver._cuLaunchCooperativeKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) -{{endif}} - -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} cdef CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags) -{{endif}} - -{{if 'cuLaunchHostFunc' in found_functions}} cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchHostFunc(hStream, fn, userData) -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchHostFunc_v2(hStream, fn, userData, syncMode) -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncSetBlockShape(hfunc, x, y, z) -{{endif}} - -{{if 'cuFuncSetSharedSize' in found_functions}} cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncSetSharedSize(hfunc, numbytes) -{{endif}} - -{{if 'cuParamSetSize' in found_functions}} cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuParamSetSize(hfunc, numbytes) -{{endif}} - -{{if 'cuParamSeti' in found_functions}} cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuParamSeti(hfunc, offset, value) -{{endif}} - -{{if 'cuParamSetf' in found_functions}} cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuParamSetf(hfunc, offset, value) -{{endif}} - -{{if 'cuParamSetv' in found_functions}} cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuParamSetv(hfunc, offset, ptr, numbytes) -{{endif}} - -{{if 'cuLaunch' in found_functions}} cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunch(f) -{{endif}} - -{{if 'cuLaunchGrid' in found_functions}} cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchGrid(f, grid_width, grid_height) -{{endif}} - -{{if 'cuLaunchGridAsync' in found_functions}} cdef CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLaunchGridAsync(f, grid_width, grid_height, hStream) -{{endif}} - -{{if 'cuParamSetTexRef' in found_functions}} cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuParamSetTexRef(hfunc, texunit, hTexRef) -{{endif}} - -{{if 'cuFuncSetSharedMemConfig' in found_functions}} cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuFuncSetSharedMemConfig(hfunc, config) -{{endif}} - -{{if 'cuGraphCreate' in found_functions}} cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphCreate(phGraph, flags) -{{endif}} - -{{if 'cuGraphAddKernelNode_v2' in found_functions}} cdef CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddKernelNode_v2(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphKernelNodeGetParams_v2(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphKernelNodeSetParams_v2(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddMemcpyNode' in found_functions}} 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: return cydriver._cuGraphAddMemcpyNode(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) -{{endif}} - -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemcpyNodeGetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemcpyNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddMemsetNode' in found_functions}} 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: return cydriver._cuGraphAddMemsetNode(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) -{{endif}} - -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemsetNodeGetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemsetNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddHostNode' in found_functions}} 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: return cydriver._cuGraphAddHostNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphHostNodeGetParams' in found_functions}} cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphHostNodeGetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphHostNodeSetParams' in found_functions}} cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphHostNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddChildGraphNode' in found_functions}} cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddChildGraphNode(phGraphNode, hGraph, dependencies, numDependencies, childGraph) -{{endif}} - -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphChildGraphNodeGetGraph(hNode, phGraph) -{{endif}} - -{{if 'cuGraphAddEmptyNode' in found_functions}} cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddEmptyNode(phGraphNode, hGraph, dependencies, numDependencies) -{{endif}} - -{{if 'cuGraphAddEventRecordNode' in found_functions}} cdef CUresult cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddEventRecordNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{endif}} - -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphEventRecordNodeGetEvent(hNode, event_out) -{{endif}} - -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphEventRecordNodeSetEvent(hNode, event) -{{endif}} - -{{if 'cuGraphAddEventWaitNode' in found_functions}} cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddEventWaitNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{endif}} - -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphEventWaitNodeGetEvent(hNode, event_out) -{{endif}} - -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphEventWaitNodeSetEvent(hNode, event) -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} 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: return cydriver._cuGraphAddExternalSemaphoresSignalNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} 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: return cydriver._cuGraphAddExternalSemaphoresWaitNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddBatchMemOpNode' in found_functions}} 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: return cydriver._cuGraphAddBatchMemOpNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} cdef CUresult cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphBatchMemOpNodeGetParams(hNode, nodeParams_out) -{{endif}} - -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphBatchMemOpNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphAddMemAllocNode' in found_functions}} 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: return cydriver._cuGraphAddMemAllocNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemAllocNodeGetParams(hNode, params_out) -{{endif}} - -{{if 'cuGraphAddMemFreeNode' in found_functions}} cdef CUresult cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddMemFreeNode(phGraphNode, hGraph, dependencies, numDependencies, dptr) -{{endif}} - -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphMemFreeNodeGetParams(hNode, dptr_out) -{{endif}} - -{{if 'cuDeviceGraphMemTrim' in found_functions}} cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGraphMemTrim(device) -{{endif}} - -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetGraphMemAttribute(device, attr, value) -{{endif}} - -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceSetGraphMemAttribute(device, attr, value) -{{endif}} - -{{if 'cuGraphClone' in found_functions}} cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphClone(phGraphClone, originalGraph) -{{endif}} - -{{if 'cuGraphNodeFindInClone' in found_functions}} cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeFindInClone(phNode, hOriginalNode, hClonedGraph) -{{endif}} - -{{if 'cuGraphNodeGetType' in found_functions}} cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetType(hNode, typename) -{{endif}} - -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetContainingGraph(hNode, phGraph) -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetLocalId(hNode, nodeId) -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetToolsId(hNode, toolsNodeId) -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphGetId(hGraph, graphId) -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecGetId(hGraphExec, graphId) -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphGetNodes(hGraph, nodes, numNodes) -{{endif}} - -{{if 'cuGraphGetRootNodes' in found_functions}} cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphGetRootNodes(hGraph, rootNodes, numRootNodes) -{{endif}} - -{{if 'cuGraphGetEdges_v2' in found_functions}} cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphGetEdges_v2(hGraph, from_, to, edgeData, numEdges) -{{endif}} - -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetDependencies_v2(hNode, dependencies, edgeData, numDependencies) -{{endif}} - -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetDependentNodes_v2(hNode, dependentNodes, edgeData, numDependentNodes) -{{endif}} - -{{if 'cuGraphAddDependencies_v2' in found_functions}} cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{endif}} - -{{if 'cuGraphRemoveDependencies_v2' in found_functions}} cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphRemoveDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{endif}} - -{{if 'cuGraphDestroyNode' in found_functions}} cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphDestroyNode(hNode) -{{endif}} - -{{if 'cuGraphInstantiateWithFlags' in found_functions}} cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphInstantiateWithFlags(phGraphExec, hGraph, flags) -{{endif}} - -{{if 'cuGraphInstantiateWithParams' in found_functions}} cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphInstantiateWithParams(phGraphExec, hGraph, instantiateParams) -{{endif}} - -{{if 'cuGraphExecGetFlags' in found_functions}} cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecGetFlags(hGraphExec, flags) -{{endif}} - -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecKernelNodeSetParams_v2(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams, ctx) -{{endif}} - -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} cdef CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams, ctx) -{{endif}} - -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph) -{{endif}} - -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) -{{endif}} - -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} cdef CUresult cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} cdef CUresult cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphNodeSetEnabled' in found_functions}} cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) -{{endif}} - -{{if 'cuGraphNodeGetEnabled' in found_functions}} cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) -{{endif}} - -{{if 'cuGraphUpload' in found_functions}} cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphUpload(hGraphExec, hStream) -{{endif}} - -{{if 'cuGraphLaunch' in found_functions}} cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphLaunch(hGraphExec, hStream) -{{endif}} - -{{if 'cuGraphExecDestroy' in found_functions}} cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecDestroy(hGraphExec) -{{endif}} - -{{if 'cuGraphDestroy' in found_functions}} cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphDestroy(hGraph) -{{endif}} - -{{if 'cuGraphExecUpdate_v2' in found_functions}} cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecUpdate_v2(hGraphExec, hGraph, resultInfo) -{{endif}} - -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphKernelNodeCopyAttributes(dst, src) -{{endif}} - -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphKernelNodeGetAttribute(hNode, attr, value_out) -{{endif}} - -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphKernelNodeSetAttribute(hNode, attr, value) -{{endif}} - -{{if 'cuGraphDebugDotPrint' in found_functions}} cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphDebugDotPrint(hGraph, path, flags) -{{endif}} - -{{if 'cuUserObjectCreate' in found_functions}} cdef CUresult cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) -{{endif}} - -{{if 'cuUserObjectRetain' in found_functions}} cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuUserObjectRetain(object, count) -{{endif}} - -{{if 'cuUserObjectRelease' in found_functions}} cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuUserObjectRelease(object, count) -{{endif}} - -{{if 'cuGraphRetainUserObject' in found_functions}} cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphRetainUserObject(graph, object, count, flags) -{{endif}} - -{{if 'cuGraphReleaseUserObject' in found_functions}} cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphReleaseUserObject(graph, object, count) -{{endif}} - -{{if 'cuGraphAddNode_v2' in found_functions}} cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphAddNode_v2(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) -{{endif}} - -{{if 'cuGraphNodeSetParams' in found_functions}} cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeSetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphNodeGetParams' in found_functions}} cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphNodeGetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} - -{{if 'cuGraphConditionalHandleCreate' in found_functions}} cdef CUresult cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphConditionalHandleCreate(pHandle_out, hGraph, ctx, defaultLaunchValue, flags) -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} cdef CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} 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: return cydriver._cuOccupancyMaxPotentialBlockSizeWithFlags(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) -{{endif}} - -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} cdef CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) -{{endif}} - -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyMaxPotentialClusterSize(clusterSize, func, config) -{{endif}} - -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuOccupancyMaxActiveClusters(numClusters, func, config) -{{endif}} - -{{if 'cuTexRefSetArray' in found_functions}} cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetArray(hTexRef, hArray, Flags) -{{endif}} - -{{if 'cuTexRefSetMipmappedArray' in found_functions}} cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, Flags) -{{endif}} - -{{if 'cuTexRefSetAddress_v2' in found_functions}} cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetAddress_v2(ByteOffset, hTexRef, dptr, numbytes) -{{endif}} - -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} cdef CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetAddress2D_v3(hTexRef, desc, dptr, Pitch) -{{endif}} - -{{if 'cuTexRefSetFormat' in found_functions}} cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetFormat(hTexRef, fmt, NumPackedComponents) -{{endif}} - -{{if 'cuTexRefSetAddressMode' in found_functions}} cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetAddressMode(hTexRef, dim, am) -{{endif}} - -{{if 'cuTexRefSetFilterMode' in found_functions}} cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetFilterMode(hTexRef, fm) -{{endif}} - -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetMipmapFilterMode(hTexRef, fm) -{{endif}} - -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetMipmapLevelBias(hTexRef, bias) -{{endif}} - -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetMipmapLevelClamp(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) -{{endif}} - -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetMaxAnisotropy(hTexRef, maxAniso) -{{endif}} - -{{if 'cuTexRefSetBorderColor' in found_functions}} cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetBorderColor(hTexRef, pBorderColor) -{{endif}} - -{{if 'cuTexRefSetFlags' in found_functions}} cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefSetFlags(hTexRef, Flags) -{{endif}} - -{{if 'cuTexRefGetAddress_v2' in found_functions}} cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetAddress_v2(pdptr, hTexRef) -{{endif}} - -{{if 'cuTexRefGetArray' in found_functions}} cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetArray(phArray, hTexRef) -{{endif}} - -{{if 'cuTexRefGetMipmappedArray' in found_functions}} cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetMipmappedArray(phMipmappedArray, hTexRef) -{{endif}} - -{{if 'cuTexRefGetAddressMode' in found_functions}} cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetAddressMode(pam, hTexRef, dim) -{{endif}} - -{{if 'cuTexRefGetFilterMode' in found_functions}} cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetFilterMode(pfm, hTexRef) -{{endif}} - -{{if 'cuTexRefGetFormat' in found_functions}} cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetFormat(pFormat, pNumChannels, hTexRef) -{{endif}} - -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetMipmapFilterMode(pfm, hTexRef) -{{endif}} - -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetMipmapLevelBias(pbias, hTexRef) -{{endif}} - -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetMipmapLevelClamp(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) -{{endif}} - -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetMaxAnisotropy(pmaxAniso, hTexRef) -{{endif}} - -{{if 'cuTexRefGetBorderColor' in found_functions}} cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetBorderColor(pBorderColor, hTexRef) -{{endif}} - -{{if 'cuTexRefGetFlags' in found_functions}} cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefGetFlags(pFlags, hTexRef) -{{endif}} - -{{if 'cuTexRefCreate' in found_functions}} cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefCreate(pTexRef) -{{endif}} - -{{if 'cuTexRefDestroy' in found_functions}} cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexRefDestroy(hTexRef) -{{endif}} - -{{if 'cuSurfRefSetArray' in found_functions}} cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSurfRefSetArray(hSurfRef, hArray, Flags) -{{endif}} - -{{if 'cuSurfRefGetArray' in found_functions}} cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSurfRefGetArray(phArray, hSurfRef) -{{endif}} - -{{if 'cuTexObjectCreate' in found_functions}} 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: return cydriver._cuTexObjectCreate(pTexObject, pResDesc, pTexDesc, pResViewDesc) -{{endif}} - -{{if 'cuTexObjectDestroy' in found_functions}} cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexObjectDestroy(texObject) -{{endif}} - -{{if 'cuTexObjectGetResourceDesc' in found_functions}} cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexObjectGetResourceDesc(pResDesc, texObject) -{{endif}} - -{{if 'cuTexObjectGetTextureDesc' in found_functions}} cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexObjectGetTextureDesc(pTexDesc, texObject) -{{endif}} - -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTexObjectGetResourceViewDesc(pResViewDesc, texObject) -{{endif}} - -{{if 'cuSurfObjectCreate' in found_functions}} cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSurfObjectCreate(pSurfObject, pResDesc) -{{endif}} - -{{if 'cuSurfObjectDestroy' in found_functions}} cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSurfObjectDestroy(surfObject) -{{endif}} - -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuSurfObjectGetResourceDesc(pResDesc, surfObject) -{{endif}} - -{{if 'cuTensorMapEncodeTiled' in found_functions}} 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: return cydriver._cuTensorMapEncodeTiled(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{endif}} - -{{if 'cuTensorMapEncodeIm2col' in found_functions}} 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: return cydriver._cuTensorMapEncodeIm2col(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{endif}} - -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}} 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: return cydriver._cuTensorMapEncodeIm2colWide(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) -{{endif}} - -{{if 'cuTensorMapReplaceAddress' in found_functions}} cdef CUresult cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuTensorMapReplaceAddress(tensorMap, globalAddress) -{{endif}} - -{{if 'cuDeviceCanAccessPeer' in found_functions}} cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceCanAccessPeer(canAccessPeer, dev, peerDev) -{{endif}} - -{{if 'cuCtxEnablePeerAccess' in found_functions}} cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxEnablePeerAccess(peerContext, Flags) -{{endif}} - -{{if 'cuCtxDisablePeerAccess' in found_functions}} cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxDisablePeerAccess(peerContext) -{{endif}} - -{{if 'cuDeviceGetP2PAttribute' in found_functions}} cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetP2PAttribute(value, attrib, srcDevice, dstDevice) -{{endif}} - -{{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} cdef CUresult cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) -{{endif}} - -{{if 'cuGraphicsUnregisterResource' in found_functions}} cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsUnregisterResource(resource) -{{endif}} - -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsSubResourceGetMappedArray(pArray, resource, arrayIndex, mipLevel) -{{endif}} - -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray, resource) -{{endif}} - -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsResourceGetMappedPointer_v2(pDevPtr, pSize, resource) -{{endif}} - -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsResourceSetMapFlags_v2(resource, flags) -{{endif}} - -{{if 'cuGraphicsMapResources' in found_functions}} cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsMapResources(count, resources, hStream) -{{endif}} - -{{if 'cuGraphicsUnmapResources' in found_functions}} cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsUnmapResources(count, resources, hStream) -{{endif}} - -{{if 'cuGetProcAddress_v2' in found_functions}} cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGetProcAddress_v2(symbol, pfn, cudaVersion, flags, symbolStatus) -{{endif}} - -{{if 'cuCoredumpGetAttribute' in found_functions}} cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpGetAttribute(attrib, value, size) -{{endif}} - -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpGetAttributeGlobal(attrib, value, size) -{{endif}} - -{{if 'cuCoredumpSetAttribute' in found_functions}} cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpSetAttribute(attrib, value, size) -{{endif}} - -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpSetAttributeGlobal(attrib, value, size) -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpRegisterStartCallback(callback, userData, callbackOut) -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpRegisterCompleteCallback(callback, userData, callbackOut) -{{endif}} - -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpDeregisterStartCallback(callback) -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCoredumpDeregisterCompleteCallback(callback) -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGetExportTable(ppExportTable, pExportTableId) -{{endif}} - -{{if 'cuGreenCtxCreate' in found_functions}} cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxCreate(phCtx, desc, dev, flags) -{{endif}} - -{{if 'cuGreenCtxDestroy' in found_functions}} cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxDestroy(hCtx) -{{endif}} - -{{if 'cuCtxFromGreenCtx' in found_functions}} cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxFromGreenCtx(pContext, hCtx) -{{endif}} - -{{if 'cuDeviceGetDevResource' in found_functions}} cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetDevResource(device, resource, typename) -{{endif}} - -{{if 'cuCtxGetDevResource' in found_functions}} cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCtxGetDevResource(hCtx, resource, typename) -{{endif}} - -{{if 'cuGreenCtxGetDevResource' in found_functions}} cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxGetDevResource(hCtx, resource, typename) -{{endif}} - -{{if 'cuDevSmResourceSplitByCount' in found_functions}} cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevSmResourceSplitByCount(result, nbGroups, input, remainder, flags, minCount) -{{endif}} - -{{if 'cuDevSmResourceSplit' in found_functions}} cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevSmResourceSplit(result, nbGroups, input, remainder, flags, groupParams) -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDevResourceGenerateDesc(phDesc, resources, nbResources) -{{endif}} - -{{if 'cuGreenCtxRecordEvent' in found_functions}} cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxRecordEvent(hCtx, hEvent) -{{endif}} - -{{if 'cuGreenCtxWaitEvent' in found_functions}} cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxWaitEvent(hCtx, hEvent) -{{endif}} - -{{if 'cuStreamGetGreenCtx' in found_functions}} cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetGreenCtx(hStream, phCtx) -{{endif}} - -{{if 'cuGreenCtxStreamCreate' in found_functions}} cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxStreamCreate(phStream, greenCtx, flags, priority) -{{endif}} - -{{if 'cuGreenCtxGetId' in found_functions}} cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGreenCtxGetId(greenCtx, greenCtxId) -{{endif}} - -{{if 'cuStreamGetDevResource' in found_functions}} cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuStreamGetDevResource(hStream, resource, typename) -{{endif}} - -{{if 'cuLogsRegisterCallback' in found_functions}} cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLogsRegisterCallback(callbackFunc, userData, callback_out) -{{endif}} - -{{if 'cuLogsUnregisterCallback' in found_functions}} cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLogsUnregisterCallback(callback) -{{endif}} - -{{if 'cuLogsCurrent' in found_functions}} cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLogsCurrent(iterator_out, flags) -{{endif}} - -{{if 'cuLogsDumpToFile' in found_functions}} cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLogsDumpToFile(iterator, pathToFile, flags) -{{endif}} - -{{if 'cuLogsDumpToMemory' in found_functions}} cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuLogsDumpToMemory(iterator, buffer, size, flags) -{{endif}} - -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessGetRestoreThreadId(pid, tid) -{{endif}} - -{{if 'cuCheckpointProcessGetState' in found_functions}} cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessGetState(pid, state) -{{endif}} - -{{if 'cuCheckpointProcessLock' in found_functions}} cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessLock(pid, args) -{{endif}} - -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessCheckpoint(pid, args) -{{endif}} - -{{if 'cuCheckpointProcessRestore' in found_functions}} cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessRestore(pid, args) -{{endif}} - -{{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuCheckpointProcessUnlock(pid, args) -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuProfilerStart() -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuProfilerStop() -{{endif}} - -{{if True}} cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamConsumerConnect(conn, stream) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamConsumerConnectWithFlags(conn, stream, flags) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamConsumerDisconnect(conn) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamProducerConnect(conn, stream, width, height) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamProducerDisconnect(conn) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamProducerPresentFrame(conn, eglframe, pStream) -{{endif}} - -{{if True}} cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEGLStreamProducerReturnFrame(conn, eglframe, pStream) -{{endif}} - -{{if True}} cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) -{{endif}} - -{{if True}} cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) -{{endif}} - -{{if True}} cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsGLRegisterBuffer(pCudaResource, buffer, Flags) -{{endif}} - -{{if True}} cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsGLRegisterImage(pCudaResource, image, target, Flags) -{{endif}} - -{{if True}} cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) -{{endif}} - -{{if True}} cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuVDPAUGetDevice(pDevice, vdpDevice, vdpGetProcAddress) -{{endif}} - -{{if True}} cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuVDPAUCtxCreate_v2(pCtx, flags, device, vdpDevice, vdpGetProcAddress) -{{endif}} - -{{if True}} cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsVDPAURegisterVideoSurface(pCudaResource, vdpSurface, flags) -{{endif}} - -{{if True}} cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuGraphicsVDPAURegisterOutputSurface(pCudaResource, vdpSurface, flags) -{{endif}} diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pxd b/cuda_bindings/src/cuda/bindings/cynvfatbin.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cynvfatbin.pxd rename to cuda_bindings/src/cuda/bindings/cynvfatbin.pxd diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pyx b/cuda_bindings/src/cuda/bindings/cynvfatbin.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cynvfatbin.pyx rename to cuda_bindings/src/cuda/bindings/cynvfatbin.pyx diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/src/cuda/bindings/cynvjitlink.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cynvjitlink.pxd rename to cuda_bindings/src/cuda/bindings/cynvjitlink.pxd diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/src/cuda/bindings/cynvjitlink.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cynvjitlink.pyx rename to cuda_bindings/src/cuda/bindings/cynvjitlink.pyx diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/src/cuda/bindings/cynvml.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cynvml.pxd rename to cuda_bindings/src/cuda/bindings/cynvml.pxd diff --git a/cuda_bindings/cuda/bindings/cynvml.pyx b/cuda_bindings/src/cuda/bindings/cynvml.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cynvml.pyx rename to cuda_bindings/src/cuda/bindings/cynvml.pyx diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in b/cuda_bindings/src/cuda/bindings/cynvrtc.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/cynvrtc.pxd.in rename to cuda_bindings/src/cuda/bindings/cynvrtc.pxd.in index 209b361c05..1fcf26f332 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in +++ b/cuda_bindings/src/cuda/bindings/cynvrtc.pxd.in @@ -160,4 +160,3 @@ cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) ex cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil {{endif}} - diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pyx.in b/cuda_bindings/src/cuda/bindings/cynvrtc.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/cynvrtc.pyx.in rename to cuda_bindings/src/cuda/bindings/cynvrtc.pyx.in diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/src/cuda/bindings/cynvvm.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/cynvvm.pxd rename to cuda_bindings/src/cuda/bindings/cynvvm.pxd diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/src/cuda/bindings/cynvvm.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/cynvvm.pyx rename to cuda_bindings/src/cuda/bindings/cynvvm.pyx diff --git a/cuda_bindings/cuda/bindings/cyruntime.pxd.in b/cuda_bindings/src/cuda/bindings/cyruntime.pxd.in similarity index 99% rename from cuda_bindings/cuda/bindings/cyruntime.pxd.in rename to cuda_bindings/src/cuda/bindings/cyruntime.pxd.in index 85108b68a9..9cc7288c2f 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pxd.in +++ b/cuda_bindings/src/cuda/bindings/cyruntime.pxd.in @@ -2086,4 +2086,4 @@ cdef enum: CUDART_VERSION = 13020 cdef enum: __CUDART_API_VERSION = 13020 -cdef enum: CUDA_EGL_MAX_PLANES = 3 \ No newline at end of file +cdef enum: CUDA_EGL_MAX_PLANES = 3 diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/src/cuda/bindings/cyruntime.pyx.in similarity index 100% rename from cuda_bindings/cuda/bindings/cyruntime.pyx.in rename to cuda_bindings/src/cuda/bindings/cyruntime.pyx.in diff --git a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in b/cuda_bindings/src/cuda/bindings/cyruntime_functions.pxi.in similarity index 99% rename from cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in rename to cuda_bindings/src/cuda/bindings/cyruntime_functions.pxi.in index 8cbdb881a7..61ba2e1367 100644 --- a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in +++ b/cuda_bindings/src/cuda/bindings/cyruntime_functions.pxi.in @@ -1610,4 +1610,3 @@ cdef extern from "cuda_profiler_api.h": cudaError_t cudaProfilerStop() nogil {{endif}} - diff --git a/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in b/cuda_bindings/src/cuda/bindings/cyruntime_types.pxi similarity index 100% rename from cuda_bindings/cuda/bindings/cyruntime_types.pxi.in rename to cuda_bindings/src/cuda/bindings/cyruntime_types.pxi diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/src/cuda/bindings/driver.pxd.in similarity index 100% rename from cuda_bindings/cuda/bindings/driver.pxd.in rename to cuda_bindings/src/cuda/bindings/driver.pxd.in diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/src/cuda/bindings/driver.pyx.in similarity index 99% rename from cuda_bindings/cuda/bindings/driver.pyx.in rename to cuda_bindings/src/cuda/bindings/driver.pyx.in index 2c02494148..3df5c09cf9 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/src/cuda/bindings/driver.pyx.in @@ -33984,7 +33984,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BA @cython.embedsignature(True) def cuMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[CUmemcpyAttributes], hStream): - """ + """ Performs asynchronous memory copy operation with the specified attributes. @@ -34054,7 +34054,7 @@ def cuMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[CUmemcpyA @cython.embedsignature(True) def cuMemcpy3DWithAttributesAsync(op : Optional[CUDA_MEMCPY3D_BATCH_OP], unsigned long long flags, hStream): - """ + """ Performs 3D memory copy with attributes asynchronously @@ -54750,7 +54750,7 @@ def cuCoredumpDeregisterCompleteCallback(callback): @cython.embedsignature(True) def cuGetExportTable(pExportTableId : Optional[CUuuid]): - """ + """ Parameters ---------- @@ -58400,4 +58400,3 @@ cdef int _add_native_handle_getters() except?-1: {{endif}} return 0 _add_native_handle_getters() - diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pxd b/cuda_bindings/src/cuda/bindings/nvfatbin.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/nvfatbin.pxd rename to cuda_bindings/src/cuda/bindings/nvfatbin.pxd diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/src/cuda/bindings/nvfatbin.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/nvfatbin.pyx rename to cuda_bindings/src/cuda/bindings/nvfatbin.pyx diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/src/cuda/bindings/nvjitlink.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/nvjitlink.pxd rename to cuda_bindings/src/cuda/bindings/nvjitlink.pxd diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/src/cuda/bindings/nvjitlink.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/nvjitlink.pyx rename to cuda_bindings/src/cuda/bindings/nvjitlink.pyx diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/src/cuda/bindings/nvml.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/nvml.pxd rename to cuda_bindings/src/cuda/bindings/nvml.pxd diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/src/cuda/bindings/nvml.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/nvml.pyx rename to cuda_bindings/src/cuda/bindings/nvml.pyx diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/src/cuda/bindings/nvrtc.pxd.in similarity index 100% rename from cuda_bindings/cuda/bindings/nvrtc.pxd.in rename to cuda_bindings/src/cuda/bindings/nvrtc.pxd.in diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/src/cuda/bindings/nvrtc.pyx.in similarity index 99% rename from cuda_bindings/cuda/bindings/nvrtc.pyx.in rename to cuda_bindings/src/cuda/bindings/nvrtc.pyx.in index 2f50afa726..77a77b7973 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/src/cuda/bindings/nvrtc.pyx.in @@ -1050,7 +1050,7 @@ def nvrtcSetFlowCallback(prog, callback, payload): @cython.embedsignature(True) def nvrtcGetTileIRSize(prog): - """ + """ Parameters ---------- @@ -1084,7 +1084,7 @@ def nvrtcGetTileIRSize(prog): @cython.embedsignature(True) def nvrtcGetTileIR(prog, char* TileIR): - """ + """ Parameters ---------- diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/src/cuda/bindings/nvvm.pxd similarity index 100% rename from cuda_bindings/cuda/bindings/nvvm.pxd rename to cuda_bindings/src/cuda/bindings/nvvm.pxd diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/src/cuda/bindings/nvvm.pyx similarity index 100% rename from cuda_bindings/cuda/bindings/nvvm.pyx rename to cuda_bindings/src/cuda/bindings/nvvm.pyx diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/src/cuda/bindings/runtime.pxd.in similarity index 100% rename from cuda_bindings/cuda/bindings/runtime.pxd.in rename to cuda_bindings/src/cuda/bindings/runtime.pxd.in diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/src/cuda/bindings/runtime.pyx.in similarity index 99% rename from cuda_bindings/cuda/bindings/runtime.pyx.in rename to cuda_bindings/src/cuda/bindings/runtime.pyx.in index 279a8c1759..dae61548bf 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/src/cuda/bindings/runtime.pyx.in @@ -21715,7 +21715,7 @@ def cudaIpcOpenMemHandle(handle not None : cudaIpcMemHandle_t, unsigned int flag Notes ----- - No guarantees are made about the address returned in `*devPtr`. + No guarantees are made about the address returned in `*devPtr`. In particular, multiple processes may not receive the same address for the same `handle`. """ cdef void_ptr devPtr = 0 @@ -28783,7 +28783,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBa @cython.embedsignature(True) def cudaMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[cudaMemcpyAttributes], stream): - """ + """ Performs asynchronous memory copy operation with the specified attributes. @@ -28843,7 +28843,7 @@ def cudaMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[cudaMem @cython.embedsignature(True) def cudaMemcpy3DWithAttributesAsync(op : Optional[cudaMemcpy3DBatchOp], unsigned long long flags, stream): - """ + """ Performs 3D asynchronous memory copy with the specified attributes. @@ -41862,4 +41862,3 @@ cdef int _add_native_handle_getters() except?-1: {{endif}} return 0 _add_native_handle_getters() - diff --git a/cuda_bindings/cuda/bindings/utils/__init__.py b/cuda_bindings/src/cuda/bindings/utils/__init__.py similarity index 89% rename from cuda_bindings/cuda/bindings/utils/__init__.py rename to cuda_bindings/src/cuda/bindings/utils/__init__.py index e4fcb15e8f..4e62915460 100644 --- a/cuda_bindings/cuda/bindings/utils/__init__.py +++ b/cuda_bindings/src/cuda/bindings/utils/__init__.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE from typing import Any, Callable diff --git a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py b/cuda_bindings/src/cuda/bindings/utils/_ptx_utils.py similarity index 96% rename from cuda_bindings/cuda/bindings/utils/_ptx_utils.py rename to cuda_bindings/src/cuda/bindings/utils/_ptx_utils.py index b9df650312..9f6b3b69cc 100644 --- a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py +++ b/cuda_bindings/src/cuda/bindings/utils/_ptx_utils.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import re diff --git a/cuda_bindings/cuda/bindings/utils/_version_check.py b/cuda_bindings/src/cuda/bindings/utils/_version_check.py similarity index 95% rename from cuda_bindings/cuda/bindings/utils/_version_check.py rename to cuda_bindings/src/cuda/bindings/utils/_version_check.py index 1ebd7f3d92..25fc7884c2 100644 --- a/cuda_bindings/cuda/bindings/utils/_version_check.py +++ b/cuda_bindings/src/cuda/bindings/utils/_version_check.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import os