From 02b47b4720cab1e8a1071ab3b5333194984ee339 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:32:54 -0700 Subject: [PATCH 001/113] Bump github/codeql-action from 3.29.3 to 3.29.4 (#785) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.3 to 3.29.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/d6bbdef45e766d081b84a2def353b0055f728d3e...4e828ff8d448a8a6e532957b1811f387a63867e8) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dd0187bba..737091de2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,13 +31,13 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 with: category: "/language:${{matrix.language}}" From fed215da737e14a6e14af4faf3d24a7b8ca0ae11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 00:27:29 -0700 Subject: [PATCH 002/113] Bump pypa/cibuildwheel from 3.0.1 to 3.1.1 (#784) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.0.1 to 3.1.1. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/95d2f3a92fbf80abe066b09418bbf128a8923df2...e6de07ed3921b51089aae6981989889cf1eddd0c) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-version: 3.1.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 47352b53c..20b71e251 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -107,7 +107,7 @@ jobs: if-no-files-found: error - name: Build cuda.core wheel - uses: pypa/cibuildwheel@95d2f3a92fbf80abe066b09418bbf128a8923df2 # v3.0.1 + uses: pypa/cibuildwheel@e6de07ed3921b51089aae6981989889cf1eddd0c # v3.1.1 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" @@ -149,7 +149,7 @@ jobs: cuda-version: ${{ inputs.cuda-version }} - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@95d2f3a92fbf80abe066b09418bbf128a8923df2 # v3.0.1 + uses: pypa/cibuildwheel@e6de07ed3921b51089aae6981989889cf1eddd0c # v3.1.1 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" From f336027f8dd40fedd063c7374e32e526a29bd1c8 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 29 Jul 2025 19:20:24 -0700 Subject: [PATCH 003/113] Remove profile directive (#787) --- cuda_bindings/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 409c48eda..128220371 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -323,7 +323,7 @@ def do_cythonize(extensions): return cythonize( extensions, nthreads=nthreads, - compiler_directives=dict(profile=True, language_level=3, embedsignature=True, binding=True), + compiler_directives=dict(language_level=3, embedsignature=True, binding=True), **extra_cythonize_kwargs, ) From 926b4e6cd177b51c2a9213ab32e647a37899d374 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 4 Aug 2025 09:06:09 -0700 Subject: [PATCH 004/113] Backport `test_cufile.py` changes (from unreleased branch). (#783) * Change test_batch_io_large_operations to avoid a flood of output (`assert read_data == expected_data` failure). * Remove `(scope="module")` from `cufile_env_json` fixture: resolves test_batch_io_large_operations failure. --- cuda_bindings/tests/test_cufile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 1a5134868..02053a2a2 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -40,7 +40,7 @@ def platform_is_wsl(): pytest.skip("skipping cuFile tests on WSL", allow_module_level=True) -@pytest.fixture(scope="module") +@pytest.fixture def cufile_env_json(): """Set CUFILE_ENV_PATH_JSON environment variable for async tests.""" original_value = os.environ.get("CUFILE_ENV_PATH_JSON") @@ -1573,7 +1573,14 @@ def test_batch_io_large_operations(): repetitions = buf_size // test_string_len expected_data = (test_string * repetitions)[:buf_size] - assert read_data == expected_data, f"Read data doesn't match written data for operation {i}" + if read_data != expected_data: + n = 100 # Show first n bytes + raise RuntimeError( + f"Read data doesn't match written data for operation {i}: " + f"{len(read_data)=}, {len(expected_data)=}, " + f"first {n} bytes: read {read_data[:n]!r}, " + f"expected {expected_data[:n]!r}" + ) # Clean up batch IO cufile.batch_io_destroy(batch_handle) From c016d65d71d4aca76910094ded9a48d466f61bb9 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 6 Aug 2025 23:27:37 +0800 Subject: [PATCH 005/113] Update `cuda.bindings` to 13.0.0 (#792) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Propagate generated path finder changes * Rebase to 13.0 RC14 * Update license headers on examples * Regenerate after merging upstream * Update benchmarks and run pre-commit * cython-gen output, NO manual changes * Bump cuda/bindings/_version.py → 13.0.0 * `path_finder` and cybind updates for CTK 13.0 (#81) * Update SUPPORTED_WINDOWS_DLLS: kitpicks/cuda-r13-0/13.0.0/013/local_installers/cuda_13.0.0_windows.exe * Update SUPPORTED_LINUX_SONAMES: kitpicks/cuda-r13-0/13.0.0/013/local_installers/cuda_13.0.0_580.31_linux.run * 013 → 014: SUPPORTED_LINUX_SONAMES unchanged * 013 → 014: SUPPORTED_WINDOWS_DLLS unchanged * cybind update with 13.0.0 headers (014) * Bump cuda/bindings/_version.py → 13.0.0 * test_nvjitlink.py: remove sm_60, add sm_100 * Updates from cybind after removing all 11.x headers (affects "automatically generated" comments only). * Add new toolshed/reformat_cuda_enums_as_py.py (reads cuda.h, driver_types.h headers directly). * Use new toolshed/reformat_cuda_enums_as_py.py to regenerate driver_cu_result_explanations.py, runtime_cuda_error_explanations.py * Use `driver.cuDeviceGetUuid()` instead of `driver.cuDeviceGetUuid_v2()` with CTK 13. * Adjustments for locating nvvm directory in CTK 13 installations. * Fixes from windows testing (#89) * Add missing error handling (tests/test_nvjitlink.py) * Add missing `const` in cudaMemcpyBatchAsync call (cuda/bindings/runtime.pyx.in) * Add qa/13.0.0/01_linux.sh * Remove qa/13.0.0/01_linux.sh after it was moved to a new upstream qa branch. * Strictly correct casts for cudaMemcpyBatchAsync (generated by cython_gen). * Pragmatic minimal fix for cudaMemcpyBatchAsync casts (works with Linux and Windows). (generated with cython-gen) * print *prog pointers in nvrtcCreateProgram, nvrtcCompileProgram bindings * Remove stray `"nvrtc64_*_0.alt.dll"` entries in `SUPPORTED_WINDOWS_DLLS` * Revert "print *prog pointers in nvrtcCreateProgram, nvrtcCompileProgram bindings" This reverts commit 104abbdb4824dc2ed43565c8cafdf363aefc5f07. * _find_lib_dir_using_cuda_home(): Windows CTK 13 → bin\x64 * getLocalRuntimeVersion(): Search for libcudart.so.13 * SUPPORTED_LINUX_SONAMES: Add CTK 13 soname values * Update path_finder/supported_libs.py from kitpicks 13.0.0/025 (#96) * Linux update from cuda_13.0.0_580.46_kitpicks025_linux.run: no-op b/o NVIDIA/cuda-python-private#95 * Windows update from cuda_13.0.0_kitpicks025_windows.exe * This trivial change should have been included in PR #81, but was overlooked. Direct commit for simplicity. * cuda_core forward compatibility changes (private development branch) (#94) * CCCL_INCLUDE_PATH fixes in test_event.py, test_launcher.py * Add new file (accidentally missing in a prior commit). * Fix pre-commit errors in new tests/helpers.py * 12→13 compatibility fixes in cuda/core/experimental/_graph.py * CTK 12 compatibility (tests/test_cuda_utils.py) * Make the cuda/core/experimental/_graph.py changes backwards compatible. * Do not try to hide `13` in cuda_core/tests/test_cuda_utils.py * More elegant handling of `CCCL_INCLUDE_PATHS` in cuda_core/tests/helpers.py * Remove stray empty line (cuda_core/tests/conftest.py). * Fix logic error computing CCCL_INCLUDE_PATHS in cuda_core/tests/helpers.py * Fix `cuda_bindings` and `cuda_core` examples (#98) * Unmask globalToShmemAsyncCopy_test.py error: explicit pytest_skipif_cuda_include_not_found(), pytest_skipif_compute_capability_too_low() * Update cuda_bindings/examples/common/common.py for CTK 13 compatibility, to fix globalToShmemAsyncCopy_test.py * Update cuda_core/examples/thread_block_cluster.py for CTK 13 compatibility. * Update driver_cu_result_explanations.py, runtime_cuda_error_explanations.py (#100) * kitpicks/cuda-r13-0/13.0.0/033: CUDA_HOME=/usr/local/cuda python cython_gen.py --target-lib driver runtime nvrtc --out ../unreleased-13.0 (#107) * Update cuda_pathfinder supported_nvidia_libs.py from kitpicks 13.0.0/036 (NO CHANGES compared to 025) * Update driver_cu_result_explanations.py, runtime_cuda_error_explanations.py from kitpicks 13.0.0/036 (NO CHANGES compared to 025) * Update cuda_pathfinder supported_nvidia_libs.py EXPECTED_LIB_SYMBOLS for libnpp* The newly chosen symbols appear in all CTK 12.x releases and 13.0.0: https://gitlab-master.nvidia.com/rgrossekunst/rwgk_config_nvidia/-/blob/a1c2f29decd9b93fc7af9611bdc60565446b0cd3/bin/check_libnpp_symbols.sh * cython-gen changes due to PR #101 (#115) * cython-gen changes due to release_gil_revert_leos_commits_fix_cast_error (#116) * cython-gen changes due to cython-gen PR #118 (#120) * test_cufile.py: pytest.skip("NEEDS DEBUGGING (unreleased-13.0)") * cython-gen changes on top of `git merge world-main -X ours` product. * Add missing imports (related to NVIDIA/cuda-python#769). These got lost due to merging with `-X ours` * Revert obsolete aec7d10c6d608e9184a81cc52583f1de38217e3a Made obsolete by https://github.com/NVIDIA/cuda-python/pull/778 * Remove cuda_bindings/site-packages entirely. * Change test_batch_io_large_operations to avoid a flood of output (`assert read_data == expected_data` failure). * Remove `(scope="module")` from `cufile_env_json` fixture: resolves test_batch_io_large_operations failure. * [unreleased-13.0] `test_cufile.py`: Remove fallback to `/etc/cufile.json` (#126) * test_cufile.py: NEVER USE /etc/cufile.json * Remove /etc/cufile.json code entirely. * update win driver to 580.88 * change backport branch to 12.9.x * update build ver to 13.0.0 * crt headers are now split from cudart (or nvcc?) * remove the outdated cufile skip condition (it was buggy anyway) * remove 11.8 CI and add 13.0 CI * update cuda-bindings optional dependencies * update release notes * update cuda-bindings docs * update cuda-python docs * libnvvm is also split out * ensure using sanitizer from the latest release of the same major ver * Remove -cu12 suffixes and add nvidia-nvvm in cuda_pathfinder/pyproject.toml. Make related changes in .github/workflows * fix backport branch's ci name * restore nvidia_wheels_cu12 * remove tests * always test 12.9.x with the latest driver * ensure fetch_ctk works with 12.x * Fix Linux libnvvm site-packages search for CTK 13 CTK 12: site-packages/nvidia/cuda_nvcc/nvvm/lib64/libnvvm.so CTK 13: site-packages/nvidia/cu13/lib/libnvvm.so.4 * update docs * add PTX ISA 9.0 to utils * sync 13.0.0 docs * Fix Windows site-packages search for CTK 13 * Also add "nvidia-nvvm~=13.0" in cuda_bindings/pyproject.toml * Add _work_around_known_bugs() in load_dl_linux.py To resolve this issue: https://github.com/NVIDIA/cuda-python/pull/792#issuecomment-3157455586 * driver_cu_result_explanations.py, runtime_cuda_error_explanations.py refresh (no-op) * SUPPORTED_LINUX_SONAMES refresh (no-op) * SUPPORTED_WINDOWS_DLLS refresh (no-op) * Update generated files: nvjitlink, nvvm (trivial changes, functional no-op) * update release dates --------- Co-authored-by: Vladislav Zhurba Co-authored-by: Vladislav Zhurba <53052066+vzhurba01@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve Co-authored-by: Ralf W. Grosse-Kunstleve Co-authored-by: Robert Maynard --- .github/BACKPORT_BRANCH | 2 +- .github/actions/fetch_ctk/action.yml | 13 +- .github/workflows/guess_latest.sh | 13 +- .github/workflows/install_gpu_driver.ps1 | 6 +- .github/workflows/test-wheel-linux.yml | 25 +- .github/workflows/test-wheel-windows.yml | 15 +- README.md | 1 + ci/tools/env-vars | 2 +- ci/versions.json | 2 +- cuda_bindings/benchmarks/conftest.py | 6 +- .../benchmarks/test_launch_latency.py | 2 +- .../benchmarks/test_pointer_attributes.py | 2 +- .../cuda/bindings/_bindings/cydriver.pxd.in | 136 +- .../cuda/bindings/_bindings/cydriver.pyx.in | 1114 +++--- .../cuda/bindings/_bindings/cynvrtc.pxd.in | 12 +- .../cuda/bindings/_bindings/cynvrtc.pyx.in | 64 +- .../cuda/bindings/_bindings/cyruntime.pxd.in | 152 +- .../cuda/bindings/_bindings/cyruntime.pyx.in | 304 +- .../bindings/_bindings/cyruntime_ptds.pxd.in | 152 +- .../bindings/_bindings/cyruntime_ptds.pyx.in | 208 +- .../cuda/bindings/_internal/nvjitlink.pxd | 4 +- .../bindings/_internal/nvjitlink_linux.pyx | 4 +- .../bindings/_internal/nvjitlink_windows.pyx | 4 +- .../cuda/bindings/_internal/nvvm.pxd | 2 +- .../cuda/bindings/_internal/nvvm_linux.pyx | 2 +- .../cuda/bindings/_internal/nvvm_windows.pyx | 2 +- .../cuda/bindings/_internal/utils.pxd | 8 +- .../cuda/bindings/_internal/utils.pyx | 2 +- cuda_bindings/cuda/bindings/_lib/utils.pyx.in | 3 +- cuda_bindings/cuda/bindings/_version.py | 2 +- cuda_bindings/cuda/bindings/cydriver.pxd.in | 220 +- cuda_bindings/cuda/bindings/cydriver.pyx.in | 192 +- cuda_bindings/cuda/bindings/cynvjitlink.pxd | 13 +- cuda_bindings/cuda/bindings/cynvjitlink.pyx | 4 +- cuda_bindings/cuda/bindings/cynvrtc.pxd.in | 13 +- cuda_bindings/cuda/bindings/cynvrtc.pyx.in | 14 +- cuda_bindings/cuda/bindings/cynvvm.pxd | 2 +- cuda_bindings/cuda/bindings/cynvvm.pyx | 2 +- cuda_bindings/cuda/bindings/cyruntime.pxd.in | 160 +- cuda_bindings/cuda/bindings/cyruntime.pyx.in | 208 +- .../cuda/bindings/cyruntime_functions.pxi.in | 167 +- .../cuda/bindings/cyruntime_types.pxi.in | 174 +- cuda_bindings/cuda/bindings/driver.pxd.in | 156 +- cuda_bindings/cuda/bindings/driver.pyx.in | 3235 ++++++--------- cuda_bindings/cuda/bindings/nvjitlink.pxd | 4 +- cuda_bindings/cuda/bindings/nvjitlink.pyx | 13 +- cuda_bindings/cuda/bindings/nvrtc.pxd.in | 2 +- cuda_bindings/cuda/bindings/nvrtc.pyx.in | 69 +- cuda_bindings/cuda/bindings/nvvm.pxd | 2 +- cuda_bindings/cuda/bindings/nvvm.pyx | 2 +- cuda_bindings/cuda/bindings/runtime.pxd.in | 340 +- cuda_bindings/cuda/bindings/runtime.pyx.in | 3536 ++++++++--------- .../cuda/bindings/utils/_get_handle.pyx.in | 6 +- .../cuda/bindings/utils/_ptx_utils.py | 1 + cuda_bindings/docs/source/install.md | 11 +- cuda_bindings/docs/source/module/driver.rst | 199 +- cuda_bindings/docs/source/module/nvrtc.rst | 9 +- cuda_bindings/docs/source/module/runtime.rst | 177 +- cuda_bindings/docs/source/release.rst | 3 +- .../{12.X.Y-notes.rst => 12.9.1-notes.rst} | 9 +- .../docs/source/release/13.0.0-notes.rst | 52 + cuda_bindings/docs/versions.json | 1 + .../0_Introduction/clock_nvrtc_test.py | 12 +- .../simpleCubemapTexture_test.py | 13 +- .../examples/0_Introduction/simpleP2P_test.py | 13 +- .../0_Introduction/simpleZeroCopy_test.py | 13 +- .../0_Introduction/systemWideAtomics_test.py | 16 +- .../0_Introduction/vectorAddDrv_test.py | 14 +- .../0_Introduction/vectorAddMMAP_test.py | 14 +- .../streamOrderedAllocation_test.py | 13 +- .../globalToShmemAsyncCopy_test.py | 38 +- .../3_CUDA_Features/simpleCudaGraphs_test.py | 13 +- .../conjugateGradientMultiBlockCG_test.py | 13 +- cuda_bindings/examples/common/common.py | 77 +- cuda_bindings/examples/common/helper_cuda.py | 14 +- .../examples/common/helper_string.py | 10 +- .../examples/extra/isoFDModelling_test.py | 15 +- .../examples/extra/jit_program_test.py | 15 +- .../examples/extra/numba_emm_plugin.py | 13 +- cuda_bindings/pyproject.toml | 9 +- cuda_bindings/setup.py | 70 - .../_cuda_bindings_redirector.pth | 4 - .../_cuda_bindings_redirector.py | 30 - cuda_bindings/tests/cython/test_ccuda.pyx | 8 +- cuda_bindings/tests/cython/test_ccudart.pyx | 12 +- .../cython/test_interoperability_cython.pyx | 24 +- cuda_bindings/tests/test_cuda.py | 64 +- cuda_bindings/tests/test_cudart.py | 144 +- cuda_bindings/tests/test_cufile.py | 13 +- cuda_bindings/tests/test_interoperability.py | 24 +- cuda_bindings/tests/test_kernelParams.py | 18 +- cuda_bindings/tests/test_nvjitlink.py | 4 +- cuda_bindings/tests/test_nvrtc.py | 4 +- cuda_core/cuda/core/experimental/_device.py | 2 +- .../_utils/driver_cu_result_explanations.py | 405 +- .../_utils/runtime_cuda_error_explanations.py | 642 +-- cuda_core/examples/thread_block_cluster.py | 9 +- cuda_core/tests/test_cuda_utils.py | 4 +- cuda_core/tests/test_device.py | 2 +- .../_dynamic_libs/find_nvidia_dynamic_lib.py | 71 +- .../pathfinder/_dynamic_libs/load_dl_linux.py | 23 +- .../_dynamic_libs/supported_nvidia_libs.py | 94 +- cuda_pathfinder/pyproject.toml | 16 + cuda_python/DESCRIPTION.rst | 1 + cuda_python/docs/source/release.md | 3 +- .../{12.X.Y-notes.rst => 12.9.1-notes.rst} | 8 +- .../docs/source/release/13.0.0-notes.rst | 25 + cuda_python/docs/versions.json | 1 + toolshed/reformat_cuda_enums_as_py.py | 111 + .../reformat_cuda_enums_from_web_as_py.py | 51 - 110 files changed, 6513 insertions(+), 6959 deletions(-) rename cuda_bindings/docs/source/release/{12.X.Y-notes.rst => 12.9.1-notes.rst} (82%) create mode 100644 cuda_bindings/docs/source/release/13.0.0-notes.rst delete mode 100644 cuda_bindings/site-packages/_cuda_bindings_redirector.pth delete mode 100644 cuda_bindings/site-packages/_cuda_bindings_redirector.py rename cuda_python/docs/source/release/{12.X.Y-notes.rst => 12.9.1-notes.rst} (73%) create mode 100644 cuda_python/docs/source/release/13.0.0-notes.rst create mode 100755 toolshed/reformat_cuda_enums_as_py.py delete mode 100755 toolshed/reformat_cuda_enums_from_web_as_py.py diff --git a/.github/BACKPORT_BRANCH b/.github/BACKPORT_BRANCH index 9266e6784..1ba33f6ae 100644 --- a/.github/BACKPORT_BRANCH +++ b/.github/BACKPORT_BRANCH @@ -1 +1 @@ -11.8.x +12.9.x diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 43a018880..83b447f0c 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -17,7 +17,7 @@ inputs: description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'" required: false type: string - default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink,libcufile" + default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink,libcufile" runs: using: composite @@ -32,15 +32,16 @@ runs: if [[ "$CUDA_MAJOR_VER" -lt 12 ]]; then CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libnvjitlink/}" fi + # Conditionally strip out cuda_crt and libnvvm for CUDA versions < 13 + CUDA_MAJOR_VER="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})" + if [[ "$CUDA_MAJOR_VER" -lt 13 ]]; then + CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//cuda_crt/}" + CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libnvvm/}" + fi # Conditionally strip out libcufile since it does not support Windows if [[ "${{ inputs.host-platform }}" == win-* ]]; then CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libcufile/}" fi - # Conditionally strip out libcufile for CUDA versions < 12.2.0 + aarch64 (redist not available) - CUDA_MINOR_VER="$(cut -d '.' -f 2 <<< ${{ inputs.cuda-version }})" - if [[ ("$CUDA_MAJOR_VER" -lt 12 || "$CUDA_MINOR_VER" -lt 2) && "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then - CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libcufile/}" - fi # Cleanup stray commas after removing components CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//,,/,}" diff --git a/.github/workflows/guess_latest.sh b/.github/workflows/guess_latest.sh index d2e8427eb..8a0a13034 100644 --- a/.github/workflows/guess_latest.sh +++ b/.github/workflows/guess_latest.sh @@ -6,18 +6,27 @@ # URL to search URL="https://developer.download.nvidia.com/compute/cuda/redist/" +# Ensure exactly one argument is provided +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Accept major version as the first argument +MAJOR_VERSION="$1" + # Fetch the directory listing and extract the latest version number get_latest_version() { # Get the HTML content of the page local html_content=$(wget -q -O - "$URL") # Extract links matching the pattern redistrib_?.?.?.json - local files=$(echo "$html_content" | grep -oP 'redistrib_[0-9]+\.[0-9]+\.[0-9]+\.json' | cut -d'"' -f2) + local files=$(echo "$html_content" | grep -oP "redistrib_${MAJOR_VERSION}\.[0-9]+\.[0-9]+\.json" | cut -d'"' -f2) # If files were found, extract the version numbers and find the latest if [ -n "$files" ]; then # Extract just the version numbers using regex - local versions=$(echo "$files" | grep -oP 'redistrib_\K[0-9]+\.[0-9]+\.[0-9]+(?=\.json)') + local versions=$(echo "$files" | grep -oP "redistrib_\K${MAJOR_VERSION}\.[0-9]+\.[0-9]+(?=\.json)") # Sort the versions and get the latest local latest_version=$(echo "$versions" | sort -V | tail -n 1) diff --git a/.github/workflows/install_gpu_driver.ps1 b/.github/workflows/install_gpu_driver.ps1 index 8b9490198..256c5cf3a 100644 --- a/.github/workflows/install_gpu_driver.ps1 +++ b/.github/workflows/install_gpu_driver.ps1 @@ -6,9 +6,9 @@ function Install-Driver { # Set the correct URL, filename, and arguments to the installer - # This driver is picked to support Windows 11 & CUDA 12.8 - $url = 'https://us.download.nvidia.com/tesla/572.13/572.13-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe'; - $file_dir = 'C:\NVIDIA-Driver\572.13-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe'; + # This driver is picked to support Windows 11 & CUDA 13.0 + $url = 'https://us.download.nvidia.com/tesla/580.88/580.88-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe'; + $file_dir = 'C:\NVIDIA-Driver\580.88-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe'; $install_args = '/s /noeula /noreboot'; # Create the folder for the driver download diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 546e6aa95..f7b1e6064 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -51,7 +51,7 @@ jobs: # Add a special entry for the H100 runner on amd64. special_runner="" if [[ "${ARCH}" == "amd64" ]]; then - special_runner="- { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: 'H100', DRIVER: 'latest' }" + special_runner="- { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: 'H100', DRIVER: 'latest' }" fi # Please keep the matrices sorted in ascending order by the following: @@ -62,18 +62,16 @@ jobs: # export MATRICES=" pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'earliest' } + - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } + - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '13.0.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'earliest' } + - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } + - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '13.0.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } + - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } ${special_runner} nightly: - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } @@ -200,13 +198,14 @@ jobs: OLD_BRANCH=$(cat .github/BACKPORT_BRANCH) OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "build-and-test.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') + LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then echo "LATEST_PRIOR_RUN_ID not found!" exit 1 fi gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python + rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts ls -al $OLD_BASENAME mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/ @@ -318,16 +317,16 @@ jobs: pip install $(ls cuda_python*.whl)[all] fi - - name: Install cuda.pathfinder nvidia_wheels_cu12 - if: startsWith(matrix.CUDA_VER, '12.') + - name: Install cuda.pathfinder nvidia_wheels_cu13 + if: startsWith(matrix.CUDA_VER, '13.') run: | pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu12] + pip install -v .[nvidia_wheels_cu13] pip freeze popd - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '12.') + if: startsWith(matrix.CUDA_VER, '13.') env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work run: run-tests pathfinder diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 0f175af78..99cdca6c3 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -47,10 +47,10 @@ jobs: # export MATRICES=" pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' } - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0' } - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1' } + - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '0' } + - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1' } nightly: - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' } - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' } @@ -178,7 +178,7 @@ jobs: run: | $OLD_BRANCH = Get-Content .github/BACKPORT_BRANCH $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - $runData = gh run list -b $OLD_BRANCH -L 1 -w "build-and-test.yml" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json + $runData = gh run list -b $OLD_BRANCH -L 1 -w "ci.yml" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { Write-Host "LATEST_PRIOR_RUN_ID not found!" exit 1 @@ -186,6 +186,7 @@ jobs: $LATEST_PRIOR_RUN_ID = $runData[0].databaseId gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python + Remove-Item -Recurse -Force "${OLD_BASENAME}-tests" # exclude cython test artifacts Get-ChildItem -Path $OLD_BASENAME New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" @@ -285,17 +286,17 @@ jobs: pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" } - - name: Install cuda.pathfinder nvidia_wheels_cu12 - if: startsWith(matrix.CUDA_VER, '12.') + - name: Install cuda.pathfinder nvidia_wheels_cu13 + if: startsWith(matrix.CUDA_VER, '13.') shell: bash --noprofile --norc -xeuo pipefail {0} run: | pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu12] + pip install -v .[nvidia_wheels_cu13] pip freeze popd - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '12.') + if: startsWith(matrix.CUDA_VER, '13.') env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work shell: bash --noprofile --norc -xeuo pipefail {0} diff --git a/README.md b/README.md index 97d9800cc..7cc64fafa 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,4 @@ The list of available interfaces is: * NVRTC * nvJitLink * NVVM +* cuFile diff --git a/ci/tools/env-vars b/ci/tools/env-vars index 8b68540fc..3dcb81a4c 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -60,7 +60,7 @@ elif [[ "${1}" == "test" ]]; then # We only test compute-sanitizer on python 3.12 arbitrarily; we don't need to use sanitizer on the entire matrix # Only local ctk installs have compute-sanitizer; there is no wheel for it if [[ "${PY_VER}" == "3.12" && "${CUDA_VER}" != "11.8.0" && "${LOCAL_CTK}" == 1 && "${HOST_PLATFORM}" == linux* ]]; then - echo "LATEST_CUDA_VERSION=$(bash .github/workflows/guess_latest.sh)" >> $GITHUB_ENV + echo "LATEST_CUDA_VERSION=$(bash .github/workflows/guess_latest.sh $TEST_CUDA_MAJOR)" >> $GITHUB_ENV SETUP_SANITIZER=1 else SETUP_SANITIZER=0 diff --git a/ci/versions.json b/ci/versions.json index 5608eeb1d..5eb48beb8 100644 --- a/ci/versions.json +++ b/ci/versions.json @@ -1,7 +1,7 @@ { "cuda": { "build": { - "version": "12.9.0" + "version": "13.0.0" } } } diff --git a/cuda_bindings/benchmarks/conftest.py b/cuda_bindings/benchmarks/conftest.py index 4c075122c..2787f41d1 100644 --- a/cuda_bindings/benchmarks/conftest.py +++ b/cuda_bindings/benchmarks/conftest.py @@ -4,7 +4,9 @@ import numpy as np import pytest -from cuda import cuda, cudart, nvrtc +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc +from cuda.bindings import runtime as cudart def ASSERT_DRV(err): @@ -28,7 +30,7 @@ def init_cuda(): ASSERT_DRV(err) err, device = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) ASSERT_DRV(err) # create stream diff --git a/cuda_bindings/benchmarks/test_launch_latency.py b/cuda_bindings/benchmarks/test_launch_latency.py index aea251108..8fb2ef683 100755 --- a/cuda_bindings/benchmarks/test_launch_latency.py +++ b/cuda_bindings/benchmarks/test_launch_latency.py @@ -7,7 +7,7 @@ from conftest import ASSERT_DRV from kernels import kernel_string -from cuda import cuda +from cuda.bindings import driver as cuda def launch(kernel, stream, args=(), arg_types=()): diff --git a/cuda_bindings/benchmarks/test_pointer_attributes.py b/cuda_bindings/benchmarks/test_pointer_attributes.py index c34ee4f70..620afae7b 100644 --- a/cuda_bindings/benchmarks/test_pointer_attributes.py +++ b/cuda_bindings/benchmarks/test_pointer_attributes.py @@ -6,7 +6,7 @@ import pytest from conftest import ASSERT_DRV -from cuda import cuda +from cuda.bindings import driver as cuda random.seed(0) diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in index 6ac1e31d2..50701f70d 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from cuda.bindings.cydriver cimport * {{if 'cuGetErrorString' in found_functions}} @@ -39,11 +39,6 @@ cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuDeviceGetUuid' in found_functions}} - -cdef CUresult _cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil @@ -69,6 +64,11 @@ cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CU cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{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 +{{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil @@ -134,16 +134,6 @@ cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuCtxCreate_v2' in found_functions}} - -cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxCreate_v3' in found_functions}} - -cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil @@ -179,6 +169,11 @@ cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nog cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCtxGetDevice_v2' in found_functions}} + +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCtxGetFlags' in found_functions}} cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil @@ -199,6 +194,11 @@ cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCtxSynchronize_v2' in found_functions}} + +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCtxSetLimit' in found_functions}} cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil @@ -669,14 +669,14 @@ cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}} +{{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, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyBatchAsync_v2(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 {{endif}} -{{if 'cuMemcpy3DBatchAsync' in found_functions}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} -cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DBatchAsync_v2(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} @@ -929,6 +929,21 @@ cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolPro cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuMemGetDefaultMemPool' in found_functions}} + +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + +{{if 'cuMemGetMemPool' in found_functions}} + +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + +{{if 'cuMemSetMemPool' in found_functions}} + +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil @@ -989,24 +1004,29 @@ cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastO cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}} +{{if 'cuMemPrefetchAsync_v2' in found_functions}} -cdef CUresult _cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemPrefetchAsync_v2' in found_functions}} +{{if 'cuMemAdvise_v2' in found_functions}} -cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemAdvise' in found_functions}} +{{if 'cuMemPrefetchBatchAsync' in found_functions}} -cdef CUresult _cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +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 {{endif}} -{{if 'cuMemAdvise_v2' in found_functions}} +{{if 'cuMemDiscardBatchAsync' in found_functions}} -cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +{{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 {{endif}} {{if 'cuMemRangeGetAttribute' in found_functions}} @@ -1104,21 +1124,11 @@ cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CU cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - -cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - -cdef CUresult _cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil @@ -1189,11 +1199,6 @@ cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND n cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuEventElapsedTime' in found_functions}} - -cdef CUresult _cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil @@ -1604,51 +1609,26 @@ cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNo cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphGetEdges' in found_functions}} - -cdef CUresult _cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphNodeGetDependencies' in found_functions}} - -cdef CUresult _cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphNodeGetDependentNodes' in found_functions}} - -cdef CUresult _cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphAddDependencies' in found_functions}} - -cdef CUresult _cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphRemoveDependencies' in found_functions}} - -cdef CUresult _cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil @@ -1799,11 +1779,6 @@ cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsig cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphAddNode' in found_functions}} - -cdef CUresult _cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} cdef CUresult _cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil @@ -2084,6 +2059,11 @@ cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_ cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil {{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 +{{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil @@ -2209,6 +2189,11 @@ cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ? cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuGreenCtxGetId' in found_functions}} + +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil @@ -2254,11 +2239,6 @@ cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) exce cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuCheckpointProcessRestore' in found_functions}} - -cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 9bdf78dd5..cd29890ba 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os import win32api @@ -21,12 +21,12 @@ cdef bint __cuPythonInit = False {{if 'cuDeviceGet' in found_functions}}cdef void *__cuDeviceGet = NULL{{endif}} {{if 'cuDeviceGetCount' in found_functions}}cdef void *__cuDeviceGetCount = NULL{{endif}} {{if 'cuDeviceGetName' in found_functions}}cdef void *__cuDeviceGetName = NULL{{endif}} -{{if 'cuDeviceGetUuid' in found_functions}}cdef void *__cuDeviceGetUuid = NULL{{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}}cdef void *__cuDeviceGetUuid_v2 = NULL{{endif}} {{if 'cuDeviceGetLuid' in found_functions}}cdef void *__cuDeviceGetLuid = NULL{{endif}} {{if 'cuDeviceTotalMem_v2' in found_functions}}cdef void *__cuDeviceTotalMem_v2 = NULL{{endif}} {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}cdef void *__cuDeviceGetTexture1DLinearMaxWidth = NULL{{endif}} {{if 'cuDeviceGetAttribute' in found_functions}}cdef void *__cuDeviceGetAttribute = NULL{{endif}} +{{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}}cdef void *__cuDeviceGetHostAtomicCapabilities = NULL{{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}cdef void *__cuDeviceGetNvSciSyncAttributes = NULL{{endif}} {{if 'cuDeviceSetMemPool' in found_functions}}cdef void *__cuDeviceSetMemPool = NULL{{endif}} {{if 'cuDeviceGetMemPool' in found_functions}}cdef void *__cuDeviceGetMemPool = NULL{{endif}} @@ -40,8 +40,6 @@ cdef bint __cuPythonInit = False {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxSetFlags_v2 = NULL{{endif}} {{if 'cuDevicePrimaryCtxGetState' in found_functions}}cdef void *__cuDevicePrimaryCtxGetState = NULL{{endif}} {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxReset_v2 = NULL{{endif}} -{{if 'cuCtxCreate_v2' in found_functions}}cdef void *__cuCtxCreate_v2 = NULL{{endif}} -{{if 'cuCtxCreate_v3' in found_functions}}cdef void *__cuCtxCreate_v3 = NULL{{endif}} {{if 'cuCtxCreate_v4' in found_functions}}cdef void *__cuCtxCreate_v4 = NULL{{endif}} {{if 'cuCtxDestroy_v2' in found_functions}}cdef void *__cuCtxDestroy_v2 = NULL{{endif}} {{if 'cuCtxPushCurrent_v2' in found_functions}}cdef void *__cuCtxPushCurrent_v2 = NULL{{endif}} @@ -49,10 +47,12 @@ cdef bint __cuPythonInit = False {{if 'cuCtxSetCurrent' in found_functions}}cdef void *__cuCtxSetCurrent = NULL{{endif}} {{if 'cuCtxGetCurrent' in found_functions}}cdef void *__cuCtxGetCurrent = NULL{{endif}} {{if 'cuCtxGetDevice' in found_functions}}cdef void *__cuCtxGetDevice = NULL{{endif}} +{{if 'cuCtxGetDevice_v2' in found_functions}}cdef void *__cuCtxGetDevice_v2 = NULL{{endif}} {{if 'cuCtxGetFlags' in found_functions}}cdef void *__cuCtxGetFlags = NULL{{endif}} {{if 'cuCtxSetFlags' in found_functions}}cdef void *__cuCtxSetFlags = NULL{{endif}} {{if 'cuCtxGetId' in found_functions}}cdef void *__cuCtxGetId = NULL{{endif}} {{if 'cuCtxSynchronize' in found_functions}}cdef void *__cuCtxSynchronize = NULL{{endif}} +{{if 'cuCtxSynchronize_v2' in found_functions}}cdef void *__cuCtxSynchronize_v2 = NULL{{endif}} {{if 'cuCtxSetLimit' in found_functions}}cdef void *__cuCtxSetLimit = NULL{{endif}} {{if 'cuCtxGetLimit' in found_functions}}cdef void *__cuCtxGetLimit = NULL{{endif}} {{if 'cuCtxGetCacheConfig' in found_functions}}cdef void *__cuCtxGetCacheConfig = NULL{{endif}} @@ -147,8 +147,8 @@ cdef bint __cuPythonInit = False {{if 'cuMemcpy2DAsync_v2' in found_functions}}cdef void *__cuMemcpy2DAsync_v2 = NULL{{endif}} {{if 'cuMemcpy3DAsync_v2' in found_functions}}cdef void *__cuMemcpy3DAsync_v2 = NULL{{endif}} {{if 'cuMemcpy3DPeerAsync' in found_functions}}cdef void *__cuMemcpy3DPeerAsync = NULL{{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}}cdef void *__cuMemcpyBatchAsync = NULL{{endif}} -{{if 'cuMemcpy3DBatchAsync' in found_functions}}cdef void *__cuMemcpy3DBatchAsync = NULL{{endif}} +{{if 'cuMemcpyBatchAsync_v2' in found_functions}}cdef void *__cuMemcpyBatchAsync_v2 = NULL{{endif}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}}cdef void *__cuMemcpy3DBatchAsync_v2 = NULL{{endif}} {{if 'cuMemsetD8_v2' in found_functions}}cdef void *__cuMemsetD8_v2 = NULL{{endif}} {{if 'cuMemsetD16_v2' in found_functions}}cdef void *__cuMemsetD16_v2 = NULL{{endif}} {{if 'cuMemsetD32_v2' in found_functions}}cdef void *__cuMemsetD32_v2 = NULL{{endif}} @@ -199,6 +199,9 @@ cdef bint __cuPythonInit = False {{if 'cuMemPoolGetAccess' in found_functions}}cdef void *__cuMemPoolGetAccess = NULL{{endif}} {{if 'cuMemPoolCreate' in found_functions}}cdef void *__cuMemPoolCreate = NULL{{endif}} {{if 'cuMemPoolDestroy' in found_functions}}cdef void *__cuMemPoolDestroy = NULL{{endif}} +{{if 'cuMemGetDefaultMemPool' in found_functions}}cdef void *__cuMemGetDefaultMemPool = NULL{{endif}} +{{if 'cuMemGetMemPool' in found_functions}}cdef void *__cuMemGetMemPool = NULL{{endif}} +{{if 'cuMemSetMemPool' in found_functions}}cdef void *__cuMemSetMemPool = NULL{{endif}} {{if 'cuMemAllocFromPoolAsync' in found_functions}}cdef void *__cuMemAllocFromPoolAsync = NULL{{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}}cdef void *__cuMemPoolExportToShareableHandle = NULL{{endif}} {{if 'cuMemPoolImportFromShareableHandle' in found_functions}}cdef void *__cuMemPoolImportFromShareableHandle = NULL{{endif}} @@ -211,10 +214,11 @@ cdef bint __cuPythonInit = False {{if 'cuMulticastUnbind' in found_functions}}cdef void *__cuMulticastUnbind = NULL{{endif}} {{if 'cuMulticastGetGranularity' in found_functions}}cdef void *__cuMulticastGetGranularity = NULL{{endif}} {{if 'cuPointerGetAttribute' in found_functions}}cdef void *__cuPointerGetAttribute = NULL{{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}}cdef void *__cuMemPrefetchAsync = NULL{{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}}cdef void *__cuMemPrefetchAsync_v2 = NULL{{endif}} -{{if 'cuMemAdvise' in found_functions}}cdef void *__cuMemAdvise = NULL{{endif}} {{if 'cuMemAdvise_v2' in found_functions}}cdef void *__cuMemAdvise_v2 = NULL{{endif}} +{{if 'cuMemPrefetchBatchAsync' in found_functions}}cdef void *__cuMemPrefetchBatchAsync = NULL{{endif}} +{{if 'cuMemDiscardBatchAsync' in found_functions}}cdef void *__cuMemDiscardBatchAsync = NULL{{endif}} +{{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}}cdef void *__cuMemDiscardAndPrefetchBatchAsync = NULL{{endif}} {{if 'cuMemRangeGetAttribute' in found_functions}}cdef void *__cuMemRangeGetAttribute = NULL{{endif}} {{if 'cuMemRangeGetAttributes' in found_functions}}cdef void *__cuMemRangeGetAttributes = NULL{{endif}} {{if 'cuPointerSetAttribute' in found_functions}}cdef void *__cuPointerSetAttribute = NULL{{endif}} @@ -234,9 +238,7 @@ cdef bint __cuPythonInit = False {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}cdef void *__cuThreadExchangeStreamCaptureMode = NULL{{endif}} {{if 'cuStreamEndCapture' in found_functions}}cdef void *__cuStreamEndCapture = NULL{{endif}} {{if 'cuStreamIsCapturing' in found_functions}}cdef void *__cuStreamIsCapturing = NULL{{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}}cdef void *__cuStreamGetCaptureInfo_v2 = NULL{{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}cdef void *__cuStreamGetCaptureInfo_v3 = NULL{{endif}} -{{if 'cuStreamUpdateCaptureDependencies' in found_functions}}cdef void *__cuStreamUpdateCaptureDependencies = NULL{{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}cdef void *__cuStreamUpdateCaptureDependencies_v2 = NULL{{endif}} {{if 'cuStreamAttachMemAsync' in found_functions}}cdef void *__cuStreamAttachMemAsync = NULL{{endif}} {{if 'cuStreamQuery' in found_functions}}cdef void *__cuStreamQuery = NULL{{endif}} @@ -251,7 +253,6 @@ cdef bint __cuPythonInit = False {{if 'cuEventQuery' in found_functions}}cdef void *__cuEventQuery = NULL{{endif}} {{if 'cuEventSynchronize' in found_functions}}cdef void *__cuEventSynchronize = NULL{{endif}} {{if 'cuEventDestroy_v2' in found_functions}}cdef void *__cuEventDestroy_v2 = NULL{{endif}} -{{if 'cuEventElapsedTime' in found_functions}}cdef void *__cuEventElapsedTime = NULL{{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}}cdef void *__cuEventElapsedTime_v2 = NULL{{endif}} {{if 'cuImportExternalMemory' in found_functions}}cdef void *__cuImportExternalMemory = NULL{{endif}} {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}cdef void *__cuExternalMemoryGetMappedBuffer = NULL{{endif}} @@ -334,15 +335,10 @@ cdef bint __cuPythonInit = False {{if 'cuGraphNodeGetType' in found_functions}}cdef void *__cuGraphNodeGetType = NULL{{endif}} {{if 'cuGraphGetNodes' in found_functions}}cdef void *__cuGraphGetNodes = NULL{{endif}} {{if 'cuGraphGetRootNodes' in found_functions}}cdef void *__cuGraphGetRootNodes = NULL{{endif}} -{{if 'cuGraphGetEdges' in found_functions}}cdef void *__cuGraphGetEdges = NULL{{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}}cdef void *__cuGraphGetEdges_v2 = NULL{{endif}} -{{if 'cuGraphNodeGetDependencies' in found_functions}}cdef void *__cuGraphNodeGetDependencies = NULL{{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}}cdef void *__cuGraphNodeGetDependencies_v2 = NULL{{endif}} -{{if 'cuGraphNodeGetDependentNodes' in found_functions}}cdef void *__cuGraphNodeGetDependentNodes = NULL{{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}cdef void *__cuGraphNodeGetDependentNodes_v2 = NULL{{endif}} -{{if 'cuGraphAddDependencies' in found_functions}}cdef void *__cuGraphAddDependencies = NULL{{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}}cdef void *__cuGraphAddDependencies_v2 = NULL{{endif}} -{{if 'cuGraphRemoveDependencies' in found_functions}}cdef void *__cuGraphRemoveDependencies = NULL{{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}}cdef void *__cuGraphRemoveDependencies_v2 = NULL{{endif}} {{if 'cuGraphDestroyNode' in found_functions}}cdef void *__cuGraphDestroyNode = NULL{{endif}} {{if 'cuGraphInstantiateWithFlags' in found_functions}}cdef void *__cuGraphInstantiateWithFlags = NULL{{endif}} @@ -373,7 +369,6 @@ cdef bint __cuPythonInit = False {{if 'cuUserObjectRelease' in found_functions}}cdef void *__cuUserObjectRelease = NULL{{endif}} {{if 'cuGraphRetainUserObject' in found_functions}}cdef void *__cuGraphRetainUserObject = NULL{{endif}} {{if 'cuGraphReleaseUserObject' in found_functions}}cdef void *__cuGraphReleaseUserObject = NULL{{endif}} -{{if 'cuGraphAddNode' in found_functions}}cdef void *__cuGraphAddNode = NULL{{endif}} {{if 'cuGraphAddNode_v2' in found_functions}}cdef void *__cuGraphAddNode_v2 = NULL{{endif}} {{if 'cuGraphNodeSetParams' in found_functions}}cdef void *__cuGraphNodeSetParams = NULL{{endif}} {{if 'cuGraphExecNodeSetParams' in found_functions}}cdef void *__cuGraphExecNodeSetParams = NULL{{endif}} @@ -430,6 +425,7 @@ cdef bint __cuPythonInit = False {{if 'cuCtxEnablePeerAccess' in found_functions}}cdef void *__cuCtxEnablePeerAccess = NULL{{endif}} {{if 'cuCtxDisablePeerAccess' in found_functions}}cdef void *__cuCtxDisablePeerAccess = NULL{{endif}} {{if 'cuDeviceGetP2PAttribute' in found_functions}}cdef void *__cuDeviceGetP2PAttribute = NULL{{endif}} +{{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}}cdef void *__cuDeviceGetP2PAtomicCapabilities = NULL{{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}}cdef void *__cuGraphicsUnregisterResource = NULL{{endif}} {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}cdef void *__cuGraphicsSubResourceGetMappedArray = NULL{{endif}} {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}cdef void *__cuGraphicsResourceGetMappedMipmappedArray = NULL{{endif}} @@ -455,6 +451,7 @@ cdef bint __cuPythonInit = False {{if 'cuGreenCtxWaitEvent' in found_functions}}cdef void *__cuGreenCtxWaitEvent = NULL{{endif}} {{if 'cuStreamGetGreenCtx' in found_functions}}cdef void *__cuStreamGetGreenCtx = NULL{{endif}} {{if 'cuGreenCtxStreamCreate' in found_functions}}cdef void *__cuGreenCtxStreamCreate = NULL{{endif}} +{{if 'cuGreenCtxGetId' in found_functions}}cdef void *__cuGreenCtxGetId = NULL{{endif}} {{if 'cuLogsRegisterCallback' in found_functions}}cdef void *__cuLogsRegisterCallback = NULL{{endif}} {{if 'cuLogsUnregisterCallback' in found_functions}}cdef void *__cuLogsUnregisterCallback = NULL{{endif}} {{if 'cuLogsCurrent' in found_functions}}cdef void *__cuLogsCurrent = NULL{{endif}} @@ -464,7 +461,6 @@ cdef bint __cuPythonInit = False {{if 'cuCheckpointProcessGetState' in found_functions}}cdef void *__cuCheckpointProcessGetState = NULL{{endif}} {{if 'cuCheckpointProcessLock' in found_functions}}cdef void *__cuCheckpointProcessLock = NULL{{endif}} {{if 'cuCheckpointProcessCheckpoint' in found_functions}}cdef void *__cuCheckpointProcessCheckpoint = NULL{{endif}} -{{if 'cuCheckpointProcessRestore' in found_functions}}cdef void *__cuCheckpointProcessRestore = NULL{{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}}cdef void *__cuCheckpointProcessUnlock = NULL{{endif}} {{if 'cuProfilerStart' in found_functions}}cdef void *__cuProfilerStart = NULL{{endif}} {{if 'cuProfilerStop' in found_functions}}cdef void *__cuProfilerStop = NULL{{endif}} @@ -637,13 +633,13 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemcpy3DPeerAsync cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} global __cuMemsetD8_v2 @@ -713,14 +709,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemAllocFromPoolAsync cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) - {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} global __cuMemPrefetchAsync_v2 cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + cuGetProcAddress('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + cuGetProcAddress('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + cuGetProcAddress('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} {{if 'cuStreamGetPriority' in found_functions}} global __cuStreamGetPriority cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) @@ -769,18 +773,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuStreamIsCapturing cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} global __cuStreamGetCaptureInfo_v3 cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} global __cuStreamUpdateCaptureDependencies_v2 cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) @@ -980,13 +976,13 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemcpy3DPeerAsync cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} global __cuMemsetD8_v2 @@ -1056,14 +1052,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemAllocFromPoolAsync cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} global __cuMemPrefetchAsync_v2 cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + cuGetProcAddress('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + cuGetProcAddress('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + cuGetProcAddress('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuStreamGetPriority' in found_functions}} global __cuStreamGetPriority cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1112,18 +1116,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuStreamIsCapturing cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} global __cuStreamGetCaptureInfo_v3 cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} global __cuStreamUpdateCaptureDependencies_v2 cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1253,10 +1249,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetName cuGetProcAddress('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - global __cuDeviceGetUuid - cuGetProcAddress('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}} global __cuDeviceGetUuid_v2 cuGetProcAddress('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1277,6 +1269,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetAttribute cuGetProcAddress('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + global __cuDeviceGetHostAtomicCapabilities + cuGetProcAddress('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} global __cuDeviceGetNvSciSyncAttributes cuGetProcAddress('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1329,14 +1325,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuDevicePrimaryCtxReset_v2 cuGetProcAddress('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - global __cuCtxCreate_v2 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - global __cuCtxCreate_v3 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v3, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuCtxCreate_v4' in found_functions}} global __cuCtxCreate_v4 cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1365,6 +1353,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuCtxGetDevice cuGetProcAddress('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + global __cuCtxGetDevice_v2 + cuGetProcAddress('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuCtxGetFlags' in found_functions}} global __cuCtxGetFlags cuGetProcAddress('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1381,6 +1373,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuCtxSynchronize cuGetProcAddress('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + global __cuCtxSynchronize_v2 + cuGetProcAddress('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuCtxSetLimit' in found_functions}} global __cuCtxSetLimit cuGetProcAddress('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1797,6 +1793,18 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemPoolDestroy cuGetProcAddress('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + global __cuMemGetDefaultMemPool + cuGetProcAddress('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemGetMemPool' in found_functions}} + global __cuMemGetMemPool + cuGetProcAddress('cuMemGetMemPool', &__cuMemGetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemSetMemPool' in found_functions}} + global __cuMemSetMemPool + cuGetProcAddress('cuMemSetMemPool', &__cuMemSetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}} global __cuMemPoolExportToShareableHandle cuGetProcAddress('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1841,10 +1849,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuPointerGetAttribute cuGetProcAddress('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAdvise' in found_functions}} - global __cuMemAdvise - cuGetProcAddress('cuMemAdvise', &__cuMemAdvise, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuMemAdvise_v2' in found_functions}} global __cuMemAdvise_v2 cuGetProcAddress('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -1897,10 +1901,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuEventDestroy_v2 cuGetProcAddress('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - global __cuEventElapsedTime - cuGetProcAddress('cuEventElapsedTime', &__cuEventElapsedTime, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}} global __cuEventElapsedTime_v2 cuGetProcAddress('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2185,42 +2185,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuGraphGetRootNodes cuGetProcAddress('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - global __cuGraphGetEdges - cuGetProcAddress('cuGraphGetEdges', &__cuGraphGetEdges, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}} global __cuGraphGetEdges_v2 cuGetProcAddress('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - global __cuGraphNodeGetDependencies - cuGetProcAddress('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} global __cuGraphNodeGetDependencies_v2 cuGetProcAddress('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - global __cuGraphNodeGetDependentNodes - cuGetProcAddress('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} global __cuGraphNodeGetDependentNodes_v2 cuGetProcAddress('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - global __cuGraphAddDependencies - cuGetProcAddress('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} global __cuGraphAddDependencies_v2 cuGetProcAddress('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - global __cuGraphRemoveDependencies - cuGetProcAddress('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} global __cuGraphRemoveDependencies_v2 cuGetProcAddress('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2329,10 +2309,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuGraphReleaseUserObject cuGetProcAddress('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - global __cuGraphAddNode - cuGetProcAddress('cuGraphAddNode', &__cuGraphAddNode, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuGraphAddNode_v2' in found_functions}} global __cuGraphAddNode_v2 cuGetProcAddress('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2557,6 +2533,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetP2PAttribute cuGetProcAddress('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + global __cuDeviceGetP2PAtomicCapabilities + cuGetProcAddress('cuDeviceGetP2PAtomicCapabilities', &__cuDeviceGetP2PAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}} global __cuGraphicsUnregisterResource cuGetProcAddress('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2649,6 +2629,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuGreenCtxStreamCreate cuGetProcAddress('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + global __cuGreenCtxGetId + cuGetProcAddress('cuGreenCtxGetId', &__cuGreenCtxGetId, 12090, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuLogsRegisterCallback' in found_functions}} global __cuLogsRegisterCallback cuGetProcAddress('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2685,10 +2669,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuCheckpointProcessCheckpoint cuGetProcAddress('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - cuGetProcAddress('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock cuGetProcAddress('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -2953,17 +2933,17 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} try: - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_ptsz') + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') except: pass {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} try: - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_ptsz') + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') except: pass {{endif}} @@ -3086,17 +3066,31 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} try: - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_ptsz') + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') except: pass {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + try: + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + try: + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') except: pass {{endif}} @@ -3184,13 +3178,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2_ptsz') - except: - pass - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} try: global __cuStreamGetCaptureInfo_v3 @@ -3198,13 +3185,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_ptsz') - except: - pass - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} try: global __cuStreamUpdateCaptureDependencies_v2 @@ -3551,17 +3531,17 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} try: - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync') + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') except: pass {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} try: - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync') + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') except: pass {{endif}} @@ -3684,17 +3664,31 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} try: - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync') + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') except: pass {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') + except: + pass + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + try: + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync') + except: + pass + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + try: + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') except: pass {{endif}} @@ -3782,13 +3776,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2') - except: - pass - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} try: global __cuStreamGetCaptureInfo_v3 @@ -3796,13 +3783,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies') - except: - pass - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} try: global __cuStreamUpdateCaptureDependencies_v2 @@ -4028,13 +4008,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - try: - global __cuDeviceGetUuid - __cuDeviceGetUuid = win32api.GetProcAddress(handle, 'cuDeviceGetUuid') - except: - pass - {{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}} try: global __cuDeviceGetUuid_v2 @@ -4070,6 +4043,13 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + try: + global __cuDeviceGetHostAtomicCapabilities + __cuDeviceGetHostAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') + except: + pass + {{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} try: global __cuDeviceGetNvSciSyncAttributes @@ -4161,20 +4141,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - try: - global __cuCtxCreate_v2 - __cuCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuCtxCreate_v2') - except: - pass - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - try: - global __cuCtxCreate_v3 - __cuCtxCreate_v3 = win32api.GetProcAddress(handle, 'cuCtxCreate_v3') - except: - pass - {{endif}} {{if 'cuCtxCreate_v4' in found_functions}} try: global __cuCtxCreate_v4 @@ -4224,6 +4190,13 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + try: + global __cuCtxGetDevice_v2 + __cuCtxGetDevice_v2 = win32api.GetProcAddress(handle, 'cuCtxGetDevice_v2') + except: + pass + {{endif}} {{if 'cuCtxGetFlags' in found_functions}} try: global __cuCtxGetFlags @@ -4252,6 +4225,13 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + try: + global __cuCtxSynchronize_v2 + __cuCtxSynchronize_v2 = win32api.GetProcAddress(handle, 'cuCtxSynchronize_v2') + except: + pass + {{endif}} {{if 'cuCtxSetLimit' in found_functions}} try: global __cuCtxSetLimit @@ -4980,6 +4960,27 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + try: + global __cuMemGetDefaultMemPool + __cuMemGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuMemGetDefaultMemPool') + except: + pass + {{endif}} + {{if 'cuMemGetMemPool' in found_functions}} + try: + global __cuMemGetMemPool + __cuMemGetMemPool = win32api.GetProcAddress(handle, 'cuMemGetMemPool') + except: + pass + {{endif}} + {{if 'cuMemSetMemPool' in found_functions}} + try: + global __cuMemSetMemPool + __cuMemSetMemPool = win32api.GetProcAddress(handle, 'cuMemSetMemPool') + except: + pass + {{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}} try: global __cuMemPoolExportToShareableHandle @@ -5057,13 +5058,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuMemAdvise' in found_functions}} - try: - global __cuMemAdvise - __cuMemAdvise = win32api.GetProcAddress(handle, 'cuMemAdvise') - except: - pass - {{endif}} {{if 'cuMemAdvise_v2' in found_functions}} try: global __cuMemAdvise_v2 @@ -5155,13 +5149,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - try: - global __cuEventElapsedTime - __cuEventElapsedTime = win32api.GetProcAddress(handle, 'cuEventElapsedTime') - except: - pass - {{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}} try: global __cuEventElapsedTime_v2 @@ -5659,13 +5646,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - try: - global __cuGraphGetEdges - __cuGraphGetEdges = win32api.GetProcAddress(handle, 'cuGraphGetEdges') - except: - pass - {{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}} try: global __cuGraphGetEdges_v2 @@ -5673,13 +5653,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - try: - global __cuGraphNodeGetDependencies - __cuGraphNodeGetDependencies = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies') - except: - pass - {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} try: global __cuGraphNodeGetDependencies_v2 @@ -5687,13 +5660,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - try: - global __cuGraphNodeGetDependentNodes - __cuGraphNodeGetDependentNodes = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes') - except: - pass - {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} try: global __cuGraphNodeGetDependentNodes_v2 @@ -5701,13 +5667,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - try: - global __cuGraphAddDependencies - __cuGraphAddDependencies = win32api.GetProcAddress(handle, 'cuGraphAddDependencies') - except: - pass - {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} try: global __cuGraphAddDependencies_v2 @@ -5715,13 +5674,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - try: - global __cuGraphRemoveDependencies - __cuGraphRemoveDependencies = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies') - except: - pass - {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} try: global __cuGraphRemoveDependencies_v2 @@ -5911,13 +5863,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - try: - global __cuGraphAddNode - __cuGraphAddNode = win32api.GetProcAddress(handle, 'cuGraphAddNode') - except: - pass - {{endif}} {{if 'cuGraphAddNode_v2' in found_functions}} try: global __cuGraphAddNode_v2 @@ -6310,6 +6255,13 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + try: + global __cuDeviceGetP2PAtomicCapabilities + __cuDeviceGetP2PAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') + except: + pass + {{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}} try: global __cuGraphicsUnregisterResource @@ -6471,6 +6423,13 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + try: + global __cuGreenCtxGetId + __cuGreenCtxGetId = win32api.GetProcAddress(handle, 'cuGreenCtxGetId') + except: + pass + {{endif}} {{if 'cuLogsRegisterCallback' in found_functions}} try: global __cuLogsRegisterCallback @@ -6534,13 +6493,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - try: - global __cuCheckpointProcessRestore - __cuCheckpointProcessRestore = win32api.GetProcAddress(handle, 'cuCheckpointProcessRestore') - except: - pass - {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} try: global __cuCheckpointProcessUnlock @@ -6796,13 +6748,13 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemcpy3DPeerAsync __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz') {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_ptsz') + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2_ptsz') {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_ptsz') + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} global __cuMemsetD8_v2 @@ -6872,14 +6824,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemAllocFromPoolAsync __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz') {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_ptsz') - {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} global __cuMemPrefetchAsync_v2 __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz') {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync_ptsz') + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync_ptsz') + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') + {{endif}} {{if 'cuStreamGetPriority' in found_functions}} global __cuStreamGetPriority __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz') @@ -6928,18 +6888,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuStreamIsCapturing __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz') {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2_ptsz') - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} global __cuStreamGetCaptureInfo_v3 __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz') {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_ptsz') - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} global __cuStreamUpdateCaptureDependencies_v2 __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') @@ -7139,13 +7091,13 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemcpy3DPeerAsync __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync') {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync') + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2') {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync') + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2') {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} global __cuMemsetD8_v2 @@ -7215,14 +7167,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemAllocFromPoolAsync __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync') {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync') - {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} global __cuMemPrefetchAsync_v2 __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2') {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync') + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync') + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync') + {{endif}} {{if 'cuStreamGetPriority' in found_functions}} global __cuStreamGetPriority __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority') @@ -7271,18 +7231,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuStreamIsCapturing __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing') {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2') - {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} global __cuStreamGetCaptureInfo_v3 __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3') {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies') - {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} global __cuStreamUpdateCaptureDependencies_v2 __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2') @@ -7412,10 +7364,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetName __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName') {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - global __cuDeviceGetUuid - __cuDeviceGetUuid = dlfcn.dlsym(handle, 'cuDeviceGetUuid') - {{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}} global __cuDeviceGetUuid_v2 __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2') @@ -7436,6 +7384,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetAttribute __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute') {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + global __cuDeviceGetHostAtomicCapabilities + __cuDeviceGetHostAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetHostAtomicCapabilities') + {{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} global __cuDeviceGetNvSciSyncAttributes __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes') @@ -7488,14 +7440,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuDevicePrimaryCtxReset_v2 __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2') {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - global __cuCtxCreate_v2 - __cuCtxCreate_v2 = dlfcn.dlsym(handle, 'cuCtxCreate_v2') - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - global __cuCtxCreate_v3 - __cuCtxCreate_v3 = dlfcn.dlsym(handle, 'cuCtxCreate_v3') - {{endif}} {{if 'cuCtxCreate_v4' in found_functions}} global __cuCtxCreate_v4 __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4') @@ -7524,6 +7468,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuCtxGetDevice __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice') {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + global __cuCtxGetDevice_v2 + __cuCtxGetDevice_v2 = dlfcn.dlsym(handle, 'cuCtxGetDevice_v2') + {{endif}} {{if 'cuCtxGetFlags' in found_functions}} global __cuCtxGetFlags __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags') @@ -7540,6 +7488,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuCtxSynchronize __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize') {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + global __cuCtxSynchronize_v2 + __cuCtxSynchronize_v2 = dlfcn.dlsym(handle, 'cuCtxSynchronize_v2') + {{endif}} {{if 'cuCtxSetLimit' in found_functions}} global __cuCtxSetLimit __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit') @@ -7956,6 +7908,18 @@ cdef int cuPythonInit() except -1 nogil: global __cuMemPoolDestroy __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy') {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + global __cuMemGetDefaultMemPool + __cuMemGetDefaultMemPool = dlfcn.dlsym(handle, 'cuMemGetDefaultMemPool') + {{endif}} + {{if 'cuMemGetMemPool' in found_functions}} + global __cuMemGetMemPool + __cuMemGetMemPool = dlfcn.dlsym(handle, 'cuMemGetMemPool') + {{endif}} + {{if 'cuMemSetMemPool' in found_functions}} + global __cuMemSetMemPool + __cuMemSetMemPool = dlfcn.dlsym(handle, 'cuMemSetMemPool') + {{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}} global __cuMemPoolExportToShareableHandle __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle') @@ -8000,10 +7964,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuPointerGetAttribute __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute') {{endif}} - {{if 'cuMemAdvise' in found_functions}} - global __cuMemAdvise - __cuMemAdvise = dlfcn.dlsym(handle, 'cuMemAdvise') - {{endif}} {{if 'cuMemAdvise_v2' in found_functions}} global __cuMemAdvise_v2 __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2') @@ -8056,10 +8016,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuEventDestroy_v2 __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2') {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - global __cuEventElapsedTime - __cuEventElapsedTime = dlfcn.dlsym(handle, 'cuEventElapsedTime') - {{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}} global __cuEventElapsedTime_v2 __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2') @@ -8344,42 +8300,22 @@ cdef int cuPythonInit() except -1 nogil: global __cuGraphGetRootNodes __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes') {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - global __cuGraphGetEdges - __cuGraphGetEdges = dlfcn.dlsym(handle, 'cuGraphGetEdges') - {{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}} global __cuGraphGetEdges_v2 __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2') {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - global __cuGraphNodeGetDependencies - __cuGraphNodeGetDependencies = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies') - {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} global __cuGraphNodeGetDependencies_v2 __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2') {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - global __cuGraphNodeGetDependentNodes - __cuGraphNodeGetDependentNodes = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes') - {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} global __cuGraphNodeGetDependentNodes_v2 __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2') {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - global __cuGraphAddDependencies - __cuGraphAddDependencies = dlfcn.dlsym(handle, 'cuGraphAddDependencies') - {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} global __cuGraphAddDependencies_v2 __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2') {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - global __cuGraphRemoveDependencies - __cuGraphRemoveDependencies = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies') - {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} global __cuGraphRemoveDependencies_v2 __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2') @@ -8488,10 +8424,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuGraphReleaseUserObject __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject') {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - global __cuGraphAddNode - __cuGraphAddNode = dlfcn.dlsym(handle, 'cuGraphAddNode') - {{endif}} {{if 'cuGraphAddNode_v2' in found_functions}} global __cuGraphAddNode_v2 __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2') @@ -8716,6 +8648,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuDeviceGetP2PAttribute __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute') {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + global __cuDeviceGetP2PAtomicCapabilities + __cuDeviceGetP2PAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetP2PAtomicCapabilities') + {{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}} global __cuGraphicsUnregisterResource __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource') @@ -8808,6 +8744,10 @@ cdef int cuPythonInit() except -1 nogil: global __cuGreenCtxStreamCreate __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate') {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + global __cuGreenCtxGetId + __cuGreenCtxGetId = dlfcn.dlsym(handle, 'cuGreenCtxGetId') + {{endif}} {{if 'cuLogsRegisterCallback' in found_functions}} global __cuLogsRegisterCallback __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback') @@ -8844,10 +8784,6 @@ cdef int cuPythonInit() except -1 nogil: global __cuCheckpointProcessCheckpoint __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore') - {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') @@ -9022,18 +8958,6 @@ cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUD return err {{endif}} -{{if 'cuDeviceGetUuid' in found_functions}} - -cdef CUresult _cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetUuid - cuPythonInit() - if __cuDeviceGetUuid == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetUuid" not found') - err = ( __cuDeviceGetUuid)(uuid, dev) - return err -{{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -9094,6 +9018,18 @@ cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice return err {{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: + global __cuDeviceGetHostAtomicCapabilities + cuPythonInit() + if __cuDeviceGetHostAtomicCapabilities == NULL: + with gil: + raise RuntimeError('Function "cuDeviceGetHostAtomicCapabilities" not found') + err = ( __cuDeviceGetHostAtomicCapabilities)(capabilities, operations, count, dev) + return err +{{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -9250,30 +9186,6 @@ cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_F return err {{endif}} -{{if 'cuCtxCreate_v2' in found_functions}} - -cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxCreate_v2 - cuPythonInit() - if __cuCtxCreate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuCtxCreate_v2" not found') - err = ( __cuCtxCreate_v2)(pctx, flags, dev) - return err -{{endif}} - -{{if 'cuCtxCreate_v3' in found_functions}} - -cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxCreate_v3 - cuPythonInit() - if __cuCtxCreate_v3 == NULL: - with gil: - raise RuntimeError('Function "cuCtxCreate_v3" not found') - err = ( __cuCtxCreate_v3)(pctx, paramsArray, numParams, flags, dev) - return err -{{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -9358,6 +9270,18 @@ cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nog return err {{endif}} +{{if 'cuCtxGetDevice_v2' in found_functions}} + +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevice_v2 + cuPythonInit() + if __cuCtxGetDevice_v2 == NULL: + with gil: + raise RuntimeError('Function "cuCtxGetDevice_v2" not found') + err = ( __cuCtxGetDevice_v2)(device, ctx) + return err +{{endif}} + {{if 'cuCtxGetFlags' in found_functions}} cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -9406,6 +9330,18 @@ cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: return err {{endif}} +{{if 'cuCtxSynchronize_v2' in found_functions}} + +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSynchronize_v2 + cuPythonInit() + if __cuCtxSynchronize_v2 == NULL: + with gil: + raise RuntimeError('Function "cuCtxSynchronize_v2" not found') + err = ( __cuCtxSynchronize_v2)(ctx) + return err +{{endif}} + {{if 'cuCtxSetLimit' in found_functions}} cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -10534,27 +10470,27 @@ cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hSt return err {{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}} +{{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, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyBatchAsync +cdef CUresult _cuMemcpyBatchAsync_v2(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: + global __cuMemcpyBatchAsync_v2 cuPythonInit() - if __cuMemcpyBatchAsync == NULL: + if __cuMemcpyBatchAsync_v2 == NULL: with gil: - raise RuntimeError('Function "cuMemcpyBatchAsync" not found') - err = ( __cuMemcpyBatchAsync)(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream) + raise RuntimeError('Function "cuMemcpyBatchAsync_v2" not found') + err = ( __cuMemcpyBatchAsync_v2)(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) return err {{endif}} -{{if 'cuMemcpy3DBatchAsync' in found_functions}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} -cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3DBatchAsync +cdef CUresult _cuMemcpy3DBatchAsync_v2(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DBatchAsync_v2 cuPythonInit() - if __cuMemcpy3DBatchAsync == NULL: + if __cuMemcpy3DBatchAsync_v2 == NULL: with gil: - raise RuntimeError('Function "cuMemcpy3DBatchAsync" not found') - err = ( __cuMemcpy3DBatchAsync)(numOps, opList, failIdx, flags, hStream) + raise RuntimeError('Function "cuMemcpy3DBatchAsync_v2" not found') + err = ( __cuMemcpy3DBatchAsync_v2)(numOps, opList, flags, hStream) return err {{endif}} @@ -11158,6 +11094,42 @@ cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND return err {{endif}} +{{if 'cuMemGetDefaultMemPool' in found_functions}} + +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetDefaultMemPool + cuPythonInit() + if __cuMemGetDefaultMemPool == NULL: + with gil: + raise RuntimeError('Function "cuMemGetDefaultMemPool" not found') + err = ( __cuMemGetDefaultMemPool)(pool_out, location, typename) + return err +{{endif}} + +{{if 'cuMemGetMemPool' in found_functions}} + +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetMemPool + cuPythonInit() + if __cuMemGetMemPool == NULL: + with gil: + raise RuntimeError('Function "cuMemGetMemPool" not found') + err = ( __cuMemGetMemPool)(pool, location, typename) + return err +{{endif}} + +{{if 'cuMemSetMemPool' in found_functions}} + +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemSetMemPool + cuPythonInit() + if __cuMemSetMemPool == NULL: + with gil: + raise RuntimeError('Function "cuMemSetMemPool" not found') + err = ( __cuMemSetMemPool)(location, typename, pool) + return err +{{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -11302,18 +11274,6 @@ cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, return err {{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}} - -cdef CUresult _cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPrefetchAsync - cuPythonInit() - if __cuMemPrefetchAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemPrefetchAsync" not found') - err = ( __cuMemPrefetchAsync)(devPtr, count, dstDevice, hStream) - return err -{{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -11326,18 +11286,6 @@ cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLoca return err {{endif}} -{{if 'cuMemAdvise' in found_functions}} - -cdef CUresult _cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAdvise - cuPythonInit() - if __cuMemAdvise == NULL: - with gil: - raise RuntimeError('Function "cuMemAdvise" not found') - err = ( __cuMemAdvise)(devPtr, count, advice, device) - return err -{{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -11350,6 +11298,42 @@ cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise adv return err {{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: + global __cuMemPrefetchBatchAsync + cuPythonInit() + if __cuMemPrefetchBatchAsync == NULL: + with gil: + raise RuntimeError('Function "cuMemPrefetchBatchAsync" not found') + err = ( __cuMemPrefetchBatchAsync)(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + return err +{{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: + global __cuMemDiscardBatchAsync + cuPythonInit() + if __cuMemDiscardBatchAsync == NULL: + with gil: + raise RuntimeError('Function "cuMemDiscardBatchAsync" not found') + err = ( __cuMemDiscardBatchAsync)(dptrs, sizes, count, flags, hStream) + return err +{{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: + global __cuMemDiscardAndPrefetchBatchAsync + cuPythonInit() + if __cuMemDiscardAndPrefetchBatchAsync == NULL: + with gil: + raise RuntimeError('Function "cuMemDiscardAndPrefetchBatchAsync" not found') + err = ( __cuMemDiscardAndPrefetchBatchAsync)(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + return err +{{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: @@ -11578,18 +11562,6 @@ cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* capt return err {{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - -cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetCaptureInfo_v2 - cuPythonInit() - if __cuStreamGetCaptureInfo_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetCaptureInfo_v2" not found') - err = ( __cuStreamGetCaptureInfo_v2)(hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) - return err -{{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -11602,18 +11574,6 @@ cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus return err {{endif}} -{{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - -cdef CUresult _cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamUpdateCaptureDependencies - cuPythonInit() - if __cuStreamUpdateCaptureDependencies == NULL: - with gil: - raise RuntimeError('Function "cuStreamUpdateCaptureDependencies" not found') - err = ( __cuStreamUpdateCaptureDependencies)(hStream, dependencies, numDependencies, flags) - return err -{{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -11782,18 +11742,6 @@ cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND no return err {{endif}} -{{if 'cuEventElapsedTime' in found_functions}} - -cdef CUresult _cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventElapsedTime - cuPythonInit() - if __cuEventElapsedTime == NULL: - with gil: - raise RuntimeError('Function "cuEventElapsedTime" not found') - err = ( __cuEventElapsedTime)(pMilliseconds, hStart, hEnd) - return err -{{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -12778,18 +12726,6 @@ cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_ return err {{endif}} -{{if 'cuGraphGetEdges' in found_functions}} - -cdef CUresult _cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphGetEdges - cuPythonInit() - if __cuGraphGetEdges == NULL: - with gil: - raise RuntimeError('Function "cuGraphGetEdges" not found') - err = ( __cuGraphGetEdges)(hGraph, from_, to, numEdges) - return err -{{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -12802,18 +12738,6 @@ cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNod return err {{endif}} -{{if 'cuGraphNodeGetDependencies' in found_functions}} - -cdef CUresult _cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetDependencies - cuPythonInit() - if __cuGraphNodeGetDependencies == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetDependencies" not found') - err = ( __cuGraphNodeGetDependencies)(hNode, dependencies, numDependencies) - return err -{{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -12826,18 +12750,6 @@ cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dep return err {{endif}} -{{if 'cuGraphNodeGetDependentNodes' in found_functions}} - -cdef CUresult _cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetDependentNodes - cuPythonInit() - if __cuGraphNodeGetDependentNodes == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetDependentNodes" not found') - err = ( __cuGraphNodeGetDependentNodes)(hNode, dependentNodes, numDependentNodes) - return err -{{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -12850,18 +12762,6 @@ cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* d return err {{endif}} -{{if 'cuGraphAddDependencies' in found_functions}} - -cdef CUresult _cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddDependencies - cuPythonInit() - if __cuGraphAddDependencies == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddDependencies" not found') - err = ( __cuGraphAddDependencies)(hGraph, from_, to, numDependencies) - return err -{{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -12874,18 +12774,6 @@ cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from return err {{endif}} -{{if 'cuGraphRemoveDependencies' in found_functions}} - -cdef CUresult _cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphRemoveDependencies - cuPythonInit() - if __cuGraphRemoveDependencies == NULL: - with gil: - raise RuntimeError('Function "cuGraphRemoveDependencies" not found') - err = ( __cuGraphRemoveDependencies)(hGraph, from_, to, numDependencies) - return err -{{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -13246,18 +13134,6 @@ cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsi return err {{endif}} -{{if 'cuGraphAddNode' in found_functions}} - -cdef CUresult _cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddNode - cuPythonInit() - if __cuGraphAddNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddNode" not found') - err = ( __cuGraphAddNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} cdef CUresult _cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -13930,6 +13806,18 @@ cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, return err {{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: + global __cuDeviceGetP2PAtomicCapabilities + cuPythonInit() + if __cuDeviceGetP2PAtomicCapabilities == NULL: + with gil: + raise RuntimeError('Function "cuDeviceGetP2PAtomicCapabilities" not found') + err = ( __cuDeviceGetP2PAtomicCapabilities)(capabilities, operations, count, srcDevice, dstDevice) + return err +{{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -14230,6 +14118,18 @@ cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, u return err {{endif}} +{{if 'cuGreenCtxGetId' in found_functions}} + +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxGetId + cuPythonInit() + if __cuGreenCtxGetId == NULL: + with gil: + raise RuntimeError('Function "cuGreenCtxGetId" not found') + err = ( __cuGreenCtxGetId)(greenCtx, greenCtxId) + return err +{{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -14338,18 +14238,6 @@ cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs return err {{endif}} -{{if 'cuCheckpointProcessRestore' in found_functions}} - -cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCheckpointProcessRestore - cuPythonInit() - if __cuCheckpointProcessRestore == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessRestore" not found') - err = ( __cuCheckpointProcessRestore)(pid, args) - return err -{{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -14673,13 +14561,6 @@ cpdef dict _inspect_function_pointers(): data["__cuDeviceGetName"] = 0 {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - global __cuDeviceGetUuid - data["__cuDeviceGetUuid"] = __cuDeviceGetUuid - {{else}} - data["__cuDeviceGetUuid"] = 0 - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} global __cuDeviceGetUuid_v2 data["__cuDeviceGetUuid_v2"] = __cuDeviceGetUuid_v2 @@ -14715,6 +14596,13 @@ cpdef dict _inspect_function_pointers(): data["__cuDeviceGetAttribute"] = 0 {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + global __cuDeviceGetHostAtomicCapabilities + data["__cuDeviceGetHostAtomicCapabilities"] = __cuDeviceGetHostAtomicCapabilities + {{else}} + data["__cuDeviceGetHostAtomicCapabilities"] = 0 + {{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} global __cuDeviceGetNvSciSyncAttributes data["__cuDeviceGetNvSciSyncAttributes"] = __cuDeviceGetNvSciSyncAttributes @@ -14806,20 +14694,6 @@ cpdef dict _inspect_function_pointers(): data["__cuDevicePrimaryCtxReset_v2"] = 0 {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - global __cuCtxCreate_v2 - data["__cuCtxCreate_v2"] = __cuCtxCreate_v2 - {{else}} - data["__cuCtxCreate_v2"] = 0 - {{endif}} - - {{if 'cuCtxCreate_v3' in found_functions}} - global __cuCtxCreate_v3 - data["__cuCtxCreate_v3"] = __cuCtxCreate_v3 - {{else}} - data["__cuCtxCreate_v3"] = 0 - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} global __cuCtxCreate_v4 data["__cuCtxCreate_v4"] = __cuCtxCreate_v4 @@ -14869,6 +14743,13 @@ cpdef dict _inspect_function_pointers(): data["__cuCtxGetDevice"] = 0 {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + global __cuCtxGetDevice_v2 + data["__cuCtxGetDevice_v2"] = __cuCtxGetDevice_v2 + {{else}} + data["__cuCtxGetDevice_v2"] = 0 + {{endif}} + {{if 'cuCtxGetFlags' in found_functions}} global __cuCtxGetFlags data["__cuCtxGetFlags"] = __cuCtxGetFlags @@ -14897,6 +14778,13 @@ cpdef dict _inspect_function_pointers(): data["__cuCtxSynchronize"] = 0 {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + global __cuCtxSynchronize_v2 + data["__cuCtxSynchronize_v2"] = __cuCtxSynchronize_v2 + {{else}} + data["__cuCtxSynchronize_v2"] = 0 + {{endif}} + {{if 'cuCtxSetLimit' in found_functions}} global __cuCtxSetLimit data["__cuCtxSetLimit"] = __cuCtxSetLimit @@ -15555,18 +15443,18 @@ cpdef dict _inspect_function_pointers(): data["__cuMemcpy3DPeerAsync"] = 0 {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - data["__cuMemcpyBatchAsync"] = __cuMemcpyBatchAsync + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + data["__cuMemcpyBatchAsync_v2"] = __cuMemcpyBatchAsync_v2 {{else}} - data["__cuMemcpyBatchAsync"] = 0 + data["__cuMemcpyBatchAsync_v2"] = 0 {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - data["__cuMemcpy3DBatchAsync"] = __cuMemcpy3DBatchAsync + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + data["__cuMemcpy3DBatchAsync_v2"] = __cuMemcpy3DBatchAsync_v2 {{else}} - data["__cuMemcpy3DBatchAsync"] = 0 + data["__cuMemcpy3DBatchAsync_v2"] = 0 {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} @@ -15919,6 +15807,27 @@ cpdef dict _inspect_function_pointers(): data["__cuMemPoolDestroy"] = 0 {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + global __cuMemGetDefaultMemPool + data["__cuMemGetDefaultMemPool"] = __cuMemGetDefaultMemPool + {{else}} + data["__cuMemGetDefaultMemPool"] = 0 + {{endif}} + + {{if 'cuMemGetMemPool' in found_functions}} + global __cuMemGetMemPool + data["__cuMemGetMemPool"] = __cuMemGetMemPool + {{else}} + data["__cuMemGetMemPool"] = 0 + {{endif}} + + {{if 'cuMemSetMemPool' in found_functions}} + global __cuMemSetMemPool + data["__cuMemSetMemPool"] = __cuMemSetMemPool + {{else}} + data["__cuMemSetMemPool"] = 0 + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} global __cuMemAllocFromPoolAsync data["__cuMemAllocFromPoolAsync"] = __cuMemAllocFromPoolAsync @@ -16003,13 +15912,6 @@ cpdef dict _inspect_function_pointers(): data["__cuPointerGetAttribute"] = 0 {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - data["__cuMemPrefetchAsync"] = __cuMemPrefetchAsync - {{else}} - data["__cuMemPrefetchAsync"] = 0 - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} global __cuMemPrefetchAsync_v2 data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 @@ -16017,13 +15919,6 @@ cpdef dict _inspect_function_pointers(): data["__cuMemPrefetchAsync_v2"] = 0 {{endif}} - {{if 'cuMemAdvise' in found_functions}} - global __cuMemAdvise - data["__cuMemAdvise"] = __cuMemAdvise - {{else}} - data["__cuMemAdvise"] = 0 - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} global __cuMemAdvise_v2 data["__cuMemAdvise_v2"] = __cuMemAdvise_v2 @@ -16031,6 +15926,27 @@ cpdef dict _inspect_function_pointers(): data["__cuMemAdvise_v2"] = 0 {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + data["__cuMemPrefetchBatchAsync"] = __cuMemPrefetchBatchAsync + {{else}} + data["__cuMemPrefetchBatchAsync"] = 0 + {{endif}} + + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + data["__cuMemDiscardBatchAsync"] = __cuMemDiscardBatchAsync + {{else}} + data["__cuMemDiscardBatchAsync"] = 0 + {{endif}} + + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + data["__cuMemDiscardAndPrefetchBatchAsync"] = __cuMemDiscardAndPrefetchBatchAsync + {{else}} + data["__cuMemDiscardAndPrefetchBatchAsync"] = 0 + {{endif}} + {{if 'cuMemRangeGetAttribute' in found_functions}} global __cuMemRangeGetAttribute data["__cuMemRangeGetAttribute"] = __cuMemRangeGetAttribute @@ -16164,13 +16080,6 @@ cpdef dict _inspect_function_pointers(): data["__cuStreamIsCapturing"] = 0 {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - data["__cuStreamGetCaptureInfo_v2"] = __cuStreamGetCaptureInfo_v2 - {{else}} - data["__cuStreamGetCaptureInfo_v2"] = 0 - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} global __cuStreamGetCaptureInfo_v3 data["__cuStreamGetCaptureInfo_v3"] = __cuStreamGetCaptureInfo_v3 @@ -16178,13 +16087,6 @@ cpdef dict _inspect_function_pointers(): data["__cuStreamGetCaptureInfo_v3"] = 0 {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - data["__cuStreamUpdateCaptureDependencies"] = __cuStreamUpdateCaptureDependencies - {{else}} - data["__cuStreamUpdateCaptureDependencies"] = 0 - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} global __cuStreamUpdateCaptureDependencies_v2 data["__cuStreamUpdateCaptureDependencies_v2"] = __cuStreamUpdateCaptureDependencies_v2 @@ -16283,13 +16185,6 @@ cpdef dict _inspect_function_pointers(): data["__cuEventDestroy_v2"] = 0 {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - global __cuEventElapsedTime - data["__cuEventElapsedTime"] = __cuEventElapsedTime - {{else}} - data["__cuEventElapsedTime"] = 0 - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} global __cuEventElapsedTime_v2 data["__cuEventElapsedTime_v2"] = __cuEventElapsedTime_v2 @@ -16864,13 +16759,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphGetRootNodes"] = 0 {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - global __cuGraphGetEdges - data["__cuGraphGetEdges"] = __cuGraphGetEdges - {{else}} - data["__cuGraphGetEdges"] = 0 - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} global __cuGraphGetEdges_v2 data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 @@ -16878,13 +16766,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphGetEdges_v2"] = 0 {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - global __cuGraphNodeGetDependencies - data["__cuGraphNodeGetDependencies"] = __cuGraphNodeGetDependencies - {{else}} - data["__cuGraphNodeGetDependencies"] = 0 - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} global __cuGraphNodeGetDependencies_v2 data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 @@ -16892,13 +16773,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphNodeGetDependencies_v2"] = 0 {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - global __cuGraphNodeGetDependentNodes - data["__cuGraphNodeGetDependentNodes"] = __cuGraphNodeGetDependentNodes - {{else}} - data["__cuGraphNodeGetDependentNodes"] = 0 - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} global __cuGraphNodeGetDependentNodes_v2 data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 @@ -16906,13 +16780,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphNodeGetDependentNodes_v2"] = 0 {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - global __cuGraphAddDependencies - data["__cuGraphAddDependencies"] = __cuGraphAddDependencies - {{else}} - data["__cuGraphAddDependencies"] = 0 - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} global __cuGraphAddDependencies_v2 data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 @@ -16920,13 +16787,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphAddDependencies_v2"] = 0 {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - global __cuGraphRemoveDependencies - data["__cuGraphRemoveDependencies"] = __cuGraphRemoveDependencies - {{else}} - data["__cuGraphRemoveDependencies"] = 0 - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} global __cuGraphRemoveDependencies_v2 data["__cuGraphRemoveDependencies_v2"] = __cuGraphRemoveDependencies_v2 @@ -17137,13 +16997,6 @@ cpdef dict _inspect_function_pointers(): data["__cuGraphReleaseUserObject"] = 0 {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - global __cuGraphAddNode - data["__cuGraphAddNode"] = __cuGraphAddNode - {{else}} - data["__cuGraphAddNode"] = 0 - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} global __cuGraphAddNode_v2 data["__cuGraphAddNode_v2"] = __cuGraphAddNode_v2 @@ -17536,6 +17389,13 @@ cpdef dict _inspect_function_pointers(): data["__cuDeviceGetP2PAttribute"] = 0 {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + global __cuDeviceGetP2PAtomicCapabilities + data["__cuDeviceGetP2PAtomicCapabilities"] = __cuDeviceGetP2PAtomicCapabilities + {{else}} + data["__cuDeviceGetP2PAtomicCapabilities"] = 0 + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} global __cuGraphicsUnregisterResource data["__cuGraphicsUnregisterResource"] = __cuGraphicsUnregisterResource @@ -17711,6 +17571,13 @@ cpdef dict _inspect_function_pointers(): data["__cuGreenCtxStreamCreate"] = 0 {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + global __cuGreenCtxGetId + data["__cuGreenCtxGetId"] = __cuGreenCtxGetId + {{else}} + data["__cuGreenCtxGetId"] = 0 + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} global __cuLogsRegisterCallback data["__cuLogsRegisterCallback"] = __cuLogsRegisterCallback @@ -17774,13 +17641,6 @@ cpdef dict _inspect_function_pointers(): data["__cuCheckpointProcessCheckpoint"] = 0 {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - data["__cuCheckpointProcessRestore"] = __cuCheckpointProcessRestore - {{else}} - data["__cuCheckpointProcessRestore"] = 0 - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock data["__cuCheckpointProcessUnlock"] = __cuCheckpointProcessUnlock diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in index 0c06279cc..148530a86 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from cuda.bindings.cynvrtc cimport * {{if 'nvrtcGetErrorString' in found_functions}} @@ -59,16 +59,6 @@ cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) exc cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil {{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetNVVMSize(nvrtcProgram prog, size_t* nvvmSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetNVVM' in found_functions}} - -cdef nvrtcResult _nvrtcGetNVVM(nvrtcProgram prog, char* nvvm) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index c498b0f67..dc73708ef 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os import win32api @@ -24,8 +24,6 @@ cdef bint __cuPythonInit = False {{if 'nvrtcGetPTX' in found_functions}}cdef void *__nvrtcGetPTX = NULL{{endif}} {{if 'nvrtcGetCUBINSize' in found_functions}}cdef void *__nvrtcGetCUBINSize = NULL{{endif}} {{if 'nvrtcGetCUBIN' in found_functions}}cdef void *__nvrtcGetCUBIN = NULL{{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}}cdef void *__nvrtcGetNVVMSize = NULL{{endif}} -{{if 'nvrtcGetNVVM' in found_functions}}cdef void *__nvrtcGetNVVM = NULL{{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}}cdef void *__nvrtcGetLTOIRSize = NULL{{endif}} {{if 'nvrtcGetLTOIR' in found_functions}}cdef void *__nvrtcGetLTOIR = NULL{{endif}} {{if 'nvrtcGetOptiXIRSize' in found_functions}}cdef void *__nvrtcGetOptiXIRSize = NULL{{endif}} @@ -136,20 +134,6 @@ cdef int cuPythonInit() except -1 nogil: except: pass {{endif}} - {{if 'nvrtcGetNVVMSize' in found_functions}} - try: - global __nvrtcGetNVVMSize - __nvrtcGetNVVMSize = win32api.GetProcAddress(handle, 'nvrtcGetNVVMSize') - except: - pass - {{endif}} - {{if 'nvrtcGetNVVM' in found_functions}} - try: - global __nvrtcGetNVVM - __nvrtcGetNVVM = win32api.GetProcAddress(handle, 'nvrtcGetNVVM') - except: - pass - {{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}} try: global __nvrtcGetLTOIRSize @@ -287,14 +271,6 @@ cdef int cuPythonInit() except -1 nogil: global __nvrtcGetCUBIN __nvrtcGetCUBIN = dlfcn.dlsym(handle, 'nvrtcGetCUBIN') {{endif}} - {{if 'nvrtcGetNVVMSize' in found_functions}} - global __nvrtcGetNVVMSize - __nvrtcGetNVVMSize = dlfcn.dlsym(handle, 'nvrtcGetNVVMSize') - {{endif}} - {{if 'nvrtcGetNVVM' in found_functions}} - global __nvrtcGetNVVM - __nvrtcGetNVVM = dlfcn.dlsym(handle, 'nvrtcGetNVVM') - {{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}} global __nvrtcGetLTOIRSize __nvrtcGetLTOIRSize = dlfcn.dlsym(handle, 'nvrtcGetLTOIRSize') @@ -482,30 +458,6 @@ cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ER return err {{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetNVVMSize(nvrtcProgram prog, size_t* nvvmSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetNVVMSize - cuPythonInit() - if __nvrtcGetNVVMSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetNVVMSize" not found') - err = ( __nvrtcGetNVVMSize)(prog, nvvmSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetNVVM' in found_functions}} - -cdef nvrtcResult _nvrtcGetNVVM(nvrtcProgram prog, char* nvvm) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetNVVM - cuPythonInit() - if __nvrtcGetNVVM == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetNVVM" not found') - err = ( __nvrtcGetNVVM)(prog, nvvm) - return err -{{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: @@ -749,20 +701,6 @@ cpdef dict _inspect_function_pointers(): data["__nvrtcGetCUBIN"] = 0 {{endif}} - {{if 'nvrtcGetNVVMSize' in found_functions}} - global __nvrtcGetNVVMSize - data["__nvrtcGetNVVMSize"] = __nvrtcGetNVVMSize - {{else}} - data["__nvrtcGetNVVMSize"] = 0 - {{endif}} - - {{if 'nvrtcGetNVVM' in found_functions}} - global __nvrtcGetNVVM - data["__nvrtcGetNVVM"] = __nvrtcGetNVVM - {{else}} - data["__nvrtcGetNVVM"] = 0 - {{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} global __nvrtcGetLTOIRSize data["__nvrtcGetLTOIRSize"] = __nvrtcGetLTOIRSize diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in index cb08830d7..895e6eff7 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. include "../cyruntime_types.pxi" {{if 'cudaDeviceReset' in found_functions}} @@ -129,9 +129,9 @@ cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} -cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -139,6 +139,11 @@ cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) e cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil @@ -164,6 +169,11 @@ cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil @@ -304,24 +314,14 @@ cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -364,11 +364,6 @@ cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequi cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil @@ -394,14 +389,14 @@ cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -636,12 +631,12 @@ cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -691,22 +686,27 @@ cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cud {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -789,6 +789,21 @@ cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolPro cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil @@ -929,6 +944,31 @@ cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCall cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil @@ -951,7 +991,7 @@ cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaK {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1156,52 +1196,27 @@ cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoo {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1346,12 +1361,7 @@ cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index 92c0ceb15..a89dae196 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. include "../cyruntime_functions.pxi" import os @@ -245,13 +245,13 @@ cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNe return cudaGetDeviceCount(count) {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} -cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGetDeviceProperties_v2(prop, device) - return cudaGetDeviceProperties_v2(prop, device) + return ptds._cudaGetDeviceProperties(prop, device) + return cudaGetDeviceProperties(prop, device) {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -263,6 +263,15 @@ cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int de return cudaDeviceGetAttribute(value, attr, device) {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetHostAtomicCapabilities(capabilities, operations, count, device) + return cudaDeviceGetHostAtomicCapabilities(capabilities, operations, count, device) +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -308,6 +317,15 @@ cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) + return cudaDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -560,40 +578,22 @@ cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureSt return cudaStreamIsCapturing(stream, pCaptureStatus) {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) - return cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) - return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + return ptds._cudaStreamGetCaptureInfo(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + return cudaStreamGetCaptureInfo(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) - return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) - return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) + return ptds._cudaStreamUpdateCaptureDependencies(stream, dependencies, dependencyData, numDependencies, flags) + return cudaStreamUpdateCaptureDependencies(stream, dependencies, dependencyData, numDependencies, flags) {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -668,15 +668,6 @@ cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t return cudaEventElapsedTime(ms, start, end) {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaEventElapsedTime_v2(ms, start, end) - return cudaEventElapsedTime_v2(ms, start, end) -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -722,22 +713,22 @@ cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_ou return cudaImportExternalSemaphore(extSem_out, semHandleDesc) {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) - return cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return ptds._cudaSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) + return cudaSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) - return cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return ptds._cudaWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) + return cudaWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -1156,20 +1147,20 @@ cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) - return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) + return ptds._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, stream) + return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, stream) {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) - return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) + return ptds._cudaMemcpy3DBatchAsync(numOps, opList, flags, stream) + return cudaMemcpy3DBatchAsync(numOps, opList, flags, stream) {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -1255,38 +1246,47 @@ cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cud {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) - return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) + return ptds._cudaMemPrefetchAsync(devPtr, count, location, flags, stream) + return cudaMemPrefetchAsync(devPtr, count, location, flags, stream) {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) - return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) + return ptds._cudaMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) + return cudaMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemAdvise(devPtr, count, advice, device) - return cudaMemAdvise(devPtr, count, advice, device) + return ptds._cudaMemDiscardBatchAsync(dptrs, sizes, count, flags, stream) + return cudaMemDiscardBatchAsync(dptrs, sizes, count, flags, stream) {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaMemAdvise_v2(devPtr, count, advice, location) - return cudaMemAdvise_v2(devPtr, count, advice, location) + return ptds._cudaMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) + return cudaMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemAdvise(devPtr, count, advice, location) + return cudaMemAdvise(devPtr, count, advice, location) {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -1433,6 +1433,33 @@ cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCal return cudaMemPoolDestroy(memPool) {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemGetDefaultMemPool(memPool, location, typename) + return cudaMemGetDefaultMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemGetMemPool(memPool, location, typename) + return cudaMemGetMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemSetMemPool(location, typename, memPool) + return cudaMemSetMemPool(location, typename, memPool) +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1685,6 +1712,51 @@ cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCa return cudaRuntimeGetVersion(runtimeVersion) {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLogsRegisterCallback(callbackFunc, userData, callback_out) + return cudaLogsRegisterCallback(callbackFunc, userData, callback_out) +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLogsUnregisterCallback(callback) + return cudaLogsUnregisterCallback(callback) +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLogsCurrent(iterator_out, flags) + return cudaLogsCurrent(iterator_out, flags) +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLogsDumpToFile(iterator, pathToFile, flags) + return cudaLogsDumpToFile(iterator, pathToFile, flags) +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLogsDumpToMemory(iterator, buffer, size, flags) + return cudaLogsDumpToMemory(iterator, buffer, size, flags) +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1723,11 +1795,11 @@ cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaK {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphKernelNodeCopyAttributes(hSrc, hDst) - return cudaGraphKernelNodeCopyAttributes(hSrc, hDst) + return ptds._cudaGraphKernelNodeCopyAttributes(hDst, hSrc) + return cudaGraphKernelNodeCopyAttributes(hDst, hSrc) {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -2092,92 +2164,47 @@ cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoo {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphGetEdges(graph, from_, to, numEdges) - return cudaGraphGetEdges(graph, from_, to, numEdges) -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) - return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) + return ptds._cudaGraphGetEdges(graph, from_, to, edgeData, numEdges) + return cudaGraphGetEdges(graph, from_, to, edgeData, numEdges) {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) - return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) - return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) + return ptds._cudaGraphNodeGetDependencies(node, pDependencies, edgeData, pNumDependencies) + return cudaGraphNodeGetDependencies(node, pDependencies, edgeData, pNumDependencies) {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) - return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) - return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) + return ptds._cudaGraphNodeGetDependentNodes(node, pDependentNodes, edgeData, pNumDependentNodes) + return cudaGraphNodeGetDependentNodes(node, pDependentNodes, edgeData, pNumDependentNodes) {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphAddDependencies(graph, from_, to, numDependencies) - return cudaGraphAddDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) - return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) + return ptds._cudaGraphAddDependencies(graph, from_, to, edgeData, numDependencies) + return cudaGraphAddDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphRemoveDependencies(graph, from_, to, numDependencies) - return cudaGraphRemoveDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) - return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) + return ptds._cudaGraphRemoveDependencies(graph, from_, to, edgeData, numDependencies) + return cudaGraphRemoveDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -2434,20 +2461,11 @@ cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef bint usePTDS = cudaPythonInit() - if usePTDS: - return ptds._cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) - return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: cdef bint usePTDS = cudaPythonInit() if usePTDS: - return ptds._cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) - return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) + return ptds._cudaGraphAddNode(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) + return cudaGraphAddNode(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in index 49ff49454..9c1769482 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -134,9 +134,9 @@ cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} -cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -144,6 +144,11 @@ cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) e cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil @@ -169,6 +174,11 @@ cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil @@ -309,24 +319,14 @@ cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -369,11 +369,6 @@ cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequi cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil @@ -399,14 +394,14 @@ cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -641,12 +636,12 @@ cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -696,22 +691,27 @@ cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cud {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -794,6 +794,21 @@ cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolPro cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil @@ -934,6 +949,31 @@ cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCall cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil @@ -956,7 +996,7 @@ cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaK {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1161,52 +1201,27 @@ cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoo {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1351,12 +1366,7 @@ cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in index 44c6d24c4..51271166c 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -161,10 +161,10 @@ cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNe return cudaGetDeviceCount(count) {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} -cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGetDeviceProperties_v2(prop, device) +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDeviceProperties(prop, device) {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -173,6 +173,12 @@ cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int de return cudaDeviceGetAttribute(value, attr, device) {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetHostAtomicCapabilities(capabilities, operations, count, device) +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -203,6 +209,12 @@ cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -371,28 +383,16 @@ cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureSt return cudaStreamIsCapturing(stream, pCaptureStatus) {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaStreamGetCaptureInfo_v2_ptsz(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetCaptureInfo(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamUpdateCaptureDependencies(stream, dependencies, dependencyData, numDependencies, flags) {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -443,12 +443,6 @@ cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t return cudaEventElapsedTime(ms, start, end) {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaEventElapsedTime_v2(ms, start, end) -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -479,16 +473,16 @@ cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_ou return cudaImportExternalSemaphore(extSem_out, semHandleDesc) {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaSignalExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream) +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} -cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaWaitExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream) +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -769,14 +763,14 @@ cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, stream) {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3DBatchAsync(numOps, opList, flags, stream) {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -835,26 +829,32 @@ cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cud {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPrefetchAsync(devPtr, count, location, flags, stream) {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemAdvise(devPtr, count, advice, device) +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemDiscardBatchAsync(dptrs, sizes, count, flags, stream) {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaMemAdvise_v2(devPtr, count, advice, location) +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemAdvise(devPtr, count, advice, location) {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -953,6 +953,24 @@ cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCal return cudaMemPoolDestroy(memPool) {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemGetDefaultMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemGetMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemSetMemPool(location, typename, memPool) +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1121,6 +1139,36 @@ cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCa return cudaRuntimeGetVersion(runtimeVersion) {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLogsRegisterCallback(callbackFunc, userData, callback_out) +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLogsUnregisterCallback(callback) +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLogsCurrent(iterator_out, flags) +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLogsDumpToFile(iterator, pathToFile, flags) +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLogsDumpToMemory(iterator, buffer, size, flags) +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1147,8 +1195,8 @@ cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaK {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphKernelNodeCopyAttributes(hSrc, hDst) +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeCopyAttributes(hDst, hSrc) {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1393,62 +1441,32 @@ cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoo {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphGetEdges(graph, from_, to, numEdges) -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphGetEdges(graph, from_, to, edgeData, numEdges) {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependencies(node, pDependencies, edgeData, pNumDependencies) {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependentNodes(node, pDependentNodes, edgeData, pNumDependentNodes) {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphAddDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphRemoveDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphRemoveDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1621,14 +1639,8 @@ cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddNode(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 3d30af927..c2ca56bde 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 22b2e0835..62890c240 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 988ead7a8..d08c43fde 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index 3f0c2c430..8b50574f8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 02c6ba036..38fb45efe 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index f8c5502cd..ec47e11bf 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pxd b/cuda_bindings/cuda/bindings/_internal/utils.pxd index 30f7935af..50484727b 100644 --- a/cuda_bindings/cuda/bindings/_internal/utils.pxd +++ b/cuda_bindings/cuda/bindings/_internal/utils.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE @@ -24,7 +24,7 @@ cdef extern from * nogil: if (own_data) manager_.reset(data); else - raw_data_ = data; + raw_data_ = data; } nullable_unique_ptr(const nullable_unique_ptr&) = delete; @@ -39,7 +39,7 @@ cdef extern from * nogil: { manager_ = std::move(other.manager_); raw_data_ = nullptr; // just in case - } + } else { manager_.reset(nullptr); // just in case @@ -55,7 +55,7 @@ cdef extern from * nogil: { manager_ = std::move(other.manager_); raw_data_ = nullptr; // just in case - } + } else { manager_.reset(nullptr); // just in case diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pyx b/cuda_bindings/cuda/bindings/_internal/utils.pyx index aa78e6cff..bf2422f79 100644 --- a/cuda_bindings/cuda/bindings/_internal/utils.pyx +++ b/cuda_bindings/cuda/bindings/_internal/utils.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/utils.pyx.in index 9dd1e4ce5..da38dd450 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pyx.in @@ -381,7 +381,8 @@ cdef class HelperCUjit_option: {{if 'CU_JIT_TARGET_FROM_CUCONTEXT' in found_values}}cydriver.CUjit_option_enum.CU_JIT_TARGET_FROM_CUCONTEXT,{{endif}} {{if 'CU_JIT_REFERENCED_KERNEL_COUNT' in found_values}}cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_COUNT,{{endif}} {{if 'CU_JIT_REFERENCED_VARIABLE_COUNT' in found_values}}cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_COUNT,{{endif}} - {{if 'CU_JIT_MIN_CTA_PER_SM' in found_values}}cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM,{{endif}}): + {{if 'CU_JIT_MIN_CTA_PER_SM' in found_values}}cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM,{{endif}} + {{if 'CU_JIT_SPLIT_COMPILE' in found_values}}cydriver.CUjit_option_enum.CU_JIT_SPLIT_COMPILE,{{endif}}): self._uint = init_value self._cptr = self._uint elif self._attr in ({{if 'CU_JIT_WALL_TIME' in found_values}}cydriver.CUjit_option_enum.CU_JIT_WALL_TIME,{{endif}}): diff --git a/cuda_bindings/cuda/bindings/_version.py b/cuda_bindings/cuda/bindings/_version.py index 2dc71972d..288ec3d52 100644 --- a/cuda_bindings/cuda/bindings/_version.py +++ b/cuda_bindings/cuda/bindings/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -__version__ = "12.9.0" +__version__ = "13.0.0" diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/cydriver.pxd.in index 628fa2b3c..e3fe2f881 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/cydriver.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from libc.stdint cimport uint32_t, uint64_t @@ -557,7 +557,11 @@ cdef extern from "cuda.h": CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 141 CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED = 142 CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED = 143 - CU_DEVICE_ATTRIBUTE_MAX = 144 + CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED = 144 + CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 145 + CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED = 146 + CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED = 147 + CU_DEVICE_ATTRIBUTE_MAX = 148 ctypedef CUdevice_attribute_enum CUdevice_attribute @@ -717,7 +721,8 @@ cdef extern from "cuda.h": CU_JIT_MIN_CTA_PER_SM = 31 CU_JIT_MAX_THREADS_PER_BLOCK = 32 CU_JIT_OVERRIDE_DIRECTIVE_VALUES = 33 - CU_JIT_NUM_OPTIONS = 34 + CU_JIT_SPLIT_COMPILE = 34 + CU_JIT_NUM_OPTIONS = 35 ctypedef CUjit_option_enum CUjit_option @@ -741,19 +746,19 @@ cdef extern from "cuda.h": CU_TARGET_COMPUTE_89 = 89 CU_TARGET_COMPUTE_90 = 90 CU_TARGET_COMPUTE_100 = 100 - CU_TARGET_COMPUTE_101 = 101 CU_TARGET_COMPUTE_103 = 103 + CU_TARGET_COMPUTE_110 = 110 CU_TARGET_COMPUTE_120 = 120 CU_TARGET_COMPUTE_121 = 121 CU_TARGET_COMPUTE_90A = 65626 CU_TARGET_COMPUTE_100A = 65636 - CU_TARGET_COMPUTE_101A = 65637 CU_TARGET_COMPUTE_103A = 65639 + CU_TARGET_COMPUTE_110A = 65646 CU_TARGET_COMPUTE_120A = 65656 CU_TARGET_COMPUTE_121A = 65657 CU_TARGET_COMPUTE_100F = 131172 - CU_TARGET_COMPUTE_101F = 131173 CU_TARGET_COMPUTE_103F = 131175 + CU_TARGET_COMPUTE_110F = 131182 CU_TARGET_COMPUTE_120F = 131192 CU_TARGET_COMPUTE_121F = 131193 @@ -1048,6 +1053,7 @@ cdef extern from "cuda.h": CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12 CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13 CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 14 + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = 16 ctypedef CUlaunchAttributeID_enum CUlaunchAttributeID @@ -1090,6 +1096,7 @@ cdef extern from "cuda.h": anon_struct4 preferredClusterDim anon_struct5 deviceUpdatableKernelNode unsigned int sharedMemCarveout + unsigned int nvlinkUtilCentricScheduling ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue @@ -1222,6 +1229,7 @@ cdef extern from "cuda.h": CUDA_ERROR_PROFILER_ALREADY_STARTED = 7 CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8 CUDA_ERROR_STUB_LIBRARY = 34 + CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER = 36 CUDA_ERROR_DEVICE_UNAVAILABLE = 46 CUDA_ERROR_NO_DEVICE = 100 CUDA_ERROR_INVALID_DEVICE = 101 @@ -1321,9 +1329,39 @@ cdef extern from "cuda.h": CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 3 CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = 4 CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 4 + CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = 5 ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute + cdef enum CUatomicOperation_enum: + CU_ATOMIC_OPERATION_INTEGER_ADD = 0 + CU_ATOMIC_OPERATION_INTEGER_MIN = 1 + CU_ATOMIC_OPERATION_INTEGER_MAX = 2 + CU_ATOMIC_OPERATION_INTEGER_INCREMENT = 3 + CU_ATOMIC_OPERATION_INTEGER_DECREMENT = 4 + CU_ATOMIC_OPERATION_AND = 5 + CU_ATOMIC_OPERATION_OR = 6 + CU_ATOMIC_OPERATION_XOR = 7 + CU_ATOMIC_OPERATION_EXCHANGE = 8 + CU_ATOMIC_OPERATION_CAS = 9 + CU_ATOMIC_OPERATION_FLOAT_ADD = 10 + CU_ATOMIC_OPERATION_FLOAT_MIN = 11 + CU_ATOMIC_OPERATION_FLOAT_MAX = 12 + CU_ATOMIC_OPERATION_MAX = 13 + + ctypedef CUatomicOperation_enum CUatomicOperation + + cdef enum CUatomicOperationCapability_enum: + CU_ATOMIC_CAPABILITY_SIGNED = 1 + CU_ATOMIC_CAPABILITY_UNSIGNED = 2 + CU_ATOMIC_CAPABILITY_REDUCTION = 4 + CU_ATOMIC_CAPABILITY_SCALAR_32 = 8 + CU_ATOMIC_CAPABILITY_SCALAR_64 = 16 + CU_ATOMIC_CAPABILITY_SCALAR_128 = 32 + CU_ATOMIC_CAPABILITY_VECTOR_32x4 = 64 + + ctypedef CUatomicOperationCapability_enum CUatomicOperationCapability + ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData) ctypedef size_t (*CUoccupancyB2DSize)(int blockSize) @@ -1679,6 +1717,7 @@ cdef extern from "cuda.h": CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6 CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7 CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = 9 ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType @@ -1862,6 +1901,7 @@ cdef extern from "cuda.h": cdef enum CUmemLocationType_enum: CU_MEM_LOCATION_TYPE_INVALID = 0 + CU_MEM_LOCATION_TYPE_NONE = 0 CU_MEM_LOCATION_TYPE_DEVICE = 1 CU_MEM_LOCATION_TYPE_HOST = 2 CU_MEM_LOCATION_TYPE_HOST_NUMA = 3 @@ -1873,6 +1913,7 @@ cdef extern from "cuda.h": cdef enum CUmemAllocationType_enum: CU_MEM_ALLOCATION_TYPE_INVALID = 0 CU_MEM_ALLOCATION_TYPE_PINNED = 1 + CU_MEM_ALLOCATION_TYPE_MANAGED = 2 CU_MEM_ALLOCATION_TYPE_MAX = 2147483647 ctypedef CUmemAllocationType_enum CUmemAllocationType @@ -2310,10 +2351,11 @@ cdef extern from "cuda.h": ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs - cdef struct CUcheckpointRestoreArgs_st: - cuuint64_t reserved[8] + cdef struct CUcheckpointGpuPair_st: + CUuuid oldUuid + CUuuid newUuid - ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + ctypedef CUcheckpointGpuPair_st CUcheckpointGpuPair cdef struct CUcheckpointUnlockArgs_st: cuuint64_t reserved[8] @@ -2391,6 +2433,8 @@ cdef extern from "cuda.h": cdef struct CUdevSmResource_st: unsigned int smCount + unsigned int minSmPartitionSize + unsigned int smCoscheduledAlignment ctypedef CUdevSmResource_st CUdevSmResource @@ -2663,14 +2707,9 @@ cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuDeviceGetUuid' in found_functions}} - -cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} -cdef CUresult cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuDeviceGetLuid' in found_functions}} @@ -2693,6 +2732,11 @@ cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUa cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{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 +{{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil @@ -2758,19 +2802,9 @@ cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuCtxCreate_v2' in found_functions}} - -cdef CUresult cuCtxCreate(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxCreate_v3' in found_functions}} - -cdef CUresult cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} -cdef CUresult cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxCreate(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuCtxDestroy_v2' in found_functions}} @@ -2803,6 +2837,11 @@ cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogi cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCtxGetDevice_v2' in found_functions}} + +cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCtxGetFlags' in found_functions}} cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil @@ -2823,6 +2862,11 @@ cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCtxSynchronize_v2' in found_functions}} + +cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCtxSetLimit' in found_functions}} cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil @@ -3293,14 +3337,14 @@ cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) exce cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}} +{{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, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemcpy3DBatchAsync' in found_functions}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} -cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} @@ -3553,6 +3597,21 @@ cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProp cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuMemGetDefaultMemPool' in found_functions}} + +cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + +{{if 'cuMemGetMemPool' in found_functions}} + +cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + +{{if 'cuMemSetMemPool' in found_functions}} + +cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil @@ -3613,24 +3672,29 @@ cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastOb cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}} +{{if 'cuMemPrefetchAsync_v2' in found_functions}} -cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemPrefetchAsync_v2' in found_functions}} +{{if 'cuMemAdvise_v2' in found_functions}} -cdef CUresult cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuMemAdvise' in found_functions}} +{{if 'cuMemPrefetchBatchAsync' in found_functions}} -cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +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 {{endif}} -{{if 'cuMemAdvise_v2' in found_functions}} +{{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 +{{endif}} + +{{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef CUresult cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil +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 {{endif}} {{if 'cuMemRangeGetAttribute' in found_functions}} @@ -3728,24 +3792,14 @@ cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUD cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - -cdef CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} -cdef CUresult cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - -cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +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 {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} -cdef CUresult cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuStreamAttachMemAsync' in found_functions}} @@ -3813,14 +3867,9 @@ cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND no cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuEventElapsedTime' in found_functions}} - -cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} -cdef CUresult cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuImportExternalMemory' in found_functions}} @@ -4228,54 +4277,29 @@ cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNod cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphGetEdges' in found_functions}} - -cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} -cdef CUresult cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetDependencies' in found_functions}} - -cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} -cdef CUresult cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetDependentNodes' in found_functions}} - -cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} -cdef CUresult cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddDependencies' in found_functions}} - -cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} -cdef CUresult cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphRemoveDependencies' in found_functions}} - -cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} -cdef CUresult cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphDestroyNode' in found_functions}} @@ -4423,14 +4447,9 @@ cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsign cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuGraphAddNode' in found_functions}} - -cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} -cdef CUresult cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} {{if 'cuGraphNodeSetParams' in found_functions}} @@ -4708,6 +4727,11 @@ cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_N cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil {{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 +{{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil @@ -4833,6 +4857,11 @@ cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?C cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuGreenCtxGetId' in found_functions}} + +cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil @@ -4878,11 +4907,6 @@ cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) excep cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -{{if 'cuCheckpointProcessRestore' in found_functions}} - -cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil @@ -4993,7 +5017,7 @@ cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResou cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} -cdef enum: CUDA_VERSION = 12090 +cdef enum: CUDA_VERSION = 13000 cdef enum: CU_IPC_HANDLE_SIZE = 64 diff --git a/cuda_bindings/cuda/bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/cydriver.pyx.in index 6c6b44cfc..5bd49954d 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/cydriver.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings._bindings.cydriver as cydriver {{if 'cuGetErrorString' in found_functions}} @@ -46,15 +46,9 @@ cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA return cydriver._cuDeviceGetName(name, length, dev) {{endif}} -{{if 'cuDeviceGetUuid' in found_functions}} - -cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetUuid(uuid, dev) -{{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} -cdef CUresult cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuDeviceGetUuid_v2(uuid, dev) {{endif}} @@ -82,6 +76,12 @@ cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice 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: @@ -160,21 +160,9 @@ cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND return cydriver._cuDevicePrimaryCtxReset_v2(dev) {{endif}} -{{if 'cuCtxCreate_v2' in found_functions}} - -cdef CUresult cuCtxCreate(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxCreate_v2(pctx, flags, dev) -{{endif}} - -{{if 'cuCtxCreate_v3' in found_functions}} - -cdef CUresult cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxCreate_v3(pctx, paramsArray, numParams, flags, dev) -{{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} -cdef CUresult cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: +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}} @@ -214,6 +202,12 @@ cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogi 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: @@ -238,6 +232,12 @@ 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: @@ -802,16 +802,16 @@ cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStr return cydriver._cuMemcpy3DPeerAsync(pCopy, hStream) {{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}} +{{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, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream) +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' in found_functions}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} -cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DBatchAsync(numOps, opList, failIdx, flags, hStream) +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 'cuMemsetD8_v2' in found_functions}} @@ -1114,6 +1114,24 @@ cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND n 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: @@ -1186,28 +1204,34 @@ cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, C return cydriver._cuPointerGetAttribute(data, attribute, ptr) {{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}} +{{if 'cuMemPrefetchAsync_v2' in found_functions}} -cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPrefetchAsync(devPtr, count, dstDevice, hStream) +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 'cuMemPrefetchAsync_v2' in found_functions}} +{{if 'cuMemAdvise_v2' in found_functions}} -cdef CUresult cuMemPrefetchAsync_v2(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) +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 'cuMemAdvise' in found_functions}} +{{if 'cuMemPrefetchBatchAsync' in found_functions}} -cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAdvise(devPtr, count, advice, device) +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 'cuMemAdvise_v2' in found_functions}} +{{if 'cuMemDiscardBatchAsync' in found_functions}} -cdef CUresult cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAdvise_v2(devPtr, count, advice, location) +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}} @@ -1324,27 +1348,15 @@ cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captu return cydriver._cuStreamIsCapturing(hStream, captureStatus) {{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - -cdef CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetCaptureInfo_v2(hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) -{{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} -cdef CUresult cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult 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' in found_functions}} - -cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamUpdateCaptureDependencies(hStream, dependencies, numDependencies, flags) -{{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} -cdef CUresult cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult 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}} @@ -1426,15 +1438,9 @@ cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventDestroy_v2(hEvent) {{endif}} -{{if 'cuEventElapsedTime' in found_functions}} - -cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventElapsedTime(pMilliseconds, hStart, hEnd) -{{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} -cdef CUresult cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: return cydriver._cuEventElapsedTime_v2(pMilliseconds, hStart, hEnd) {{endif}} @@ -1924,63 +1930,33 @@ cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t return cydriver._cuGraphGetRootNodes(hGraph, rootNodes, numRootNodes) {{endif}} -{{if 'cuGraphGetEdges' in found_functions}} - -cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphGetEdges(hGraph, from_, to, numEdges) -{{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} -cdef CUresult cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: +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' in found_functions}} - -cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetDependencies(hNode, dependencies, numDependencies) -{{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} -cdef CUresult cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: +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' in found_functions}} - -cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetDependentNodes(hNode, dependentNodes, numDependentNodes) -{{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} -cdef CUresult cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: +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' in found_functions}} - -cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddDependencies(hGraph, from_, to, numDependencies) -{{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} -cdef CUresult cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult 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' in found_functions}} - -cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphRemoveDependencies(hGraph, from_, to, numDependencies) -{{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} -cdef CUresult cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult 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}} @@ -2158,15 +2134,9 @@ cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsig return cydriver._cuGraphReleaseUserObject(graph, object, count) {{endif}} -{{if 'cuGraphAddNode' in found_functions}} - -cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} -cdef CUresult cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: +cdef CUresult 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}} @@ -2500,6 +2470,12 @@ cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, 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: @@ -2650,6 +2626,12 @@ cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, un 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 'cuLogsRegisterCallback' in found_functions}} cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -2704,12 +2686,6 @@ cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* 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: diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index eaf0d0a0e..60ea8b1d1 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t @@ -23,6 +23,15 @@ ctypedef enum nvJitLinkResult "nvJitLinkResult": NVJITLINK_ERROR_THREADPOOL "NVJITLINK_ERROR_THREADPOOL" NVJITLINK_ERROR_UNRECOGNIZED_INPUT "NVJITLINK_ERROR_UNRECOGNIZED_INPUT" NVJITLINK_ERROR_FINALIZE "NVJITLINK_ERROR_FINALIZE" + NVJITLINK_ERROR_NULL_INPUT "NVJITLINK_ERROR_NULL_INPUT" + NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS "NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS" + NVJITLINK_ERROR_INCORRECT_INPUT_TYPE "NVJITLINK_ERROR_INCORRECT_INPUT_TYPE" + NVJITLINK_ERROR_ARCH_MISMATCH "NVJITLINK_ERROR_ARCH_MISMATCH" + NVJITLINK_ERROR_OUTDATED_LIBRARY "NVJITLINK_ERROR_OUTDATED_LIBRARY" + NVJITLINK_ERROR_MISSING_FATBIN "NVJITLINK_ERROR_MISSING_FATBIN" + NVJITLINK_ERROR_UNRECOGNIZED_ARCH "NVJITLINK_ERROR_UNRECOGNIZED_ARCH" + NVJITLINK_ERROR_UNSUPPORTED_ARCH "NVJITLINK_ERROR_UNSUPPORTED_ARCH" + NVJITLINK_ERROR_LTO_NOT_ENABLED "NVJITLINK_ERROR_LTO_NOT_ENABLED" _NVJITLINKRESULT_INTERNAL_LOADING_ERROR "_NVJITLINKRESULT_INTERNAL_LOADING_ERROR" = -42 ctypedef enum nvJitLinkInputType "nvJitLinkInputType": diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index b19f1a846..8a65590e0 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/cynvrtc.pxd.in index 84bee7ed6..7a392687d 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/cynvrtc.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from libc.stdint cimport uint32_t, uint64_t @@ -25,6 +25,7 @@ cdef extern from "nvrtc.h": NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED = 14 NVRTC_ERROR_PCH_CREATE = 15 NVRTC_ERROR_CANCELLED = 16 + NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = 17 cdef struct _nvrtcProgram: pass @@ -85,16 +86,6 @@ cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) exce cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil {{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}} - -cdef nvrtcResult nvrtcGetNVVMSize(nvrtcProgram prog, size_t* nvvmSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetNVVM' in found_functions}} - -cdef nvrtcResult nvrtcGetNVVM(nvrtcProgram prog, char* nvvm) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/cynvrtc.pyx.in index 35dbf22c3..b8c19e73d 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/cynvrtc.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings._bindings.cynvrtc as cynvrtc {{if 'nvrtcGetErrorString' in found_functions}} @@ -70,18 +70,6 @@ cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERR return cynvrtc._nvrtcGetCUBIN(prog, cubin) {{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}} - -cdef nvrtcResult nvrtcGetNVVMSize(nvrtcProgram prog, size_t* nvvmSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetNVVMSize(prog, nvvmSizeRet) -{{endif}} - -{{if 'nvrtcGetNVVM' in found_functions}} - -cdef nvrtcResult nvrtcGetNVVM(nvrtcProgram prog, char* nvvm) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetNVVM(prog, nvvm) -{{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index 94e2034a8..18b81d31c 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. ############################################################################### diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index a5b9a4368..29235ca9a 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/cyruntime.pxd.in index a6679a2e9..bd0bc3d5f 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from libc.stdint cimport uint32_t, uint64_t @@ -176,12 +176,12 @@ cdef struct cudaEglPlaneDesc_st: ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc -cdef union anon_union11: +cdef union anon_union9: cudaArray_t pArray[3] cudaPitchedPtr pPitch[3] cdef struct cudaEglFrame_st: - anon_union11 frame + anon_union9 frame cudaEglPlaneDesc planeDesc[3] unsigned int planeCount cudaEglFrameType frameType @@ -329,7 +329,7 @@ cdef const char* cudaGetErrorString(cudaError_t error) except ?NULL nogil cdef cudaError_t cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} @@ -339,6 +339,11 @@ cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) excep cdef cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil @@ -364,6 +369,11 @@ cdef cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int d cdef cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil @@ -504,24 +514,14 @@ cdef cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) cdef cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -564,11 +564,6 @@ cdef cudaError_t cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequir cdef cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil @@ -594,12 +589,12 @@ cdef cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ? cdef cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} cdef cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} cdef cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} @@ -836,12 +831,12 @@ cdef cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -891,22 +886,27 @@ cdef cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cuda {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -989,6 +989,21 @@ cdef cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProp cdef cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil @@ -1129,6 +1144,31 @@ cdef cudaError_t cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallR cdef cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil @@ -1151,7 +1191,7 @@ cdef cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKe {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1356,52 +1396,27 @@ cdef cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoot {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1546,12 +1561,7 @@ cdef cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} @@ -1862,10 +1872,6 @@ cdef enum: cudaInvalidDeviceId = -2 cdef enum: cudaInitDeviceFlagsAreValid = 1 -cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1 - -cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2 - cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 @@ -1916,6 +1922,8 @@ cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 +cdef enum: cudaKernelNodeAttributeNvlinkUtilCentricScheduling = 16 + cdef enum: cudaSurfaceType1D = 1 cdef enum: cudaSurfaceType2D = 2 @@ -1944,8 +1952,8 @@ cdef enum: cudaTextureType2DLayered = 242 cdef enum: cudaTextureTypeCubemapLayered = 252 -cdef enum: CUDART_VERSION = 12090 +cdef enum: CUDART_VERSION = 13000 -cdef enum: __CUDART_API_VERSION = 12090 +cdef enum: __CUDART_API_VERSION = 13000 cdef enum: CUDA_EGL_MAX_PLANES = 3 \ No newline at end of file diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in index 01183a53c..d327685c1 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings._bindings.cyruntime as cyruntime cimport cuda.bindings._lib.cyruntime.cyruntime as custom_cyruntime cimport cython @@ -156,10 +156,10 @@ cdef cudaError_t cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNew return cyruntime._cudaGetDeviceCount(count) {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGetDeviceProperties_v2(prop, device) + return cyruntime._cudaGetDeviceProperties(prop, device) {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -168,6 +168,12 @@ cdef cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int dev return cyruntime._cudaDeviceGetAttribute(value, attr, device) {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +cdef cudaError_t cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetHostAtomicCapabilities(capabilities, operations, count, device) +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} cdef cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -198,6 +204,12 @@ cdef cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, i return cyruntime._cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +cdef cudaError_t cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} cdef cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -366,28 +378,16 @@ cdef cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureSta return cyruntime._cudaStreamIsCapturing(stream, pCaptureStatus) {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - -cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} -cdef cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) +cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetCaptureInfo(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} -cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -cdef cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) +cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamUpdateCaptureDependencies(stream, dependencies, dependencyData, numDependencies, flags) {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -438,12 +438,6 @@ cdef cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t return cyruntime._cudaEventElapsedTime(ms, start, end) {{endif}} -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -cdef cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaEventElapsedTime_v2(ms, start, end) -{{endif}} - {{if 'cudaImportExternalMemory' in found_functions}} cdef cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -474,16 +468,16 @@ cdef cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out return cyruntime._cudaImportExternalSemaphore(extSem_out, semHandleDesc) {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} cdef cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return cyruntime._cudaSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} cdef cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return cyruntime._cudaWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -764,14 +758,14 @@ cdef cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, {{if 'cudaMemcpyBatchAsync' in found_functions}} -cdef cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) +cdef cudaError_t cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, stream) {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} -cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) +cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3DBatchAsync(numOps, opList, flags, stream) {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -830,26 +824,32 @@ cdef cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cuda {{if 'cudaMemPrefetchAsync' in found_functions}} -cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) +cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPrefetchAsync(devPtr, count, location, flags, stream) {{endif}} -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} -cdef cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) +cdef cudaError_t cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemDiscardBatchAsync' in found_functions}} -cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemAdvise(devPtr, count, advice, device) +cdef cudaError_t cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemDiscardBatchAsync(dptrs, sizes, count, flags, stream) {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} -cdef cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaMemAdvise_v2(devPtr, count, advice, location) +cdef cudaError_t cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemAdvise(devPtr, count, advice, location) {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -948,6 +948,24 @@ cdef cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCall return cyruntime._cudaMemPoolDestroy(memPool) {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +cdef cudaError_t cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemGetDefaultMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +cdef cudaError_t cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemGetMemPool(memPool, location, typename) +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +cdef cudaError_t cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemSetMemPool(location, typename, memPool) +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} cdef cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1116,6 +1134,36 @@ cdef cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCal return cyruntime._cudaRuntimeGetVersion(runtimeVersion) {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +cdef cudaError_t cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLogsRegisterCallback(callbackFunc, userData, callback_out) +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +cdef cudaError_t cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLogsUnregisterCallback(callback) +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +cdef cudaError_t cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLogsCurrent(iterator_out, flags) +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +cdef cudaError_t cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLogsDumpToFile(iterator, pathToFile, flags) +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +cdef cudaError_t cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLogsDumpToMemory(iterator, buffer, size, flags) +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} cdef cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1142,8 +1190,8 @@ cdef cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKe {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} -cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphKernelNodeCopyAttributes(hSrc, hDst) +cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeCopyAttributes(hDst, hSrc) {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1388,62 +1436,32 @@ cdef cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRoot {{if 'cudaGraphGetEdges' in found_functions}} -cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphGetEdges(graph, from_, to, numEdges) -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -cdef cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) +cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphGetEdges(graph, from_, to, edgeData, numEdges) {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} -cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) +cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependencies(node, pDependencies, edgeData, pNumDependencies) {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} -cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -cdef cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) +cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependentNodes(node, pDependentNodes, edgeData, pNumDependentNodes) {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} -cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphAddDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) +cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} -cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphRemoveDependencies(graph, from_, to, numDependencies) -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -cdef cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) +cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphRemoveDependencies(graph, from_, to, edgeData, numDependencies) {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1616,14 +1634,8 @@ cdef cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t {{if 'cudaGraphAddNode' in found_functions}} -cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -cdef cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: - return cyruntime._cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) +cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddNode(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} @@ -1884,16 +1896,16 @@ cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCa raise NotImplementedError('"getLocalRuntimeVersion" is unsupported on Windows') {{else}} # Load - handle = dlfcn.dlopen('libcudart.so.12', dlfcn.RTLD_NOW) + handle = dlfcn.dlopen('libcudart.so.13', dlfcn.RTLD_NOW) if handle == NULL: with gil: - raise RuntimeError(f'Failed to dlopen libcudart.so.12') + raise RuntimeError(f'Failed to dlopen libcudart.so.13') __cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion') if __cudaRuntimeGetVersion == NULL: with gil: - raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in libcudart.so.12') + raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in libcudart.so.13') # Call cdef cudaError_t err = cudaSuccess diff --git a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in b/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in index 5dea3c68f..14230f1a2 100644 --- a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in +++ b/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cdef extern from "cuda_runtime_api.h": {{if 'cudaDeviceReset' in found_functions}} @@ -129,15 +129,20 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaGetDeviceCount(int* count) nogil {{endif}} - {{if 'cudaGetDeviceProperties_v2' in found_functions}} + {{if 'cudaGetDeviceProperties' in found_functions}} - cudaError_t cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) nogil + cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) nogil {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil + {{endif}} + {{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + + cudaError_t cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) nogil + {{endif}} {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} @@ -163,6 +168,11 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil + {{endif}} + {{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + + cudaError_t cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) nogil + {{endif}} {{if 'cudaChooseDevice' in found_functions}} @@ -304,29 +314,14 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) nogil {{endif}} - {{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} - - cudaError_t cudaStreamGetCaptureInfo_v2_ptsz(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil - - {{endif}} - {{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + {{if 'cudaStreamGetCaptureInfo' in found_functions}} - cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil - - {{endif}} - {{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} - - cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) nogil + cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) nogil {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} - cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) nogil - - {{endif}} - {{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - - cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) nogil + cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) nogil {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -368,11 +363,6 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) nogil - {{endif}} - {{if 'cudaEventElapsedTime_v2' in found_functions}} - - cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) nogil - {{endif}} {{if 'cudaImportExternalMemory' in found_functions}} @@ -399,24 +389,14 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) nogil {{endif}} - {{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + {{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} - cudaError_t cudaSignalExternalSemaphoresAsync_v2_ptsz(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil {{endif}} - {{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + {{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} - cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil - - {{endif}} - {{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} - - cudaError_t cudaWaitExternalSemaphoresAsync_v2_ptsz(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil - - {{endif}} - {{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} - - cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -651,12 +631,12 @@ cdef extern from "cuda_runtime_api.h": {{endif}} {{if 'cudaMemcpyBatchAsync' in found_functions}} - cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) nogil + cudaError_t cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) nogil {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} - cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) nogil + cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) nogil {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -706,22 +686,27 @@ cdef extern from "cuda_runtime_api.h": {{endif}} {{if 'cudaMemPrefetchAsync' in found_functions}} - cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) nogil + cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) nogil {{endif}} - {{if 'cudaMemPrefetchAsync_v2' in found_functions}} + {{if 'cudaMemPrefetchBatchAsync' in found_functions}} - cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) nogil + cudaError_t cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) nogil {{endif}} - {{if 'cudaMemAdvise' in found_functions}} + {{if 'cudaMemDiscardBatchAsync' in found_functions}} + + cudaError_t cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} - cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) nogil + cudaError_t cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) nogil {{endif}} - {{if 'cudaMemAdvise_v2' in found_functions}} + {{if 'cudaMemAdvise' in found_functions}} - cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) nogil + cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) nogil {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -803,6 +788,21 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) nogil + {{endif}} + {{if 'cudaMemGetDefaultMemPool' in found_functions}} + + cudaError_t cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) nogil + + {{endif}} + {{if 'cudaMemGetMemPool' in found_functions}} + + cudaError_t cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) nogil + + {{endif}} + {{if 'cudaMemSetMemPool' in found_functions}} + + cudaError_t cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) nogil + {{endif}} {{if 'cudaMallocFromPoolAsync' in found_functions}} @@ -943,6 +943,31 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) nogil + {{endif}} + {{if 'cudaLogsRegisterCallback' in found_functions}} + + cudaError_t cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) nogil + + {{endif}} + {{if 'cudaLogsUnregisterCallback' in found_functions}} + + cudaError_t cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) nogil + + {{endif}} + {{if 'cudaLogsCurrent' in found_functions}} + + cudaError_t cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) nogil + + {{endif}} + {{if 'cudaLogsDumpToFile' in found_functions}} + + cudaError_t cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) nogil + + {{endif}} + {{if 'cudaLogsDumpToMemory' in found_functions}} + + cudaError_t cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) nogil + {{endif}} {{if 'cudaGraphCreate' in found_functions}} @@ -966,7 +991,7 @@ cdef extern from "cuda_runtime_api.h": {{endif}} {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} - cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) nogil + cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) nogil {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -1171,52 +1196,27 @@ cdef extern from "cuda_runtime_api.h": {{endif}} {{if 'cudaGraphGetEdges' in found_functions}} - cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) nogil - - {{endif}} - {{if 'cudaGraphGetEdges_v2' in found_functions}} - - cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) nogil + cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) nogil {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} - cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) nogil - - {{endif}} - {{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - - cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) nogil + cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) nogil {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} - cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) nogil - - {{endif}} - {{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - - cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) nogil + cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) nogil {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} - cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) nogil - - {{endif}} - {{if 'cudaGraphAddDependencies_v2' in found_functions}} - - cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} - cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) nogil - - {{endif}} - {{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - - cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -1361,12 +1361,7 @@ cdef extern from "cuda_runtime_api.h": {{endif}} {{if 'cudaGraphAddNode' in found_functions}} - cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil - - {{endif}} - {{if 'cudaGraphAddNode_v2' in found_functions}} - - cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil + cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in b/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in index d4e612ef2..348dba868 100644 --- a/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in +++ b/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cdef extern from "vector_types.h": @@ -283,15 +283,20 @@ cdef extern from "driver_types.h": size_t height size_t pitchInBytes + cdef struct anon_struct5: + int reserved[32] + cdef union anon_union0: anon_struct1 array anon_struct2 mipmap anon_struct3 linear anon_struct4 pitch2D + anon_struct5 reserved cdef struct cudaResourceDesc: cudaResourceType resType anon_union0 res + unsigned int flags cdef struct cudaResourceViewDesc: cudaResourceViewFormat format @@ -302,12 +307,14 @@ cdef extern from "driver_types.h": unsigned int lastMipmapLevel unsigned int firstLayer unsigned int lastLayer + unsigned int reserved[16] cdef struct cudaPointerAttributes: cudaMemoryType type int device void* devicePointer void* hostPointer + long reserved[8] cdef struct cudaFuncAttributes: size_t sharedSizeBytes @@ -376,19 +383,19 @@ cdef extern from "driver_types.h": size_t y size_t z - cdef struct anon_struct5: + cdef struct anon_struct6: void* ptr size_t rowLength size_t layerHeight cudaMemLocation locHint - cdef struct anon_struct6: + cdef struct anon_struct7: cudaArray_t array cudaOffset3D offset cdef union anon_union1: - anon_struct5 ptr - anon_struct6 array + anon_struct6 ptr + anon_struct7 array cdef struct cudaMemcpy3DOperand: cudaMemcpy3DOperandType type @@ -421,21 +428,16 @@ cdef extern from "driver_types.h": int maxThreadsPerBlock int maxThreadsDim[3] int maxGridSize[3] - int clockRate size_t totalConstMem int major int minor size_t textureAlignment size_t texturePitchAlignment - int deviceOverlap int multiProcessorCount - int kernelExecTimeoutEnabled int integrated int canMapHostMemory - int computeMode int maxTexture1D int maxTexture1DMipmap - int maxTexture1DLinear int maxTexture2D[2] int maxTexture2DMipmap[2] int maxTexture2DLinear[3] @@ -462,7 +464,6 @@ cdef extern from "driver_types.h": int tccDriver int asyncEngineCount int unifiedAddressing - int memoryClockRate int memoryBusWidth int l2CacheSize int persistingL2CacheMaxSize @@ -476,13 +477,11 @@ cdef extern from "driver_types.h": int isMultiGpuBoard int multiGpuBoardGroupID int hostNativeAtomicSupported - int singleToDoublePrecisionPerfRatio int pageableMemoryAccess int concurrentManagedAccess int computePreemptionSupported int canUseHostPointerForRegisteredMem int cooperativeLaunch - int cooperativeMultiDeviceLaunch size_t sharedMemPerBlockOptin int pageableMemoryAccessUsesHostPageTables int directManagedMemAccessFromHost @@ -502,7 +501,14 @@ cdef extern from "driver_types.h": int ipcEventSupported int clusterLaunch int unifiedFunctionPointers - int reserved[63] + int deviceNumaConfig + int deviceNumaId + int mpsEnabled + int hostNumaId + unsigned int gpuPciDeviceID + unsigned int gpuPciSubsystemID + int hostNumaMultinodeIpcSupported + int reserved[56] cdef struct cudaIpcEventHandle_st: char reserved[64] @@ -519,13 +525,13 @@ cdef extern from "driver_types.h": ctypedef cudaMemFabricHandle_st cudaMemFabricHandle_t - cdef struct anon_struct7: + cdef struct anon_struct8: void* handle const void* name cdef union anon_union2: int fd - anon_struct7 win32 + anon_struct8 win32 const void* nvSciBufObject cdef struct cudaExternalMemoryHandleDesc: @@ -533,11 +539,13 @@ cdef extern from "driver_types.h": anon_union2 handle unsigned long long size unsigned int flags + unsigned int reserved[16] cdef struct cudaExternalMemoryBufferDesc: unsigned long long offset unsigned long long size unsigned int flags + unsigned int reserved[16] cdef struct cudaExternalMemoryMipmappedArrayDesc: unsigned long long offset @@ -545,61 +553,63 @@ cdef extern from "driver_types.h": cudaExtent extent unsigned int flags unsigned int numLevels + unsigned int reserved[16] - cdef struct anon_struct8: + cdef struct anon_struct9: void* handle const void* name cdef union anon_union3: int fd - anon_struct8 win32 + anon_struct9 win32 const void* nvSciSyncObj cdef struct cudaExternalSemaphoreHandleDesc: cudaExternalSemaphoreHandleType type anon_union3 handle unsigned int flags + unsigned int reserved[16] - cdef struct anon_struct15: + cdef struct anon_struct10: unsigned long long value - cdef union anon_union6: + cdef union anon_union4: void* fence unsigned long long reserved - cdef struct anon_struct16: + cdef struct anon_struct11: unsigned long long key - cdef struct anon_struct17: - anon_struct15 fence - anon_union6 nvSciSync - anon_struct16 keyedMutex + cdef struct anon_struct12: + anon_struct10 fence + anon_union4 nvSciSync + anon_struct11 keyedMutex unsigned int reserved[12] cdef struct cudaExternalSemaphoreSignalParams: - anon_struct17 params + anon_struct12 params unsigned int flags unsigned int reserved[16] - cdef struct anon_struct18: + cdef struct anon_struct13: unsigned long long value - cdef union anon_union7: + cdef union anon_union5: void* fence unsigned long long reserved - cdef struct anon_struct19: + cdef struct anon_struct14: unsigned long long key unsigned int timeoutMs - cdef struct anon_struct20: - anon_struct18 fence - anon_union7 nvSciSync - anon_struct19 keyedMutex + cdef struct anon_struct15: + anon_struct13 fence + anon_union5 nvSciSync + anon_struct14 keyedMutex unsigned int reserved[10] cdef struct cudaExternalSemaphoreWaitParams: - anon_struct20 params + anon_struct15 params unsigned int flags unsigned int reserved[16] @@ -774,20 +784,20 @@ cdef extern from "driver_types.h": pass ctypedef CUgraphDeviceUpdatableNode_st* cudaGraphDeviceNode_t - cdef struct anon_struct21: + cdef struct anon_struct16: const void* pValue size_t offset size_t size - cdef union anon_union9: + cdef union anon_union7: dim3 gridDim - anon_struct21 param + anon_struct16 param unsigned int isEnabled cdef struct cudaGraphKernelNodeUpdate: cudaGraphDeviceNode_t node cudaGraphKernelNodeField field - anon_union9 updateData + anon_union7 updateData cdef enum cudaLaunchMemSyncDomain: cudaLaunchMemSyncDomainDefault = 0 @@ -815,27 +825,28 @@ cdef extern from "driver_types.h": cudaLaunchAttributeLaunchCompletionEvent = 12 cudaLaunchAttributeDeviceUpdatableKernelNode = 13 cudaLaunchAttributePreferredSharedMemoryCarveout = 14 + cudaLaunchAttributeNvlinkUtilCentricScheduling = 16 - cdef struct anon_struct22: + cdef struct anon_struct17: unsigned int x unsigned int y unsigned int z - cdef struct anon_struct23: + cdef struct anon_struct18: cudaEvent_t event int flags int triggerAtBlockStart - cdef struct anon_struct24: + cdef struct anon_struct19: unsigned int x unsigned int y unsigned int z - cdef struct anon_struct25: + cdef struct anon_struct20: cudaEvent_t event int flags - cdef struct anon_struct26: + cdef struct anon_struct21: int deviceUpdatable cudaGraphDeviceNode_t devNode @@ -844,17 +855,18 @@ cdef extern from "driver_types.h": cudaAccessPolicyWindow accessPolicyWindow int cooperative cudaSynchronizationPolicy syncPolicy - anon_struct22 clusterDim + anon_struct17 clusterDim cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference int programmaticStreamSerializationAllowed - anon_struct23 programmaticEvent + anon_struct18 programmaticEvent int priority cudaLaunchMemSyncDomainMap memSyncDomainMap cudaLaunchMemSyncDomain memSyncDomain - anon_struct24 preferredClusterDim - anon_struct25 launchCompletionEvent - anon_struct26 deviceUpdatableKernelNode + anon_struct19 preferredClusterDim + anon_struct20 launchCompletionEvent + anon_struct21 deviceUpdatableKernelNode unsigned int sharedMemCarveout + unsigned int nvlinkUtilCentricScheduling cdef struct cudaLaunchAttribute_st: cudaLaunchAttributeID id @@ -871,20 +883,32 @@ cdef extern from "driver_types.h": ctypedef cudaAsyncNotificationType_enum cudaAsyncNotificationType - cdef struct anon_struct27: + cdef struct anon_struct22: unsigned long long bytesOverBudget - cdef union anon_union10: - anon_struct27 overBudget + cdef union anon_union8: + anon_struct22 overBudget cdef struct cudaAsyncNotificationInfo: cudaAsyncNotificationType type - anon_union10 info + anon_union8 info ctypedef cudaAsyncNotificationInfo cudaAsyncNotificationInfo_t ctypedef void (*cudaAsyncCallback)(cudaAsyncNotificationInfo_t* , void* , cudaAsyncCallbackHandle_t ) + cdef enum CUDAlogLevel_enum: + cudaLogLevelError = 0 + cudaLogLevelWarning = 1 + + ctypedef CUDAlogLevel_enum cudaLogLevel + + cdef struct CUlogsCallbackEntry_st: + pass + ctypedef CUlogsCallbackEntry_st* cudaLogsCallbackHandle + + ctypedef unsigned int cudaLogIterator + cdef enum cudaChannelFormatKind: cudaChannelFormatKindSigned = 0 cudaChannelFormatKindUnsigned = 1 @@ -1202,7 +1226,7 @@ cdef extern from "driver_types.h": cudaDevAttrReserved93 = 93 cudaDevAttrReserved94 = 94 cudaDevAttrCooperativeLaunch = 95 - cudaDevAttrCooperativeMultiDeviceLaunch = 96 + cudaDevAttrReserved96 = 96 cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 cudaDevAttrCanFlushRemoteWrites = 98 cudaDevAttrHostRegisterSupported = 99 @@ -1215,7 +1239,6 @@ cdef extern from "driver_types.h": cudaDevAttrSparseCudaArraySupported = 112 cudaDevAttrHostRegisterReadOnlySupported = 113 cudaDevAttrTimelineSemaphoreInteropSupported = 114 - cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114 cudaDevAttrMemoryPoolsSupported = 115 cudaDevAttrGPUDirectRDMASupported = 116 cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117 @@ -1243,7 +1266,10 @@ cdef extern from "driver_types.h": cudaDevAttrReserved141 = 141 cudaDevAttrHostNumaMemoryPoolsSupported = 142 cudaDevAttrHostNumaMultinodeIpcSupported = 143 - cudaDevAttrMax = 144 + cudaDevAttrHostMemoryPoolsSupported = 144 + cudaDevAttrReserved145 = 145 + cudaDevAttrOnlyPartialHostNativeAtomicSupported = 147 + cudaDevAttrMax = 148 cdef enum cudaMemPoolAttr: cudaMemPoolReuseFollowEventDependencies = 1 @@ -1257,6 +1283,7 @@ cdef extern from "driver_types.h": cdef enum cudaMemLocationType: cudaMemLocationTypeInvalid = 0 + cudaMemLocationTypeNone = 0 cudaMemLocationTypeDevice = 1 cudaMemLocationTypeHost = 2 cudaMemLocationTypeHostNuma = 3 @@ -1270,6 +1297,7 @@ cdef extern from "driver_types.h": cdef enum cudaMemAllocationType: cudaMemAllocationTypeInvalid = 0 cudaMemAllocationTypePinned = 1 + cudaMemAllocationTypeManaged = 2 cudaMemAllocationTypeMax = 2147483647 cdef enum cudaMemAllocationHandleType: @@ -1306,6 +1334,31 @@ cdef extern from "driver_types.h": cudaDevP2PAttrAccessSupported = 2 cudaDevP2PAttrNativeAtomicSupported = 3 cudaDevP2PAttrCudaArrayAccessSupported = 4 + cudaDevP2PAttrOnlyPartialNativeAtomicSupported = 5 + + cdef enum cudaAtomicOperation: + cudaAtomicOperationIntegerAdd = 0 + cudaAtomicOperationIntegerMin = 1 + cudaAtomicOperationIntegerMax = 2 + cudaAtomicOperationIntegerIncrement = 3 + cudaAtomicOperationIntegerDecrement = 4 + cudaAtomicOperationAnd = 5 + cudaAtomicOperationOr = 6 + cudaAtomicOperationXOR = 7 + cudaAtomicOperationExchange = 8 + cudaAtomicOperationCAS = 9 + cudaAtomicOperationFloatAdd = 10 + cudaAtomicOperationFloatMin = 11 + cudaAtomicOperationFloatMax = 12 + + cdef enum cudaAtomicOperationCapability: + cudaAtomicCapabilitySigned = 1 + cudaAtomicCapabilityUnsigned = 2 + cudaAtomicCapabilityReduction = 4 + cudaAtomicCapabilityScalar32 = 8 + cudaAtomicCapabilityScalar64 = 16 + cudaAtomicCapabilityScalar128 = 32 + cudaAtomicCapabilityVector32x4 = 64 cdef enum cudaExternalMemoryHandleType: cudaExternalMemoryHandleTypeOpaqueFd = 1 @@ -1364,7 +1417,7 @@ cdef extern from "driver_types.h": cdef enum cudaCGScope: cudaCGScopeInvalid = 0 cudaCGScopeGrid = 1 - cudaCGScopeMultiGrid = 2 + cudaCGScopeReserved = 2 cdef enum cudaGraphConditionalHandleFlags: cudaGraphCondAssignDefault = 1 @@ -1531,6 +1584,13 @@ cdef extern from "library_types.h": ctypedef cudaDataType_t cudaDataType + cdef enum cudaEmulationStrategy_t: + CUDA_EMULATION_STRATEGY_DEFAULT = 0 + CUDA_EMULATION_STRATEGY_PERFORMANT = 1 + CUDA_EMULATION_STRATEGY_EAGER = 2 + + ctypedef cudaEmulationStrategy_t cudaEmulationStrategy + cdef enum libraryPropertyType_t: MAJOR_VERSION = 0 MINOR_VERSION = 1 @@ -1542,6 +1602,8 @@ cdef extern from "cuda_runtime_api.h": ctypedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void* userData) + ctypedef void (*cudaLogsCallback_t)(void* data, cudaLogLevel logLevel, char* message, size_t length) + cdef extern from "device_types.h": cdef enum cudaRoundMode: diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in index 938bbdced..4e2a8bf32 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cydriver as cydriver cimport cuda.bindings._lib.utils as utils @@ -673,7 +673,7 @@ cdef class CUstreamMemOpWaitValueParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue.flags' in found_struct}} flags : unsigned int - + See CUstreamWaitValue_flags. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} alias : CUdeviceptr @@ -723,7 +723,7 @@ cdef class CUstreamMemOpWriteValueParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue.flags' in found_struct}} flags : unsigned int - + See CUstreamWriteValue_flags. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} alias : CUdeviceptr @@ -761,7 +761,7 @@ cdef class CUstreamMemOpFlushRemoteWritesParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} flags : unsigned int - + Must be 0. {{endif}} Methods @@ -803,23 +803,26 @@ cdef class CUstreamBatchMemOpParams_union: ---------- {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} operation : CUstreamBatchMemOpType - + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} waitValue : CUstreamMemOpWaitValueParams_st - + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} writeValue : CUstreamMemOpWriteValueParams_st - + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st - + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} memoryBarrier : CUstreamMemOpMemoryBarrierParams_st - + Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} pad : List[cuuint64_t] @@ -850,6 +853,9 @@ cdef class CUstreamBatchMemOpParams_union: cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + Attributes ---------- {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} @@ -1901,6 +1907,10 @@ cdef class CUlaunchAttributeValue_union: Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -3085,8 +3095,8 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: cdef class CUtensorMap_st: """ - Tensor map descriptor. Requires compiler support for aligning to 64 - bytes. + Tensor map descriptor. Requires compiler support for aligning to + 128 bytes. Attributes ---------- @@ -5016,17 +5026,21 @@ cdef class CUcheckpointCheckpointArgs_st: cdef cydriver.CUcheckpointCheckpointArgs_st _pvt_val cdef cydriver.CUcheckpointCheckpointArgs_st* _pvt_ptr {{endif}} -{{if 'CUcheckpointRestoreArgs_st' in found_struct}} +{{if 'CUcheckpointGpuPair_st' in found_struct}} -cdef class CUcheckpointRestoreArgs_st: +cdef class CUcheckpointGpuPair_st: """ - CUDA checkpoint optional restore arguments + CUDA checkpoint GPU UUID pairs for device remapping during restore Attributes ---------- - {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] - Reserved for future use, must be zeroed + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + oldUuid : CUuuid + UUID of the GPU that was checkpointed + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + newUuid : CUuuid + UUID of the GPU to restore onto {{endif}} Methods @@ -5034,8 +5048,14 @@ cdef class CUcheckpointRestoreArgs_st: getPtr() Get memory address of class instance """ - cdef cydriver.CUcheckpointRestoreArgs_st _pvt_val - cdef cydriver.CUcheckpointRestoreArgs_st* _pvt_ptr + cdef cydriver.CUcheckpointGpuPair_st _pvt_val + cdef cydriver.CUcheckpointGpuPair_st* _pvt_ptr + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + cdef CUuuid _oldUuid + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + cdef CUuuid _newUuid + {{endif}} {{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} @@ -5124,6 +5144,19 @@ cdef class CUdevSmResource_st: The amount of streaming multiprocessors available in this resource. This is an output parameter only, do not write to this field. {{endif}} + {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. This is an output parameter only, do not + write to this field. + {{endif}} + {{if 'CUdevSmResource_st.smCoscheduledAlignment' in found_struct}} + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount is a multiple of this value. This is an output parameter + only, do not write to this field. + {{endif}} Methods ------- @@ -5483,23 +5516,26 @@ cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): ---------- {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} operation : CUstreamBatchMemOpType - + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} waitValue : CUstreamMemOpWaitValueParams_st - + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} writeValue : CUstreamMemOpWriteValueParams_st - + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st - + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} memoryBarrier : CUstreamMemOpMemoryBarrierParams_st - + Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} pad : List[cuuint64_t] @@ -5523,23 +5559,26 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): ---------- {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} operation : CUstreamBatchMemOpType - + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} waitValue : CUstreamMemOpWaitValueParams_st - + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} writeValue : CUstreamMemOpWriteValueParams_st - + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st - + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} memoryBarrier : CUstreamMemOpMemoryBarrierParams_st - + Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} pad : List[cuuint64_t] @@ -5557,6 +5596,9 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st): """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + Attributes ---------- {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} @@ -5587,6 +5629,9 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st) cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + Attributes ---------- {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} @@ -6550,6 +6595,10 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -6747,6 +6796,10 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -6864,6 +6917,10 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -6981,6 +7038,10 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -7098,6 +7159,10 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -8489,8 +8554,8 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): cdef class CUtensorMap(CUtensorMap_st): """ - Tensor map descriptor. Requires compiler support for aligning to 64 - bytes. + Tensor map descriptor. Requires compiler support for aligning to + 128 bytes. Attributes ---------- @@ -10473,17 +10538,21 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): """ pass {{endif}} -{{if 'CUcheckpointRestoreArgs' in found_types}} +{{if 'CUcheckpointGpuPair' in found_types}} -cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): +cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): """ - CUDA checkpoint optional restore arguments + CUDA checkpoint GPU UUID pairs for device remapping during restore Attributes ---------- - {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] - Reserved for future use, must be zeroed + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + oldUuid : CUuuid + UUID of the GPU that was checkpointed + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + newUuid : CUuuid + UUID of the GPU to restore onto {{endif}} Methods @@ -10578,6 +10647,19 @@ cdef class CUdevSmResource(CUdevSmResource_st): The amount of streaming multiprocessors available in this resource. This is an output parameter only, do not write to this field. {{endif}} + {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. This is an output parameter only, do not + write to this field. + {{endif}} + {{if 'CUdevSmResource_st.smCoscheduledAlignment' in found_struct}} + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount is a multiple of this value. This is an output parameter + only, do not write to this field. + {{endif}} Methods ------- diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index adce0af72..e045e1ee3 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from typing import List, Tuple, Any, Optional from enum import IntEnum import cython @@ -695,7 +695,7 @@ _dict_CUstreamBatchMemOpType = dict(((int(v), v) for k, v in CUstreamBatchMemOpT class CUstreamMemoryBarrier_flags(IntEnum): """ - Flags for :py:obj:`~.CUstreamBatchMemOpParams`::memoryBarrier + Flags for :py:obj:`~.CUstreamBatchMemOpParams.memoryBarrier` """ {{if 'CU_STREAM_MEMORY_BARRIER_TYPE_SYS' in found_values}} @@ -1398,7 +1398,7 @@ class CUdevice_attribute(IntEnum): CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID{{endif}} {{if 'CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED' in found_values}} - #: Link between the device and the host supports native atomic + #: Link between the device and the host supports all native atomic #: operations CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED{{endif}} {{if 'CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO' in found_values}} @@ -1680,6 +1680,27 @@ class CUdevice_attribute(IntEnum): #: Device supports HOST_NUMA location IPC between nodes in a multi-node #: system. CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED{{endif}} + {{if 'CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED' in found_values}} + + #: Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` + #: and :py:obj:`~.cuMemPool` family of APIs + CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED{{endif}} + {{if 'CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED' in found_values}} + + #: Device supports HOST location with the virtual memory management + #: APIs like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related + #: APIs + CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED{{endif}} + {{if 'CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED' in found_values}} + + #: Device supports page-locked host memory buffer sharing with dma_buf + #: mechanism. + CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED{{endif}} + {{if 'CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED' in found_values}} + + #: Link between the device and the host supports only some native + #: atomic operations + CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED{{endif}} {{if 'CU_DEVICE_ATTRIBUTE_MAX' in found_values}} CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX{{endif}} @@ -1851,7 +1872,15 @@ class CUfunction_attribute(IntEnum): #: The maximum size in bytes of dynamically-allocated shared memory #: that can be used by this function. If the user-specified dynamic #: shared memory size is larger than this value, the launch will fail. - #: See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + #: The default value of this attribute is + #: :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` - + #: :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`, except when + #: :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` is greater than + #: :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`, then + #: the default value of this attribute is 0. The value can be increased + #: to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` + #: - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. See + #: :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES{{endif}} {{if 'CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT' in found_values}} @@ -2391,6 +2420,16 @@ class CUjit_option(IntEnum): #: directives. (0: Disable, default; 1: Enable) Option type: int #: Applies to: compiler only CU_JIT_OVERRIDE_DIRECTIVE_VALUES = cydriver.CUjit_option_enum.CU_JIT_OVERRIDE_DIRECTIVE_VALUES{{endif}} + {{if 'CU_JIT_SPLIT_COMPILE' in found_values}} + + #: This option specifies the maximum number of concurrent threads to + #: use when running compiler optimizations. If the specified value is + #: 1, the option will be ignored. If the specified value is 0, the + #: number of threads will match the number of CPUs on the underlying + #: machine. Otherwise, if the option is N, then up to N threads will be + #: used. Option type: unsigned int + #: Applies to: compiler only + CU_JIT_SPLIT_COMPILE = cydriver.CUjit_option_enum.CU_JIT_SPLIT_COMPILE{{endif}} {{if 'CU_JIT_NUM_OPTIONS' in found_values}} CU_JIT_NUM_OPTIONS = cydriver.CUjit_option_enum.CU_JIT_NUM_OPTIONS{{endif}} @@ -2478,14 +2517,14 @@ class CUjit_target(IntEnum): #: Compute device class 10.0. CU_TARGET_COMPUTE_100 = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100{{endif}} - {{if 'CU_TARGET_COMPUTE_101' in found_values}} - - #: Compute device class 10.1. - CU_TARGET_COMPUTE_101 = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101{{endif}} {{if 'CU_TARGET_COMPUTE_103' in found_values}} #: Compute device class 10.3. CU_TARGET_COMPUTE_103 = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103{{endif}} + {{if 'CU_TARGET_COMPUTE_110' in found_values}} + + #: Compute device class 11.0. + CU_TARGET_COMPUTE_110 = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110{{endif}} {{if 'CU_TARGET_COMPUTE_120' in found_values}} #: Compute device class 12.0. @@ -2501,16 +2540,16 @@ class CUjit_target(IntEnum): CU_TARGET_COMPUTE_90A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_90A{{endif}} {{if 'CU_TARGET_COMPUTE_100A' in found_values}} - #: Compute device class 10.1 with accelerated features. + #: Compute device class 11.0 with accelerated features. CU_TARGET_COMPUTE_100A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100A{{endif}} - {{if 'CU_TARGET_COMPUTE_101A' in found_values}} - - #: Compute device class 10.3. with accelerated features. - CU_TARGET_COMPUTE_101A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101A{{endif}} {{if 'CU_TARGET_COMPUTE_103A' in found_values}} #: Compute device class 12.0. with accelerated features. CU_TARGET_COMPUTE_103A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103A{{endif}} + {{if 'CU_TARGET_COMPUTE_110A' in found_values}} + + #: Compute device class 10.3. with accelerated features. + CU_TARGET_COMPUTE_110A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110A{{endif}} {{if 'CU_TARGET_COMPUTE_120A' in found_values}} #: Compute device class 12.1. with accelerated features. @@ -2521,16 +2560,16 @@ class CUjit_target(IntEnum): CU_TARGET_COMPUTE_121A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121A{{endif}} {{if 'CU_TARGET_COMPUTE_100F' in found_values}} - #: Compute device class 10.1 with family features. + #: Compute device class 11.0 with family features. CU_TARGET_COMPUTE_100F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100F{{endif}} - {{if 'CU_TARGET_COMPUTE_101F' in found_values}} - - #: Compute device class 10.3. with family features. - CU_TARGET_COMPUTE_101F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101F{{endif}} {{if 'CU_TARGET_COMPUTE_103F' in found_values}} #: Compute device class 12.0. with family features. CU_TARGET_COMPUTE_103F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103F{{endif}} + {{if 'CU_TARGET_COMPUTE_110F' in found_values}} + + #: Compute device class 10.3. with family features. + CU_TARGET_COMPUTE_110F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110F{{endif}} {{if 'CU_TARGET_COMPUTE_120F' in found_values}} #: Compute device class 12.1. with family features. @@ -2876,7 +2915,8 @@ class CUgraphNodeType(IntEnum): CU_GRAPH_NODE_TYPE_MEM_FREE = cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE{{endif}} {{if 'CU_GRAPH_NODE_TYPE_BATCH_MEM_OP' in found_values}} - #: Batch MemOp Node + #: Batch MemOp Node See :py:obj:`~.cuStreamBatchMemOp` and + #: :py:obj:`~.CUstreamBatchMemOpType` for what these nodes can do. CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP{{endif}} {{if 'CU_GRAPH_NODE_TYPE_CONDITIONAL' in found_values}} @@ -3231,6 +3271,29 @@ class CUlaunchAttributeID(IntEnum): #: is only a hint, and the CUDA driver can choose a different #: configuration if required for the launch. CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT{{endif}} + {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are + #: 0 (disabled) and 1 (enabled). + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} _dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} @@ -3431,6 +3494,12 @@ class CUresult(IntEnum): #: is a stub library. Applications that run with the stub rather than a #: real driver loaded will result in CUDA API returning this error. CUDA_ERROR_STUB_LIBRARY = cydriver.cudaError_enum.CUDA_ERROR_STUB_LIBRARY{{endif}} + {{if 'CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER' in found_values}} + + #: This indicates that the API call requires a newer CUDA driver than + #: the one currently installed. Users should install an updated NVIDIA + #: CUDA driver to allow the API call to succeed. + CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER = cydriver.cudaError_enum.CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER{{endif}} {{if 'CUDA_ERROR_DEVICE_UNAVAILABLE' in found_values}} #: This indicates that requested CUDA device is unavailable at the @@ -3981,7 +4050,7 @@ class CUdevice_P2PAttribute(IntEnum): CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED{{endif}} {{if 'CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED' in found_values}} - #: Atomic operation over the link supported + #: All CUDA-valid atomic operation over the link are supported CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED{{endif}} {{if 'CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED' in found_values}} @@ -3991,9 +4060,73 @@ class CUdevice_P2PAttribute(IntEnum): #: Accessing CUDA arrays over the link supported CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED{{endif}} + {{if 'CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED' in found_values}} + + #: Only some CUDA-valid atomic operations over the link are supported. + CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED{{endif}} _dict_CUdevice_P2PAttribute = dict(((int(v), v) for k, v in CUdevice_P2PAttribute.__members__.items())) {{endif}} +{{if 'CUatomicOperation_enum' in found_types}} + +class CUatomicOperation(IntEnum): + """ + CUDA-valid Atomic Operations + """ + {{if 'CU_ATOMIC_OPERATION_INTEGER_ADD' in found_values}} + CU_ATOMIC_OPERATION_INTEGER_ADD = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_ADD{{endif}} + {{if 'CU_ATOMIC_OPERATION_INTEGER_MIN' in found_values}} + CU_ATOMIC_OPERATION_INTEGER_MIN = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_MIN{{endif}} + {{if 'CU_ATOMIC_OPERATION_INTEGER_MAX' in found_values}} + CU_ATOMIC_OPERATION_INTEGER_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_MAX{{endif}} + {{if 'CU_ATOMIC_OPERATION_INTEGER_INCREMENT' in found_values}} + CU_ATOMIC_OPERATION_INTEGER_INCREMENT = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_INCREMENT{{endif}} + {{if 'CU_ATOMIC_OPERATION_INTEGER_DECREMENT' in found_values}} + CU_ATOMIC_OPERATION_INTEGER_DECREMENT = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_DECREMENT{{endif}} + {{if 'CU_ATOMIC_OPERATION_AND' in found_values}} + CU_ATOMIC_OPERATION_AND = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_AND{{endif}} + {{if 'CU_ATOMIC_OPERATION_OR' in found_values}} + CU_ATOMIC_OPERATION_OR = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_OR{{endif}} + {{if 'CU_ATOMIC_OPERATION_XOR' in found_values}} + CU_ATOMIC_OPERATION_XOR = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_XOR{{endif}} + {{if 'CU_ATOMIC_OPERATION_EXCHANGE' in found_values}} + CU_ATOMIC_OPERATION_EXCHANGE = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_EXCHANGE{{endif}} + {{if 'CU_ATOMIC_OPERATION_CAS' in found_values}} + CU_ATOMIC_OPERATION_CAS = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_CAS{{endif}} + {{if 'CU_ATOMIC_OPERATION_FLOAT_ADD' in found_values}} + CU_ATOMIC_OPERATION_FLOAT_ADD = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_ADD{{endif}} + {{if 'CU_ATOMIC_OPERATION_FLOAT_MIN' in found_values}} + CU_ATOMIC_OPERATION_FLOAT_MIN = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_MIN{{endif}} + {{if 'CU_ATOMIC_OPERATION_FLOAT_MAX' in found_values}} + CU_ATOMIC_OPERATION_FLOAT_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_MAX{{endif}} + {{if 'CU_ATOMIC_OPERATION_MAX' in found_values}} + CU_ATOMIC_OPERATION_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_MAX{{endif}} + +_dict_CUatomicOperation = dict(((int(v), v) for k, v in CUatomicOperation.__members__.items())) +{{endif}} +{{if 'CUatomicOperationCapability_enum' in found_types}} + +class CUatomicOperationCapability(IntEnum): + """ + CUDA-valid Atomic Operation capabilities + """ + {{if 'CU_ATOMIC_CAPABILITY_SIGNED' in found_values}} + CU_ATOMIC_CAPABILITY_SIGNED = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SIGNED{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_UNSIGNED' in found_values}} + CU_ATOMIC_CAPABILITY_UNSIGNED = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_UNSIGNED{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_REDUCTION' in found_values}} + CU_ATOMIC_CAPABILITY_REDUCTION = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_REDUCTION{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_SCALAR_32' in found_values}} + CU_ATOMIC_CAPABILITY_SCALAR_32 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_32{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_SCALAR_64' in found_values}} + CU_ATOMIC_CAPABILITY_SCALAR_64 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_64{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_SCALAR_128' in found_values}} + CU_ATOMIC_CAPABILITY_SCALAR_128 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_128{{endif}} + {{if 'CU_ATOMIC_CAPABILITY_VECTOR_32x4' in found_values}} + CU_ATOMIC_CAPABILITY_VECTOR_32x4 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_VECTOR_32x4{{endif}} + +_dict_CUatomicOperationCapability = dict(((int(v), v) for k, v in CUatomicOperationCapability.__members__.items())) +{{endif}} {{if 'CUresourceViewFormat_enum' in found_types}} class CUresourceViewFormat(IntEnum): @@ -4329,6 +4462,10 @@ class CUexternalMemoryHandleType(IntEnum): #: Handle is an NvSciBuf object CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF{{endif}} + {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD' in found_values}} + + #: Handle is a dma_buf file descriptor + CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD{{endif}} _dict_CUexternalMemoryHandleType = dict(((int(v), v) for k, v in CUexternalMemoryHandleType.__members__.items())) {{endif}} @@ -4446,6 +4583,11 @@ class CUmemLocationType(IntEnum): """ {{if 'CU_MEM_LOCATION_TYPE_INVALID' in found_values}} CU_MEM_LOCATION_TYPE_INVALID = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_INVALID{{endif}} + {{if 'CU_MEM_LOCATION_TYPE_NONE' in found_values}} + + #: Location is unspecified. This is used when creating a managed memory + #: pool to indicate no preferred location for the pool + CU_MEM_LOCATION_TYPE_NONE = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_NONE{{endif}} {{if 'CU_MEM_LOCATION_TYPE_DEVICE' in found_values}} #: Location is a device location, thus id is a device ordinal @@ -4480,6 +4622,10 @@ class CUmemAllocationType(IntEnum): #: This allocation type is 'pinned', i.e. cannot migrate from its #: current location while the application is actively using it CU_MEM_ALLOCATION_TYPE_PINNED = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_PINNED{{endif}} + {{if 'CU_MEM_ALLOCATION_TYPE_MANAGED' in found_values}} + + #: This allocation type is managed memory + CU_MEM_ALLOCATION_TYPE_MANAGED = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MANAGED{{endif}} {{if 'CU_MEM_ALLOCATION_TYPE_MAX' in found_values}} CU_MEM_ALLOCATION_TYPE_MAX = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MAX{{endif}} @@ -6277,6 +6423,29 @@ class CUkernelNodeAttrID(IntEnum): #: is only a hint, and the CUDA driver can choose a different #: configuration if required for the launch. CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT{{endif}} + {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are + #: 0 (disabled) and 1 (enabled). + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} _dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} @@ -6469,6 +6638,29 @@ class CUstreamAttrID(IntEnum): #: is only a hint, and the CUDA driver can choose a different #: configuration if required for the launch. CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT{{endif}} + {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are + #: 0 (disabled) and 1 (enabled). + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} _dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} @@ -7955,7 +8147,7 @@ cdef class CUstreamMemOpWaitValueParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue.flags' in found_struct}} flags : unsigned int - + See CUstreamWaitValue_flags. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} alias : CUdeviceptr @@ -8145,7 +8337,7 @@ cdef class CUstreamMemOpWriteValueParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue.flags' in found_struct}} flags : unsigned int - + See CUstreamWriteValue_flags. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} alias : CUdeviceptr @@ -8323,7 +8515,7 @@ cdef class CUstreamMemOpFlushRemoteWritesParams_st: {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} flags : unsigned int - + Must be 0. {{endif}} Methods @@ -8453,23 +8645,26 @@ cdef class CUstreamBatchMemOpParams_union: ---------- {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} operation : CUstreamBatchMemOpType - + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. {{endif}} {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} waitValue : CUstreamMemOpWaitValueParams_st - + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} writeValue : CUstreamMemOpWriteValueParams_st - + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st - + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} memoryBarrier : CUstreamMemOpMemoryBarrierParams_st - + Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} pad : List[cuuint64_t] @@ -8602,6 +8797,9 @@ cdef class CUstreamBatchMemOpParams_union: cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + Attributes ---------- {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} @@ -11713,6 +11911,10 @@ cdef class CUlaunchAttributeValue_union: Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + + {{endif}} Methods ------- @@ -11844,6 +12046,12 @@ cdef class CUlaunchAttributeValue_union: except ValueError: str_list += ['sharedMemCarveout : '] {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + try: + str_list += ['nvlinkUtilCentricScheduling : ' + str(self.nvlinkUtilCentricScheduling)] + except ValueError: + str_list += ['nvlinkUtilCentricScheduling : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -11984,6 +12192,14 @@ cdef class CUlaunchAttributeValue_union: def sharedMemCarveout(self, unsigned int sharedMemCarveout): self._pvt_ptr[0].sharedMemCarveout = sharedMemCarveout {{endif}} + {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + @property + def nvlinkUtilCentricScheduling(self): + return self._pvt_ptr[0].nvlinkUtilCentricScheduling + @nvlinkUtilCentricScheduling.setter + def nvlinkUtilCentricScheduling(self, unsigned int nvlinkUtilCentricScheduling): + self._pvt_ptr[0].nvlinkUtilCentricScheduling = nvlinkUtilCentricScheduling + {{endif}} {{endif}} {{if 'CUlaunchAttribute_st' in found_struct}} @@ -15987,8 +16203,8 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: cdef class CUtensorMap_st: """ - Tensor map descriptor. Requires compiler support for aligning to 64 - bytes. + Tensor map descriptor. Requires compiler support for aligning to + 128 bytes. Attributes ---------- @@ -21767,17 +21983,21 @@ cdef class CUcheckpointCheckpointArgs_st: {{endif}} {{endif}} -{{if 'CUcheckpointRestoreArgs_st' in found_struct}} +{{if 'CUcheckpointGpuPair_st' in found_struct}} -cdef class CUcheckpointRestoreArgs_st: +cdef class CUcheckpointGpuPair_st: """ - CUDA checkpoint optional restore arguments + CUDA checkpoint GPU UUID pairs for device remapping during restore Attributes ---------- - {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] - Reserved for future use, must be zeroed + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + oldUuid : CUuuid + UUID of the GPU that was checkpointed + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + newUuid : CUuuid + UUID of the GPU to restore onto {{endif}} Methods @@ -21789,9 +22009,15 @@ cdef class CUcheckpointRestoreArgs_st: if _ptr == 0: self._pvt_ptr = &self._pvt_val else: - self._pvt_ptr = _ptr + self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + self._oldUuid = CUuuid(_ptr=&self._pvt_ptr[0].oldUuid) + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + self._newUuid = CUuuid(_ptr=&self._pvt_ptr[0].newUuid) + {{endif}} def __dealloc__(self): pass def getPtr(self): @@ -21799,23 +22025,36 @@ cdef class CUcheckpointRestoreArgs_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['oldUuid :\n' + '\n'.join([' ' + line for line in str(self.oldUuid).splitlines()])] except ValueError: - str_list += ['reserved : '] + str_list += ['oldUuid : '] + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + try: + str_list += ['newUuid :\n' + '\n'.join([' ' + line for line in str(self.newUuid).splitlines()])] + except ValueError: + str_list += ['newUuid : '] {{endif}} return '\n'.join(str_list) else: return '' - {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} @property - def reserved(self): - return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - + def oldUuid(self): + return self._oldUuid + @oldUuid.setter + def oldUuid(self, oldUuid not None : CUuuid): + string.memcpy(&self._pvt_ptr[0].oldUuid, oldUuid.getPtr(), sizeof(self._pvt_ptr[0].oldUuid)) + {{endif}} + {{if 'CUcheckpointGpuPair_st.newUuid' in found_struct}} + @property + def newUuid(self): + return self._newUuid + @newUuid.setter + def newUuid(self, newUuid not None : CUuuid): + string.memcpy(&self._pvt_ptr[0].newUuid, newUuid.getPtr(), sizeof(self._pvt_ptr[0].newUuid)) {{endif}} {{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} @@ -22052,6 +22291,19 @@ cdef class CUdevSmResource_st: The amount of streaming multiprocessors available in this resource. This is an output parameter only, do not write to this field. {{endif}} + {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. This is an output parameter only, do not + write to this field. + {{endif}} + {{if 'CUdevSmResource_st.smCoscheduledAlignment' in found_struct}} + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount is a multiple of this value. This is an output parameter + only, do not write to this field. + {{endif}} Methods ------- @@ -22078,6 +22330,18 @@ cdef class CUdevSmResource_st: except ValueError: str_list += ['smCount : '] {{endif}} + {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + try: + str_list += ['minSmPartitionSize : ' + str(self.minSmPartitionSize)] + except ValueError: + str_list += ['minSmPartitionSize : '] + {{endif}} + {{if 'CUdevSmResource_st.smCoscheduledAlignment' in found_struct}} + try: + str_list += ['smCoscheduledAlignment : ' + str(self.smCoscheduledAlignment)] + except ValueError: + str_list += ['smCoscheduledAlignment : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -22089,6 +22353,22 @@ cdef class CUdevSmResource_st: def smCount(self, unsigned int smCount): self._pvt_ptr[0].smCount = smCount {{endif}} + {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + @property + def minSmPartitionSize(self): + return self._pvt_ptr[0].minSmPartitionSize + @minSmPartitionSize.setter + def minSmPartitionSize(self, unsigned int minSmPartitionSize): + self._pvt_ptr[0].minSmPartitionSize = minSmPartitionSize + {{endif}} + {{if 'CUdevSmResource_st.smCoscheduledAlignment' in found_struct}} + @property + def smCoscheduledAlignment(self): + return self._pvt_ptr[0].smCoscheduledAlignment + @smCoscheduledAlignment.setter + def smCoscheduledAlignment(self, unsigned int smCoscheduledAlignment): + self._pvt_ptr[0].smCoscheduledAlignment = smCoscheduledAlignment + {{endif}} {{endif}} {{if 'CUdevResource_st' in found_struct}} @@ -23009,6 +23289,12 @@ def cuGetErrorName(error not None : CUresult): def cuInit(unsigned int Flags): """ Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the `Flags` parameter must be 0. If :py:obj:`~.cuInit()` has not been called, any function from the driver API will return :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`. + Note: cuInit preloads various libraries needed for JIT compilation. To + opt-out of this behavior, set the environment variable + CUDA_FORCE_PRELOAD_LIBRARIES=0. CUDA will lazily load JIT libraries as + needed. To disable JIT entirely, set the environment variable + CUDA_DISABLE_JIT=1. + Parameters ---------- Flags : unsigned int @@ -23164,57 +23450,12 @@ def cuDeviceGetName(int length, dev): return (_dict_CUresult[err], pyname) {{endif}} -{{if 'cuDeviceGetUuid' in found_functions}} +{{if 'cuDeviceGetUuid_v2' in found_functions}} @cython.embedsignature(True) def cuDeviceGetUuid(dev): """ Return an UUID for the device. - Note there is a later version of this API, - :py:obj:`~.cuDeviceGetUuid_v2`. It will supplant this version in 12.0, - which is retained for minor version compatibility. - - Returns 16-octets identifying the device `dev` in the structure pointed - by the `uuid`. - - Parameters - ---------- - dev : :py:obj:`~.CUdevice` - Device to get identifier string for - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - uuid : :py:obj:`~.CUuuid` - Returned UUID - - See Also - -------- - :py:obj:`~.cuDeviceGetUuid_v2` :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaGetDeviceProperties` - """ - cdef cydriver.CUdevice cydev - if dev is None: - pdev = 0 - elif isinstance(dev, (CUdevice,)): - pdev = int(dev) - else: - pdev = int(CUdevice(dev)) - cydev = pdev - cdef CUuuid uuid = CUuuid() - with nogil: - err = cydriver.cuDeviceGetUuid(uuid._pvt_ptr, cydev) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], uuid) -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} - -@cython.embedsignature(True) -def cuDeviceGetUuid_v2(dev): - """ Return an UUID for the device (11.4+) - Returns 16-octets identifying the device `dev` in the structure pointed by the `uuid`. If the device is in MIG mode, returns its MIG UUID which uniquely identifies the subscribed MIG compute instance. @@ -23245,7 +23486,7 @@ def cuDeviceGetUuid_v2(dev): cydev = pdev cdef CUuuid uuid = CUuuid() with nogil: - err = cydriver.cuDeviceGetUuid_v2(uuid._pvt_ptr, cydev) + err = cydriver.cuDeviceGetUuid(uuid._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: return (_dict_CUresult[err], None) return (_dict_CUresult[err], uuid) @@ -23391,409 +23632,7 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): """ Returns information about the device. Returns in `*pi` the integer value of the attribute `attrib` on device - `dev`. The supported attributes are: - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK`: Maximum number - of threads per block; - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X`: Maximum x-dimension - of a block - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y`: Maximum y-dimension - of a block - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z`: Maximum z-dimension - of a block - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X`: Maximum x-dimension - of a grid - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y`: Maximum y-dimension - of a grid - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z`: Maximum z-dimension - of a grid - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`: Maximum - amount of shared memory available to a thread block in bytes - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY`: Memory - available on device for constant variables in a CUDA C kernel in - bytes - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_WARP_SIZE`: Warp size in threads - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`: Maximum pitch in bytes - allowed by the memory copy functions that involve memory regions - allocated through :py:obj:`~.cuMemAllocPitch()` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`: Maximum 1D - texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`: - Maximum width for a 1D texture bound to linear memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH`: - Maximum mipmapped 1D texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH`: Maximum 2D - texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT`: Maximum 2D - texture height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`: - Maximum width for a 2D texture bound to linear memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`: - Maximum height for a 2D texture bound to linear memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`: - Maximum pitch in bytes for a 2D texture bound to linear memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH`: - Maximum mipmapped 2D texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT`: - Maximum mipmapped 2D texture height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH`: Maximum 3D - texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT`: Maximum 3D - texture height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH`: Maximum 3D - texture depth - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE`: - Alternate maximum 3D texture width, 0 if no alternate maximum 3D - texture size is supported - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE`: - Alternate maximum 3D texture height, 0 if no alternate maximum 3D - texture size is supported - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE`: - Alternate maximum 3D texture depth, 0 if no alternate maximum 3D - texture size is supported - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH`: Maximum - cubemap texture width or height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH`: - Maximum 1D layered texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS`: - Maximum layers in a 1D layered texture - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH`: - Maximum 2D layered texture width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT`: - Maximum 2D layered texture height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS`: - Maximum layers in a 2D layered texture - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH`: - Maximum cubemap layered texture width or height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS`: - Maximum layers in a cubemap layered texture - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH`: Maximum 1D - surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH`: Maximum 2D - surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT`: Maximum 2D - surface height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH`: Maximum 3D - surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT`: Maximum 3D - surface height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH`: Maximum 3D - surface depth - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH`: - Maximum 1D layered surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS`: - Maximum layers in a 1D layered surface - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH`: - Maximum 2D layered surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT`: - Maximum 2D layered surface height - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS`: - Maximum layers in a 2D layered surface - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH`: Maximum - cubemap surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH`: - Maximum cubemap layered surface width - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS`: - Maximum layers in a cubemap layered surface - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK`: Maximum - number of 32-bit registers available to a thread block - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CLOCK_RATE`: The typical clock - frequency in kilohertz - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`: Alignment - requirement; texture base addresses aligned to - :py:obj:`~.textureAlign` bytes do not need an offset applied to - texture fetches - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`: Pitch - alignment requirement for 2D texture references bound to pitched - memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP`: 1 if the device can - concurrently copy memory between host and device while executing a - kernel, or 0 if not - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`: Number of - multiprocessors on the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT`: 1 if there is a - run time limit for kernels executed on the device, or 0 if not - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_INTEGRATED`: 1 if the device is - integrated with the memory subsystem, or 0 if not - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY`: 1 if the device - can map host memory into the CUDA address space, or 0 if not - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`: Compute mode that - device is currently in. Available modes are as follows: - - - :py:obj:`~.CU_COMPUTEMODE_DEFAULT`: Default mode - Device is not - restricted and can have multiple CUDA contexts present at a single - time. - - - :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`: Compute-prohibited mode - - Device is prohibited from creating new CUDA contexts. - - - :py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS`: Compute-exclusive- - process mode - Device can have only one context used by a single - process at a time. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS`: 1 if the device - supports executing multiple kernels within the same context - simultaneously, or 0 if not. It is not guaranteed that multiple - kernels will be resident on the device concurrently so this feature - should not be relied upon for correctness. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_ECC_ENABLED`: 1 if error correction is - enabled on the device, 0 if error correction is disabled or not - supported by the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID`: PCI bus identifier of the - device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID`: PCI device (also known - as slot) identifier of the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID`: PCI domain identifier - of the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TCC_DRIVER`: 1 if the device is using - a TCC driver. TCC is only available on Tesla hardware running Windows - Vista or later - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE`: Peak memory clock - frequency in kilohertz - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH`: Global - memory bus width in bits - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE`: Size of L2 cache in - bytes. 0 if the device doesn't have L2 cache - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR`: - Maximum resident threads per multiprocessor - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`: 1 if the device - shares a unified address space with the host, or 0 if not - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR`: Major - compute capability version number - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR`: Minor - compute capability version number - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED`: 1 if - device supports caching globals in L1 cache, 0 if caching globals in - L1 cache is not supported by the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED`: 1 if device - supports caching locals in L1 cache, 0 if caching locals in L1 cache - is not supported by the device - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`: - Maximum amount of shared memory available to a multiprocessor in - bytes; this amount is shared by all thread blocks simultaneously - resident on a multiprocessor - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR`: - Maximum number of 32-bit registers available to a multiprocessor; - this number is shared by all thread blocks simultaneously resident on - a multiprocessor - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`: 1 if device supports - allocating managed memory on this system, 0 if allocating managed - memory is not supported by the device on this system. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD`: 1 if device is on a - multi-GPU board, 0 if not. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID`: Unique - identifier for a group of devices associated with the same board. - Devices on the same multi-GPU board will share the same identifier. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED`: 1 if - Link between the device and the host supports native atomic - operations. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO`: - Ratio of single precision performance (in floating-point operations - per second) to double precision performance. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`: Device - supports coherently accessing pageable memory without calling - cudaHostRegister on it. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`: Device can - coherently access managed memory concurrently with the CPU. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED`: Device - supports Compute Preemption. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`: - Device can access host registered memory at the same virtual address - as the CPU. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`: - The maximum per block shared memory size supported on this device. - This is the maximum value that can be opted into when using the - :py:obj:`~.cuFuncSetAttribute()` or - :py:obj:`~.cuKernelSetAttribute()` call. For more details see - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`: - Device accesses pageable memory via the host's page tables. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST`: - The host can directly access managed memory on the device without - migration. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`: - Device supports virtual memory management APIs like - :py:obj:`~.cuMemAddressReserve`, :py:obj:`~.cuMemCreate`, - :py:obj:`~.cuMemMap` and related APIs - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED`: - Device supports exporting memory to a posix file descriptor with - :py:obj:`~.cuMemExportToShareableHandle`, if requested via - :py:obj:`~.cuMemCreate` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED`: - Device supports exporting memory to a Win32 NT handle with - :py:obj:`~.cuMemExportToShareableHandle`, if requested via - :py:obj:`~.cuMemCreate` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED`: - Device supports exporting memory to a Win32 KMT handle with - :py:obj:`~.cuMemExportToShareableHandle`, if requested via - :py:obj:`~.cuMemCreate` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR`: - Maximum number of thread blocks that can reside on a multiprocessor - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED`: Device - supports compressible memory allocation via :py:obj:`~.cuMemCreate` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE`: Maximum - L2 persisting lines capacity setting in bytes - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE`: - Maximum value of :py:obj:`~.CUaccessPolicyWindow.num_bytes` - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED`: - Device supports specifying the GPUDirect RDMA flag with - :py:obj:`~.cuMemCreate`. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK`: - Amount of shared memory per block reserved by CUDA driver in bytes - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED`: Device - supports sparse CUDA arrays and sparse CUDA mipmapped arrays. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`: - Device supports using the :py:obj:`~.cuMemHostRegister` flag - :py:obj:`~.CU_MEMHOSTERGISTER_READ_ONLY` to register memory that must - be mapped as read-only to the GPU - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED`: Device - supports using the :py:obj:`~.cuMemAllocAsync` and - :py:obj:`~.cuMemPool` family of APIs - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED`: Device - supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see - https://docs.nvidia.com/cuda/gpudirect-rdma for more information) - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS`: - The returned attribute shall be interpreted as a bitmask, where the - individual bits are described by the - :py:obj:`~.CUflushGPUDirectRDMAWritesOptions` enum - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING`: - GPUDirect RDMA writes to the device do not need to be flushed for - consumers within the scope indicated by the returned attribute. See - :py:obj:`~.CUGPUDirectRDMAWritesOrdering` for the numerical values - returned here. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES`: - Bitmask of handle types supported with mempool based IPC - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED`: - Device supports deferred mapping CUDA arrays and CUDA mipmapped - arrays. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_NUMA_CONFIG`: NUMA configuration of a - device: value is of type :py:obj:`~.CUdeviceNumaConfig` enum - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_NUMA_ID`: NUMA node ID of the GPU - memory - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED`: Device supports - switch multicast and reduction operations. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID`: The combined - 16-bit PCI device ID and 16-bit PCI vendor ID. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID`: The combined - 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. ID. - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`: - Device supports HOST_NUMA location with the virtual memory management - APIs like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related - APIs - - - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED`: - Device supports HOST_NUMA location with the - :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + `dev`. Parameters ---------- @@ -23830,6 +23669,77 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): return (_dict_CUresult[err], pi) {{endif}} +{{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + +@cython.embedsignature(True) +def cuDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[CUatomicOperation] | List[CUatomicOperation]], unsigned int count, dev): + """ Queries details about atomic operations supported between the device and host. + + Returns in `*capabilities` the details about requested atomic + `*operations` over the the link between `dev` and the host. The + allocated size of `*operations` and `*capabilities` must be `count`. + + For each :py:obj:`~.CUatomicOperation` in `*operations`, the + corresponding result in `*capabilities` will be a bitmask indicating + which of :py:obj:`~.CUatomicOperationCapability` the link supports + natively. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if `dev` is not valid. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if `*capabilities` or + `*operations` is NULL, if `count` is 0, or if any of `*operations` is + not valid. + + Parameters + ---------- + operations : List[:py:obj:`~.CUatomicOperation`] + Requested operations + count : unsigned int + Count of requested operations and size of capabilities + dev : :py:obj:`~.CUdevice` + Device handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + capabilities : List[unsigned int] + Returned capability details of each requested operation + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetP2PAtomicCapabilities`, :py:obj:`~.cudaDeviceGeHostAtomicCapabilities` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + operations = [] if operations is None else operations + if not all(isinstance(_x, (CUatomicOperation)) for _x in operations): + raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cydriver.CUatomicOperation] or List[cydriver.CUatomicOperation]") + cdef unsigned int* cycapabilities = NULL + pycapabilities = [] + if count != 0: + cycapabilities = calloc(count, sizeof(unsigned int)) + if cycapabilities is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(count) + 'x' + str(sizeof(unsigned int))) + cdef vector[cydriver.CUatomicOperation] cyoperations = [pyoperations.value for pyoperations in (operations)] + if count > len(operations): raise RuntimeError("List is too small: " + str(len(operations)) + " < " + str(count)) + with nogil: + err = cydriver.cuDeviceGetHostAtomicCapabilities(cycapabilities, cyoperations.data(), count, cydev) + if CUresult(err) == CUresult(0): + pycapabilities = [cycapabilities[idx] for idx in range(count)] + if cycapabilities is not NULL: + free(cycapabilities) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], pycapabilities) +{{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} @cython.embedsignature(True) @@ -24601,324 +24511,10 @@ def cuDevicePrimaryCtxReset(dev): return (_dict_CUresult[err],) {{endif}} -{{if 'cuCtxCreate_v2' in found_functions}} - -@cython.embedsignature(True) -def cuCtxCreate(unsigned int flags, dev): - """ Create a CUDA context. - - Creates a new CUDA context and associates it with the calling thread. - The `flags` parameter is described below. The context is created with a - usage count of 1 and the caller of :py:obj:`~.cuCtxCreate()` must call - :py:obj:`~.cuCtxDestroy()` when done using the context. If a context is - already current to the thread, it is supplanted by the newly created - context and may be restored by a subsequent call to - :py:obj:`~.cuCtxPopCurrent()`. - - The three LSBs of the `flags` parameter can be used to control how the - OS thread, which owns the CUDA context at the time of an API call, - interacts with the OS scheduler when waiting for results from the GPU. - Only one of the scheduling flags can be set when creating a context. - - - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when - waiting for results from the GPU. This can decrease latency when - waiting for the GPU, but may lower the performance of CPU threads if - they are performing work in parallel with the CUDA thread. - - - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread - when waiting for results from the GPU. This can increase latency when - waiting for the GPU, but can increase the performance of CPU threads - performing work in parallel with the GPU. - - - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the - CPU thread on a synchronization primitive when waiting for the GPU to - finish work. - - - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU - thread on a synchronization primitive when waiting for the GPU to - finish work. Deprecated: This flag was deprecated as of CUDA 4.0 - and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. - - - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` - parameter is zero, uses a heuristic based on the number of active - CUDA contexts in the process `C` and the number of logical processors - in the system `P`. If `C` > `P`, then CUDA will yield to other OS - threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), - otherwise CUDA will not yield while waiting for results and actively - spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, - on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic - based on the power profile of the platform and may choose - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. - - - :py:obj:`~.CU_CTX_MAP_HOST`: Instruct CUDA to support mapped pinned - allocations. This flag must be set in order to allocate pinned host - memory that is accessible to the GPU. - - - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce - local memory after resizing local memory for a kernel. This can - prevent thrashing by local memory allocations when launching many - kernels with high local memory usage at the cost of potentially - increased memory usage. Deprecated: This flag is deprecated and the - behavior enabled by this flag is now the default and cannot be - disabled. Instead, the per-thread stack size can be controlled with - :py:obj:`~.cuCtxSetLimit()`. - - - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been - enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or - environment variables, this flag can be set during context creation - to instruct CUDA to create a coredump if this context raises an - exception during execution. These environment variables are described - in the CUDA-GDB user guide under the "GPU core dump support" section. - The initial attributes will be taken from the global attributes at - the time of context creation. The other attributes that control - coredump output can be modified by calling - :py:obj:`~.cuCoredumpSetAttribute` from the created context after it - becomes current. - - - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU - coredumps have not been enabled globally with - :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, - this flag can be set during context creation to instruct CUDA to - create a coredump if data is written to a certain pipe that is - present in the OS space. These environment variables are described in - the CUDA-GDB user guide under the "GPU core dump support" section. It - is important to note that the pipe name `must` be set with - :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context - if this flag is used. Setting this flag implies that - :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial attributes - will be taken from the global attributes at the time of context - creation. The other attributes that control coredump output can be - modified by calling :py:obj:`~.cuCoredumpSetAttribute` from the - created context after it becomes current. Setting this flag on any - context creation is equivalent to setting the - :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` attribute to `true` - globally. - - - :py:obj:`~.CU_CTX_SYNC_MEMOPS`: Ensures that synchronous memory - operations initiated on this context will always synchronize. See - further documentation in the section titled "API Synchronization - behavior" to learn more about cases when synchronous memory - operations can exhibit asynchronous behavior. - - Context creation will fail with :py:obj:`~.CUDA_ERROR_UNKNOWN` if the - compute mode of the device is :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. - The function :py:obj:`~.cuDeviceGetAttribute()` can be used with - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute - mode of the device. The `nvidia-smi` tool can be used to set the - compute mode for * devices. Documentation for `nvidia-smi` can be - obtained by passing a -h option to it. - - Parameters - ---------- - flags : unsigned int - Context creation flags - dev : :py:obj:`~.CUdevice` - Device to create context on - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` - pctx : :py:obj:`~.CUcontext` - Returned context handle of the new context - - See Also - -------- - :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCoredumpSetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCtxSynchronize` - - Notes - ----- - In most cases it is recommended to use :py:obj:`~.cuDevicePrimaryCtxRetain`. - """ - cdef cydriver.CUdevice cydev - if dev is None: - pdev = 0 - elif isinstance(dev, (CUdevice,)): - pdev = int(dev) - else: - pdev = int(CUdevice(dev)) - cydev = pdev - cdef CUcontext pctx = CUcontext() - with nogil: - err = cydriver.cuCtxCreate(pctx._pvt_ptr, flags, cydev) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) -{{endif}} - -{{if 'cuCtxCreate_v3' in found_functions}} - -@cython.embedsignature(True) -def cuCtxCreate_v3(paramsArray : Optional[Tuple[CUexecAffinityParam] | List[CUexecAffinityParam]], int numParams, unsigned int flags, dev): - """ Create a CUDA context with execution affinity. - - Creates a new CUDA context with execution affinity and associates it - with the calling thread. The `paramsArray` and `flags` parameter are - described below. The context is created with a usage count of 1 and the - caller of :py:obj:`~.cuCtxCreate()` must call - :py:obj:`~.cuCtxDestroy()` when done using the context. If a context is - already current to the thread, it is supplanted by the newly created - context and may be restored by a subsequent call to - :py:obj:`~.cuCtxPopCurrent()`. - - The type and the amount of execution resource the context can use is - limited by `paramsArray` and `numParams`. The `paramsArray` is an array - of `CUexecAffinityParam` and the `numParams` describes the size of the - array. If two `CUexecAffinityParam` in the array have the same type, - the latter execution affinity parameter overrides the former execution - affinity parameter. The supported execution affinity types are: - - - :py:obj:`~.CU_EXEC_AFFINITY_TYPE_SM_COUNT` limits the portion of SMs - that the context can use. The portion of SMs is specified as the - number of SMs via `CUexecAffinitySmCount`. This limit will be - internally rounded up to the next hardware-supported amount. Hence, - it is imperative to query the actual execution affinity of the - context via `cuCtxGetExecAffinity` after context creation. Currently, - this attribute is only supported under Volta+ MPS. - - The three LSBs of the `flags` parameter can be used to control how the - OS thread, which owns the CUDA context at the time of an API call, - interacts with the OS scheduler when waiting for results from the GPU. - Only one of the scheduling flags can be set when creating a context. - - - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when - waiting for results from the GPU. This can decrease latency when - waiting for the GPU, but may lower the performance of CPU threads if - they are performing work in parallel with the CUDA thread. - - - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread - when waiting for results from the GPU. This can increase latency when - waiting for the GPU, but can increase the performance of CPU threads - performing work in parallel with the GPU. - - - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the - CPU thread on a synchronization primitive when waiting for the GPU to - finish work. - - - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU - thread on a synchronization primitive when waiting for the GPU to - finish work. Deprecated: This flag was deprecated as of CUDA 4.0 - and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. - - - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` - parameter is zero, uses a heuristic based on the number of active - CUDA contexts in the process `C` and the number of logical processors - in the system `P`. If `C` > `P`, then CUDA will yield to other OS - threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), - otherwise CUDA will not yield while waiting for results and actively - spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, - on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic - based on the power profile of the platform and may choose - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. - - - :py:obj:`~.CU_CTX_MAP_HOST`: Instruct CUDA to support mapped pinned - allocations. This flag must be set in order to allocate pinned host - memory that is accessible to the GPU. - - - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce - local memory after resizing local memory for a kernel. This can - prevent thrashing by local memory allocations when launching many - kernels with high local memory usage at the cost of potentially - increased memory usage. Deprecated: This flag is deprecated and the - behavior enabled by this flag is now the default and cannot be - disabled. Instead, the per-thread stack size can be controlled with - :py:obj:`~.cuCtxSetLimit()`. - - - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been - enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or - environment variables, this flag can be set during context creation - to instruct CUDA to create a coredump if this context raises an - exception during execution. These environment variables are described - in the CUDA-GDB user guide under the "GPU core dump support" section. - The initial attributes will be taken from the global attributes at - the time of context creation. The other attributes that control - coredump output can be modified by calling - :py:obj:`~.cuCoredumpSetAttribute` from the created context after it - becomes current. - - - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU - coredumps have not been enabled globally with - :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, - this flag can be set during context creation to instruct CUDA to - create a coredump if data is written to a certain pipe that is - present in the OS space. These environment variables are described in - the CUDA-GDB user guide under the "GPU core dump support" section. It - is important to note that the pipe name `must` be set with - :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context - if this flag is used. Setting this flag implies that - :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial attributes - will be taken from the global attributes at the time of context - creation. The other attributes that control coredump output can be - modified by calling :py:obj:`~.cuCoredumpSetAttribute` from the - created context after it becomes current. Setting this flag on any - context creation is equivalent to setting the - :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` attribute to `true` - globally. - - Context creation will fail with :py:obj:`~.CUDA_ERROR_UNKNOWN` if the - compute mode of the device is :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. - The function :py:obj:`~.cuDeviceGetAttribute()` can be used with - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute - mode of the device. The `nvidia-smi` tool can be used to set the - compute mode for * devices. Documentation for `nvidia-smi` can be - obtained by passing a -h option to it. - - Parameters - ---------- - paramsArray : List[:py:obj:`~.CUexecAffinityParam`] - Execution affinity parameters - numParams : int - Number of execution affinity parameters - flags : unsigned int - Context creation flags - dev : :py:obj:`~.CUdevice` - Device to create context on - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` - pctx : :py:obj:`~.CUcontext` - Returned context handle of the new context - - See Also - -------- - :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuCoredumpSetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.CUexecAffinityParam` - """ - cdef cydriver.CUdevice cydev - if dev is None: - pdev = 0 - elif isinstance(dev, (CUdevice,)): - pdev = int(dev) - else: - pdev = int(CUdevice(dev)) - cydev = pdev - paramsArray = [] if paramsArray is None else paramsArray - if not all(isinstance(_x, (CUexecAffinityParam,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUexecAffinityParam,] or List[cydriver.CUexecAffinityParam,]") - cdef CUcontext pctx = CUcontext() - cdef cydriver.CUexecAffinityParam* cyparamsArray = NULL - if len(paramsArray) > 1: - cyparamsArray = calloc(len(paramsArray), sizeof(cydriver.CUexecAffinityParam)) - if cyparamsArray is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cydriver.CUexecAffinityParam))) - for idx in range(len(paramsArray)): - string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) - elif len(paramsArray) == 1: - cyparamsArray = (paramsArray[0])._pvt_ptr - with nogil: - err = cydriver.cuCtxCreate_v3(pctx._pvt_ptr, cyparamsArray, numParams, flags, cydev) - if len(paramsArray) > 1 and cyparamsArray is not NULL: - free(cyparamsArray) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) -{{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} @cython.embedsignature(True) -def cuCtxCreate_v4(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flags, dev): +def cuCtxCreate(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flags, dev): """ Create a CUDA context. Creates a new CUDA context and associates it with the calling thread. @@ -25092,7 +24688,7 @@ def cuCtxCreate_v4(ctxCreateParams : Optional[CUctxCreateParams], unsigned int f cdef CUcontext pctx = CUcontext() cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams != None else NULL with nogil: - err = cydriver.cuCtxCreate_v4(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) + err = cydriver.cuCtxCreate(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) if err != cydriver.CUDA_SUCCESS: return (_dict_CUresult[err], None) return (_dict_CUresult[err], pctx) @@ -25334,6 +24930,48 @@ def cuCtxGetDevice(): return (_dict_CUresult[err], device) {{endif}} +{{if 'cuCtxGetDevice_v2' in found_functions}} + +@cython.embedsignature(True) +def cuCtxGetDevice_v2(ctx): + """ Returns the device handle for the specified context. + + Returns in `*device` the handle of the specified context's device. If + the specified context is NULL, the API will return the current + context's device. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context for which to obtain the device + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + device : :py:obj:`~.CUdevice` + Returned device handle for the specified context + + See Also + -------- + :py:obj:`~.cuCtxGetCurrent`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef CUdevice device = CUdevice() + with nogil: + err = cydriver.cuCtxGetDevice_v2(device._pvt_ptr, cyctx) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], device) +{{endif}} + {{if 'cuCtxGetFlags' in found_functions}} @cython.embedsignature(True) @@ -25461,6 +25099,51 @@ def cuCtxSynchronize(): return (_dict_CUresult[err],) {{endif}} +{{if 'cuCtxSynchronize_v2' in found_functions}} + +@cython.embedsignature(True) +def cuCtxSynchronize_v2(ctx): + """ Block for the specified context's tasks to complete. + + Blocks until the specified context has completed all preceding + requested tasks. If the specified context is the primary context, green + contexts that have been created will also be synchronized. The API + returns an error if one of the preceding tasks failed. + + If the context was created with the + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` flag, the CPU thread will block + until the GPU context has finished its work. + + If the specified context is NULL, the API will operate on the current + context. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to synchronize + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxGetCurrent`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuGreenCtxCreate`, :py:obj:`~.cuCtxFromGreenCtx`, :py:obj:`~.cudaDeviceSynchronize` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + with nogil: + err = cydriver.cuCtxSynchronize_v2(cyctx) + return (_dict_CUresult[err],) +{{endif}} + {{if 'cuCtxSetLimit' in found_functions}} @cython.embedsignature(True) @@ -31057,7 +30740,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): return (_dict_CUresult[err],) {{endif}} -{{if 'cuMemcpyBatchAsync' in found_functions}} +{{if 'cuMemcpyBatchAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], srcs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, attrs : Optional[Tuple[CUmemcpyAttributes] | List[CUmemcpyAttributes]], attrsIdxs : Tuple[int] | List[int], size_t numAttrs, hStream): @@ -31132,10 +30815,6 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. - If any error is encountered while parsing the batch, the index within - the batch where the error was encountered will be returned in - `failIdx`. - Parameters ---------- dsts : List[:py:obj:`~.CUdeviceptr`] @@ -31164,10 +30843,6 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - failIdx : int - Pointer to a location to return the index of the copy where a - failure was encountered. The value will be SIZE_MAX if the error - doesn't pertain to any specific copy. """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -31226,21 +30901,18 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], cdef vector[size_t] cyattrsIdxs = attrsIdxs if numAttrs > len(attrs): raise RuntimeError("List is too small: " + str(len(attrs)) + " < " + str(numAttrs)) if numAttrs > len(attrsIdxs): raise RuntimeError("List is too small: " + str(len(attrsIdxs)) + " < " + str(numAttrs)) - cdef size_t failIdx = 0 with nogil: - err = cydriver.cuMemcpyBatchAsync(cydsts, cysrcs, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, &failIdx, cyhStream) + err = cydriver.cuMemcpyBatchAsync(cydsts, cysrcs, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, cyhStream) if len(dsts) > 1 and cydsts is not NULL: free(cydsts) if len(srcs) > 1 and cysrcs is not NULL: free(cysrcs) if len(attrs) > 1 and cyattrs is not NULL: free(cyattrs) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], failIdx) + return (_dict_CUresult[err],) {{endif}} -{{if 'cuMemcpy3DBatchAsync' in found_functions}} +{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BATCH_OP] | List[CUDA_MEMCPY3D_BATCH_OP]], unsigned long long flags, hStream): @@ -31326,10 +30998,6 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. - If any error is encountered while parsing the batch, the index within - the batch where the error was encountered will be returned in - `failIdx`. - Parameters ---------- numOps : size_t @@ -31346,10 +31014,6 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - failIdx : int - Pointer to a location to return the index of the copy where a - failure was encountered. The value will be SIZE_MAX if the error - doesn't pertain to any specific copy. """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -31372,14 +31036,11 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA string.memcpy(&cyopList[idx], (opList[idx])._pvt_ptr, sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP)) elif len(opList) == 1: cyopList = (opList[0])._pvt_ptr - cdef size_t failIdx = 0 with nogil: - err = cydriver.cuMemcpy3DBatchAsync(numOps, cyopList, &failIdx, flags, cyhStream) + err = cydriver.cuMemcpy3DBatchAsync(numOps, cyopList, flags, cyhStream) if len(opList) > 1 and cyopList is not NULL: free(cyopList) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], failIdx) + return (_dict_CUresult[err],) {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} @@ -32794,30 +32455,34 @@ def cuMipmappedArrayDestroy(hMipmappedArray): def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmemRangeHandleType, unsigned long long flags): """ Retrieve handle for an address range. - Get a handle of the specified type to an address range. The address - range must have been obtained by a prior call to either - :py:obj:`~.cuMemAlloc` or :py:obj:`~.cuMemAddressReserve`. If the - address range was obtained via :py:obj:`~.cuMemAddressReserve`, it must - also be fully mapped via :py:obj:`~.cuMemMap`. The address range must - have been obtained by a prior call to either :py:obj:`~.cuMemAllocHost` - or :py:obj:`~.cuMemHostAlloc` on Tegra. + Get a handle of the specified type to an address range. When requesting + CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, address + range obtained by a prior call to either :py:obj:`~.cuMemAlloc` or + :py:obj:`~.cuMemAddressReserve` is supported if the + :py:obj:`~.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED` device attribute + returns true. If the address range was obtained via + :py:obj:`~.cuMemAddressReserve`, it must also be fully mapped via + :py:obj:`~.cuMemMap`. Address range obtained by a prior call to either + :py:obj:`~.cuMemAllocHost` or :py:obj:`~.cuMemHostAlloc` is supported + if the :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED` + device attribute returns true. + + As of CUDA 13.0, querying support for address range obtained by calling + :py:obj:`~.cuMemAllocHost` or :py:obj:`~.cuMemHostAlloc` using the + :py:obj:`~.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED` device attribute is + deprecated. Users must ensure the `dptr` and `size` are aligned to the host page size. - When requesting - CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users are - expected to query for dma_buf support for the platform by using - :py:obj:`~.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED` device attribute - before calling this API. The `handle` will be interpreted as a pointer - to an integer to store the dma_buf file descriptor. Users must ensure - the entire address range is backed and mapped when the address range is - allocated by :py:obj:`~.cuMemAddressReserve`. All the physical - allocations backing the address range must be resident on the same - device and have identical allocation properties. Users are also - expected to retrieve a new handle every time the underlying physical - allocation(s) corresponding to a previously queried VA range are - changed. + The `handle` will be interpreted as a pointer to an integer to store + the dma_buf file descriptor. Users must ensure the entire address range + is backed and mapped when the address range is allocated by + :py:obj:`~.cuMemAddressReserve`. All the physical allocations backing + the address range must be resident on the same device and have + identical allocation properties. Users are also expected to retrieve a + new handle every time the underlying physical allocation(s) + corresponding to a previously queried VA range are changed. For CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users may set flags to @@ -32886,10 +32551,9 @@ def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], siz :py:obj:`~.CUmemDecompressParams.dstActBytes`, must be capable of usage with the hardware decompress feature. That is, for each of said pointers, the pointer attribute - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_MEM_DECOMPRESS_CAPABLE` should give - a non-zero value. To ensure this, the memory backing the pointers - should have been allocated using one of the following CUDA memory - allocators: + :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE` should give a + non-zero value. To ensure this, the memory backing the pointers should + have been allocated using one of the following CUDA memory allocators: - :py:obj:`~.cuMemAlloc()` @@ -33063,14 +32727,21 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long `size` of this allocation must be a multiple of the the value given via :py:obj:`~.cuMemGetAllocationGranularity` with the :py:obj:`~.CU_MEM_ALLOC_GRANULARITY_MINIMUM` flag. To create a CPU - allocation targeting a specific host NUMA node, applications must set + allocation that doesn't target any specific NUMA nodes, applications + must set :py:obj:`~.CUmemAllocationProp`::CUmemLocation::type to + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`. + :py:obj:`~.CUmemAllocationProp`::CUmemLocation::id is ignored for HOST + allocations. HOST allocations are not IPC capable and + :py:obj:`~.CUmemAllocationProp.requestedHandleTypes` must be 0, any + other value will result in :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. To + create a CPU allocation targeting a specific host NUMA node, + applications must set :py:obj:`~.CUmemAllocationProp`::CUmemLocation::type to :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and :py:obj:`~.CUmemAllocationProp`::CUmemLocation::id must specify the NUMA ID of the CPU. On systems where NUMA is not available :py:obj:`~.CUmemAllocationProp`::CUmemLocation::id must be set to 0. - Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` or - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` as the + Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` as the :py:obj:`~.CUmemLocation.type` will result in :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. @@ -34240,19 +33911,28 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): `poolProps` determines the properties of the pool such as the backing device and IPC capabilities. - To create a memory pool targeting a specific host NUMA node, - applications must set :py:obj:`~.CUmemPoolProps`::CUmemLocation::type - to :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and + To create a memory pool for HOST memory not targeting a specific NUMA + node, applications must set set + :py:obj:`~.CUmemPoolProps`::CUmemLocation::type to + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`. + :py:obj:`~.CUmemPoolProps`::CUmemLocation::id is ignored for such + pools. Pools created with the type + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` are not IPC capable and + :py:obj:`~.CUmemPoolProps.handleTypes` must be 0, any other values will + result in :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. To create a memory pool + targeting a specific host NUMA node, applications must set + :py:obj:`~.CUmemPoolProps`::CUmemLocation::type to + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and :py:obj:`~.CUmemPoolProps`::CUmemLocation::id must specify the NUMA ID of the host memory node. Specifying - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` or - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` as the + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` as the :py:obj:`~.CUmemPoolProps`::CUmemLocation::type will result in :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. By default, the pool's memory will be accessible from the device it is allocated on. In the case of - pools created with :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, their - default accessibility will be from the host CPU. Applications can - control the maximum size of the pool by specifying a non-zero value for + pools created with :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`, their default accessibility will + be from the host CPU. Applications can control the maximum size of the + pool by specifying a non-zero value for :py:obj:`~.CUmemPoolProps.maxSize`. If set to 0, the maximum size of the pool will default to a system dependent value. @@ -34351,6 +34031,170 @@ def cuMemPoolDestroy(pool): return (_dict_CUresult[err],) {{endif}} +{{if 'cuMemGetDefaultMemPool' in found_functions}} + +@cython.embedsignature(True) +def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType): + """ Returns the default memory pool for a given location and allocation type. + + The memory location can be of one of + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be + one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also + be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred + location for the managed memory pool. In all other cases, the call + returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Parameters + ---------- + location : :py:obj:`~.CUmemLocation` + None + typename : :py:obj:`~.CUmemAllocationType` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pool_out : :py:obj:`~.CUmemoryPool` + None + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cuMemPoolSetAttribute`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + cdef CUmemoryPool pool_out = CUmemoryPool() + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemAllocationType cytypename = typename.value + with nogil: + err = cydriver.cuMemGetDefaultMemPool(pool_out._pvt_ptr, cylocation_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], pool_out) +{{endif}} + +{{if 'cuMemGetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType): + """ Gets the current memory pool for a memory location and of a particular allocation type. + + The memory location can be of one of + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be + one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also + be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred + location for the managed memory pool. In all other cases, the call + returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + Returns the last pool provided to :py:obj:`~.cuMemSetMemPool` or + :py:obj:`~.cuDeviceSetMemPool` for this location and allocation type or + the location's default memory pool if :py:obj:`~.cuMemSetMemPool` or + :py:obj:`~.cuDeviceSetMemPool` for that allocType and location has + never been called. By default the current mempool of a location is the + default mempool for a device. Otherwise the returned pool must have + been set with :py:obj:`~.cuDeviceSetMemPool`. + + Parameters + ---------- + location : :py:obj:`~.CUmemLocation` + None + typename : :py:obj:`~.CUmemAllocationType` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pool : :py:obj:`~.CUmemoryPool` + None + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuMemSetMemPool` + """ + cdef CUmemoryPool pool = CUmemoryPool() + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemAllocationType cytypename = typename.value + with nogil: + err = cydriver.cuMemGetMemPool(pool._pvt_ptr, cylocation_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], pool) +{{endif}} + +{{if 'cuMemSetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType, pool): + """ Sets the current memory pool for a memory location and allocation type. + + The memory location can be of one of + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be + one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also + be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred + location for the managed memory pool. In all other cases, the call + returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + When a memory pool is set as the current memory pool, the location + parameter should be the same as the location of the pool. The location + and allocation type specified must match those of the pool otherwise + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. By default, a memory + location's current memory pool is its default memory pool that can be + obtained via :py:obj:`~.cuMemGetDefaultMemPool`. If the location type + is :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` and the allocation type is + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED`, then this API is the + equivalent of calling :py:obj:`~.cuDeviceSetMemPool` with the location + id as the device. For further details on the implications, please refer + to the documentation for :py:obj:`~.cuDeviceSetMemPool`. + + Parameters + ---------- + location : :py:obj:`~.CUmemLocation` + None + typename : :py:obj:`~.CUmemAllocationType` + None + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolDestroy`, :py:obj:`~.cuMemAllocFromPoolAsync` + + Notes + ----- + Use :py:obj:`~.cuMemAllocFromPoolAsync` to specify asynchronous allocations from a device different than the one the stream runs on. + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemAllocationType cytypename = typename.value + with nogil: + err = cydriver.cuMemSetMemPool(cylocation_ptr, cytypename, cypool) + return (_dict_CUresult[err],) +{{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} @cython.embedsignature(True) @@ -35196,127 +35040,10 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): return (_dict_CUresult[err], cydata.pyObj()) {{endif}} -{{if 'cuMemPrefetchAsync' in found_functions}} - -@cython.embedsignature(True) -def cuMemPrefetchAsync(devPtr, size_t count, dstDevice, hStream): - """ Prefetches memory to the specified destination device. - - Note there is a later version of this API, - :py:obj:`~.cuMemPrefetchAsync_v2`. It will supplant this version in - 13.0, which is retained for minor version compatibility. - - Prefetches memory to the specified destination device. `devPtr` is the - base device pointer of the memory to be prefetched and `dstDevice` is - the destination device. `count` specifies the number of bytes to copy. - `hStream` is the stream in which the operation is enqueued. The memory - range must refer to managed memory allocated via - :py:obj:`~.cuMemAllocManaged` or declared via managed variables or it - may also refer to system-allocated memory on systems with non-zero - CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. - - Passing in CU_DEVICE_CPU for `dstDevice` will prefetch the data to host - memory. If `dstDevice` is a GPU, then the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` must be non- - zero. Additionally, `hStream` must be associated with a device that has - a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. - - The start address and end address of the memory range will be rounded - down and rounded up respectively to be aligned to CPU page size before - the prefetch operation is enqueued in the stream. - - If no physical memory has been allocated for this region, then this - memory region will be populated and mapped on the destination device. - If there's insufficient memory to prefetch the desired region, the - Unified Memory driver may evict pages from other - :py:obj:`~.cuMemAllocManaged` allocations to host memory in order to - make room. Device memory allocated using :py:obj:`~.cuMemAlloc` or - :py:obj:`~.cuArrayCreate` will not be evicted. - - By default, any mappings to the previous location of the migrated pages - are removed and mappings for the new location are only setup on - `dstDevice`. The exact behavior however also depends on the settings - applied to this memory range via :py:obj:`~.cuMemAdvise` as described - below: - - If :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` was set on any subset of - this memory range, then that subset will create a read-only copy of the - pages on `dstDevice`. - - If :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` was called on any - subset of this memory range, then the pages will be migrated to - `dstDevice` even if `dstDevice` is not the preferred location of any - pages in the memory range. - - If :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` was called on any subset - of this memory range, then mappings to those pages from all the - appropriate processors are updated to refer to the new location if - establishing such a mapping is possible. Otherwise, those mappings are - cleared. - - Note that this API is not required for functionality and only serves to - improve performance by allowing the application to migrate data to a - suitable location before it is accessed. Memory accesses to this range - are always coherent and are allowed even when the data is actively - being migrated. - - Note that this function is asynchronous with respect to the host and - all work on other devices. - - Parameters - ---------- - devPtr : :py:obj:`~.CUdeviceptr` - Pointer to be prefetched - count : size_t - Size in bytes - dstDevice : :py:obj:`~.CUdevice` - Destination device to prefetch to - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - Stream to enqueue prefetch operation - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - - See Also - -------- - :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemPrefetchAsync` :py:obj:`~.cudaMemPrefetchAsync_v2` - """ - cdef cydriver.CUstream cyhStream - if hStream is None: - phStream = 0 - elif isinstance(hStream, (CUstream,)): - phStream = int(hStream) - else: - phStream = int(CUstream(hStream)) - cyhStream = phStream - cdef cydriver.CUdevice cydstDevice - if dstDevice is None: - pdstDevice = 0 - elif isinstance(dstDevice, (CUdevice,)): - pdstDevice = int(dstDevice) - else: - pdstDevice = int(CUdevice(dstDevice)) - cydstDevice = pdstDevice - cdef cydriver.CUdeviceptr cydevPtr - if devPtr is None: - pdevPtr = 0 - elif isinstance(devPtr, (CUdeviceptr,)): - pdevPtr = int(devPtr) - else: - pdevPtr = int(CUdeviceptr(devPtr)) - cydevPtr = pdevPtr - with nogil: - err = cydriver.cuMemPrefetchAsync(cydevPtr, count, cydstDevice, cyhStream) - return (_dict_CUresult[err],) -{{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} @cython.embedsignature(True) -def cuMemPrefetchAsync_v2(devPtr, size_t count, location not None : CUmemLocation, unsigned int flags, hStream): +def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, unsigned int flags, hStream): """ Prefetches memory to the specified destination location. Prefetches memory to the specified destination location. `devPtr` is @@ -35412,7 +35139,7 @@ def cuMemPrefetchAsync_v2(devPtr, size_t count, location not None : CUmemLocatio See Also -------- - :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cudaMemPrefetchAsync_v2` + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cudaMemPrefetchAsync` """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -35431,20 +35158,16 @@ def cuMemPrefetchAsync_v2(devPtr, size_t count, location not None : CUmemLocatio pdevPtr = int(CUdeviceptr(devPtr)) cydevPtr = pdevPtr with nogil: - err = cydriver.cuMemPrefetchAsync_v2(cydevPtr, count, location._pvt_ptr[0], flags, cyhStream) + err = cydriver.cuMemPrefetchAsync(cydevPtr, count, location._pvt_ptr[0], flags, cyhStream) return (_dict_CUresult[err],) {{endif}} -{{if 'cuMemAdvise' in found_functions}} +{{if 'cuMemAdvise_v2' in found_functions}} @cython.embedsignature(True) -def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, device): +def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location not None : CUmemLocation): """ Advise about the usage of a given memory range. - Note there is a later version of this API, :py:obj:`~.cuMemAdvise_v2`. - It will supplant this version in 13.0, which is retained for minor - version compatibility. - Advise the Unified Memory subsystem about the usage pattern for the memory range starting at `devPtr` with a size of `count` bytes. The start address and end address of the memory range will be rounded down @@ -35465,199 +35188,17 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, device): only copy of at least the accessed pages in that processor's memory. Additionally, if :py:obj:`~.cuMemPrefetchAsync` is called on this region, it will create a read-only copy of the data on the - destination processor. If any processor writes to this region, all - copies of the corresponding page will be invalidated except for the - one where the write occurred. The `device` argument is ignored for - this advice. Note that for a page to be read-duplicated, the - accessing processor must either be the CPU or a GPU that has a non- - zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Also, if a - context is created on a device that does not have the device - attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` - set, then read-duplication will not occur until all such contexts are - destroyed. If the memory region refers to valid system-allocated - pageable memory, then the accessing device must have a non-zero value - for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS` for a read- - only copy to be created on that device. Note however that if the - accessing device also has a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, - then setting this advice will not create a read-only copy when that - device accesses this memory region. - - - :py:obj:`~.CU_MEM_ADVISE_UNSET_READ_MOSTLY`: Undoes the effect of - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` and also prevents the - Unified Memory driver from attempting heuristic read-duplication on - the memory range. Any read-duplicated copies of the data will be - collapsed into a single copy. The location for the collapsed copy - will be the preferred location if the page has a preferred location - and one of the read-duplicated copies was resident at that location. - Otherwise, the location chosen is arbitrary. - - - :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION`: This advice sets - the preferred location for the data to be the memory belonging to - `device`. Passing in CU_DEVICE_CPU for `device` sets the preferred - location as host memory. If `device` is a GPU, then it must have a - non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Setting - the preferred location does not cause data to migrate to that - location immediately. Instead, it guides the migration policy when a - fault occurs on that memory region. If the data is already in its - preferred location and the faulting processor can establish a mapping - without requiring the data to be migrated, then data migration will - be avoided. On the other hand, if the data is not in its preferred - location or if a direct mapping cannot be established, then it will - be migrated to the processor accessing it. It is important to note - that setting the preferred location does not prevent data prefetching - done using :py:obj:`~.cuMemPrefetchAsync`. Having a preferred - location can override the page thrash detection and resolution logic - in the Unified Memory driver. Normally, if a page is detected to be - constantly thrashing between for example host and device memory, the - page may eventually be pinned to host memory by the Unified Memory - driver. But if the preferred location is set as device memory, then - the page will continue to thrash indefinitely. If - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory - region or any subset of it, then the policies associated with that - advice will override the policies of this advice, unless read - accesses from `device` will not result in a read-only copy being - created on that device as outlined in description for the advice - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`. If the memory region - refers to valid system-allocated pageable memory, then `device` must - have a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. - - - :py:obj:`~.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`: Undoes the effect - of :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` and changes the - preferred location to none. - - - :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`: This advice implies that - the data will be accessed by `device`. Passing in - :py:obj:`~.CU_DEVICE_CPU` for `device` will set the advice for the - CPU. If `device` is a GPU, then the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` must be - non-zero. This advice does not cause data migration and has no impact - on the location of the data per se. Instead, it causes the data to - always be mapped in the specified processor's page tables, as long as - the location of the data permits a mapping to be established. If the - data gets migrated for any reason, the mappings are updated - accordingly. This advice is recommended in scenarios where data - locality is not important, but avoiding faults is. Consider for - example a system containing multiple GPUs with peer-to-peer access - enabled, where the data located on one GPU is occasionally accessed - by peer GPUs. In such scenarios, migrating data over to the other - GPUs is not as important because the accesses are infrequent and the - overhead of migration may be too high. But preventing faults can - still help improve performance, and so having a mapping set up in - advance is useful. Note that on CPU access of this data, the data may - be migrated to host memory because the CPU typically cannot access - device memory directly. Any GPU that had the - :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` flag set for this data will - now have its mapping updated to point to the page in host memory. If - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory - region or any subset of it, then the policies associated with that - advice will override the policies of this advice. Additionally, if - the preferred location of this memory region or any subset of it is - also `device`, then the policies associated with - :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` will override the - policies of this advice. If the memory region refers to valid system- - allocated pageable memory, then `device` must have a non-zero value - for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, - if `device` has a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, - then this call has no effect. - - - :py:obj:`~.CU_MEM_ADVISE_UNSET_ACCESSED_BY`: Undoes the effect of - :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`. Any mappings to the data - from `device` may be removed at any time causing accesses to result - in non-fatal page faults. If the memory region refers to valid - system-allocated pageable memory, then `device` must have a non-zero - value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, - if `device` has a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, - then this call has no effect. - - Parameters - ---------- - devPtr : :py:obj:`~.CUdeviceptr` - Pointer to memory to set the advice for - count : size_t - Size in bytes of the memory range - advice : :py:obj:`~.CUmem_advise` - Advice to be applied for the specified memory range - device : :py:obj:`~.CUdevice` - Device to apply the advice for - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - - See Also - -------- - :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cuMemAdvise_v2`, :py:obj:`~.cudaMemAdvise` - """ - cdef cydriver.CUdevice cydevice - if device is None: - pdevice = 0 - elif isinstance(device, (CUdevice,)): - pdevice = int(device) - else: - pdevice = int(CUdevice(device)) - cydevice = pdevice - cdef cydriver.CUdeviceptr cydevPtr - if devPtr is None: - pdevPtr = 0 - elif isinstance(devPtr, (CUdeviceptr,)): - pdevPtr = int(devPtr) - else: - pdevPtr = int(CUdeviceptr(devPtr)) - cydevPtr = pdevPtr - cdef cydriver.CUmem_advise cyadvice = advice.value - with nogil: - err = cydriver.cuMemAdvise(cydevPtr, count, cyadvice, cydevice) - return (_dict_CUresult[err],) -{{endif}} - -{{if 'cuMemAdvise_v2' in found_functions}} - -@cython.embedsignature(True) -def cuMemAdvise_v2(devPtr, size_t count, advice not None : CUmem_advise, location not None : CUmemLocation): - """ Advise about the usage of a given memory range. - - Advise the Unified Memory subsystem about the usage pattern for the - memory range starting at `devPtr` with a size of `count` bytes. The - start address and end address of the memory range will be rounded down - and rounded up respectively to be aligned to CPU page size before the - advice is applied. The memory range must refer to managed memory - allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed - variables. The memory range could also refer to system-allocated - pageable memory provided it represents a valid, host-accessible region - of memory and all additional constraints imposed by `advice` as - outlined below are also satisfied. Specifying an invalid system- - allocated pageable memory range results in an error being returned. - - The `advice` parameter can take the following values: - - - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`: This implies that the data - is mostly going to be read from and only occasionally written to. Any - read accesses from any processor to this region will create a read- - only copy of at least the accessed pages in that processor's memory. - Additionally, if :py:obj:`~.cuMemPrefetchAsync` or - :py:obj:`~.cuMemPrefetchAsync_v2` is called on this region, it will - create a read-only copy of the data on the destination processor. If - the target location for :py:obj:`~.cuMemPrefetchAsync_v2` is a host - NUMA node and a read-only copy already exists on another host NUMA - node, that copy will be migrated to the targeted host NUMA node. If - any processor writes to this region, all copies of the corresponding - page will be invalidated except for the one where the write occurred. - If the writing processor is the CPU and the preferred location of the - page is a host NUMA node, then the page will also be migrated to that - host NUMA node. The `location` argument is ignored for this advice. - Note that for a page to be read-duplicated, the accessing processor - must either be the CPU or a GPU that has a non-zero value for the - device attribute + destination processor. If the target location for + :py:obj:`~.cuMemPrefetchAsync` is a host NUMA node and a read-only + copy already exists on another host NUMA node, that copy will be + migrated to the targeted host NUMA node. If any processor writes to + this region, all copies of the corresponding page will be invalidated + except for the one where the write occurred. If the writing processor + is the CPU and the preferred location of the page is a host NUMA + node, then the page will also be migrated to that host NUMA node. The + `location` argument is ignored for this advice. Note that for a page + to be read-duplicated, the accessing processor must either be the CPU + or a GPU that has a non-zero value for the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Also, if a context is created on a device that does not have the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` @@ -35810,7 +35351,7 @@ def cuMemAdvise_v2(devPtr, size_t count, advice not None : CUmem_advise, locatio See Also -------- - :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cudaMemAdvise` + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cudaMemAdvise` """ cdef cydriver.CUdeviceptr cydevPtr if devPtr is None: @@ -35822,7 +35363,340 @@ def cuMemAdvise_v2(devPtr, size_t count, advice not None : CUmem_advise, locatio cydevPtr = pdevPtr cdef cydriver.CUmem_advise cyadvice = advice.value with nogil: - err = cydriver.cuMemAdvise_v2(cydevPtr, count, cyadvice, location._pvt_ptr[0]) + err = cydriver.cuMemAdvise(cydevPtr, count, cyadvice, location._pvt_ptr[0]) + return (_dict_CUresult[err],) +{{endif}} + +{{if 'cuMemPrefetchBatchAsync' in found_functions}} + +@cython.embedsignature(True) +def cuMemPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[CUmemLocation] | List[CUmemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, hStream): + """ Performs a batch of memory prefetches asynchronously. + + Performs a batch of memory prefetches. The batch as a whole executes in + stream order but operations within a batch are not guaranteed to + execute in any specific order. All devices in the system must have a + non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` otherwise the + API will return an error. + + The semantics of the individual prefetch operations are as described in + :py:obj:`~.cuMemPrefetchAsync`. + + Performs memory prefetch on address ranges specified in `dptrs` and + `sizes`. Both arrays must be of the same length as specified by + `count`. Each memory range specified must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables or it may also refer to system-allocated memory when all + devices have a non-zero value for + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. The prefetch + location for every operation in the batch is specified in the + `prefetchLocs` array. Each entry in this array can apply to more than + one operation. This can be done by specifying in the `prefetchLocIdxs` + array, the index of the first prefetch operation that the corresponding + entry in the `prefetchLocs` array applies to. Both `prefetchLocs` and + `prefetchLocIdxs` must be of the same length as specified by + `numPrefetchLocs`. For example, if a batch has 10 prefetches listed in + dptrs/sizes, the first 4 of which are to be prefetched to one location + and the remaining 6 are to be prefetched to another, then + `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 4} and + `prefetchLocs` will contain the two locations. Note the first entry in + `prefetchLocIdxs` must always be 0. Also, each entry must be greater + than the previous entry and the last entry should be less than `count`. + Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`. + + Parameters + ---------- + dptrs : List[:py:obj:`~.CUdeviceptr`] + Array of pointers to be prefetched + sizes : List[int] + Array of sizes for memory prefetch operations. + count : size_t + Size of `dptrs` and `sizes` arrays. + prefetchLocs : List[:py:obj:`~.CUmemLocation`] + Array of locations to prefetch to. + prefetchLocIdxs : List[int] + Array of indices to specify which operands each entry in the + `prefetchLocs` array applies to. The locations specified in + prefetchLocs[k] will be applied to copies starting from + prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also + prefetchLocs[numPrefetchLocs - 1] will apply to prefetches starting + from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. + numPrefetchLocs : size_t + Size of `prefetchLocs` and `prefetchLocIdxs` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + CUresult + + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + prefetchLocs = [] if prefetchLocs is None else prefetchLocs + if not all(isinstance(_x, (CUmemLocation,)) for _x in prefetchLocs): + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cydriver.CUmemLocation,] or List[cydriver.CUmemLocation,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): + raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + cdef cydriver.CUdeviceptr* cydptrs = NULL + if len(dptrs) > 1: + cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) + if cydptrs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dptrs)) + 'x' + str(sizeof(cydriver.CUdeviceptr))) + else: + for idx in range(len(dptrs)): + cydptrs[idx] = (dptrs[idx])._pvt_ptr[0] + elif len(dptrs) == 1: + cydptrs = (dptrs[0])._pvt_ptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cydriver.CUmemLocation* cyprefetchLocs = NULL + if len(prefetchLocs) > 1: + cyprefetchLocs = calloc(len(prefetchLocs), sizeof(cydriver.CUmemLocation)) + if cyprefetchLocs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(prefetchLocs)) + 'x' + str(sizeof(cydriver.CUmemLocation))) + for idx in range(len(prefetchLocs)): + string.memcpy(&cyprefetchLocs[idx], (prefetchLocs[idx])._pvt_ptr, sizeof(cydriver.CUmemLocation)) + elif len(prefetchLocs) == 1: + cyprefetchLocs = (prefetchLocs[0])._pvt_ptr + cdef vector[size_t] cyprefetchLocIdxs = prefetchLocIdxs + if numPrefetchLocs > len(prefetchLocs): raise RuntimeError("List is too small: " + str(len(prefetchLocs)) + " < " + str(numPrefetchLocs)) + if numPrefetchLocs > len(prefetchLocIdxs): raise RuntimeError("List is too small: " + str(len(prefetchLocIdxs)) + " < " + str(numPrefetchLocs)) + with nogil: + err = cydriver.cuMemPrefetchBatchAsync(cydptrs, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cyhStream) + if len(dptrs) > 1 and cydptrs is not NULL: + free(cydptrs) + if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: + free(cyprefetchLocs) + return (_dict_CUresult[err],) +{{endif}} + +{{if 'cuMemDiscardBatchAsync' in found_functions}} + +@cython.embedsignature(True) +def cuMemDiscardBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, unsigned long long flags, hStream): + """ Performs a batch of memory discards asynchronously. + + Performs a batch of memory discards. The batch as a whole executes in + stream order but operations within a batch are not guaranteed to + execute in any specific order. All devices in the system must have a + non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` otherwise the + API will return an error. + + Discarding a memory range informs the driver that the contents of that + range are no longer useful. Discarding memory ranges allows the driver + to optimize certain data migrations and can also help reduce memory + pressure. This operation can be undone on any part of the range by + either writing to it or prefetching it via + :py:obj:`~.cuMemPrefetchAsync` or :py:obj:`~.cuMemPrefetchBatchAsync`. + Reading from a discarded range, without a subsequent write or prefetch + to that part of the range, will return an indeterminate value. Note + that any reads, writes or prefetches to any part of the memory range + that occur simultaneously with the discard operation result in + undefined behavior. + + Performs memory discard on address ranges specified in `dptrs` and + `sizes`. Both arrays must be of the same length as specified by + `count`. Each memory range specified must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables or it may also refer to system-allocated memory when all + devices have a non-zero value for + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. + + Parameters + ---------- + dptrs : List[:py:obj:`~.CUdeviceptr`] + Array of pointers to be discarded + sizes : List[int] + Array of sizes for memory discard operations. + count : size_t + Size of `dptrs` and `sizes` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + CUresult + + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): + raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + cdef cydriver.CUdeviceptr* cydptrs = NULL + if len(dptrs) > 1: + cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) + if cydptrs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dptrs)) + 'x' + str(sizeof(cydriver.CUdeviceptr))) + else: + for idx in range(len(dptrs)): + cydptrs[idx] = (dptrs[idx])._pvt_ptr[0] + elif len(dptrs) == 1: + cydptrs = (dptrs[0])._pvt_ptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + with nogil: + err = cydriver.cuMemDiscardBatchAsync(cydptrs, cysizes.data(), count, flags, cyhStream) + if len(dptrs) > 1 and cydptrs is not NULL: + free(cydptrs) + return (_dict_CUresult[err],) +{{endif}} + +{{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + +@cython.embedsignature(True) +def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[CUmemLocation] | List[CUmemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, hStream): + """ Performs a batch of memory discards and prefetches asynchronously. + + Performs a batch of memory discards followed by prefetches. The batch + as a whole executes in stream order but operations within a batch are + not guaranteed to execute in any specific order. All devices in the + system must have a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` otherwise the + API will return an error. + + Calling :py:obj:`~.cuMemDiscardAndPrefetchBatchAsync` is semantically + equivalent to calling :py:obj:`~.cuMemDiscardBatchAsync` followed by + :py:obj:`~.cuMemPrefetchBatchAsync`, but is more optimal. For more + details on what discarding and prefetching imply, please refer to + :py:obj:`~.cuMemDiscardBatchAsync` and + :py:obj:`~.cuMemPrefetchBatchAsync` respectively. Note that any reads, + writes or prefetches to any part of the memory range that occur + simultaneously with this combined discard+prefetch operation result in + undefined behavior. + + Performs memory discard and prefetch on address ranges specified in + `dptrs` and `sizes`. Both arrays must be of the same length as + specified by `count`. Each memory range specified must refer to managed + memory allocated via :py:obj:`~.cuMemAllocManaged` or declared via + managed variables or it may also refer to system-allocated memory when + all devices have a non-zero value for + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Every operation + in the batch has to be associated with a valid location to prefetch the + address range to and specified in the `prefetchLocs` array. Each entry + in this array can apply to more than one operation. This can be done by + specifying in the `prefetchLocIdxs` array, the index of the first + operation that the corresponding entry in the `prefetchLocs` array + applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the + same length as specified by `numPrefetchLocs`. For example, if a batch + has 10 operations listed in dptrs/sizes, the first 6 of which are to be + prefetched to one location and the remaining 4 are to be prefetched to + another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be + {0, 6} and `prefetchLocs` will contain the two set of locations. Note + the first entry in `prefetchLocIdxs` must always be 0. Also, each entry + must be greater than the previous entry and the last entry should be + less than `count`. Furthermore, `numPrefetchLocs` must be lesser than + or equal to `count`. + + Parameters + ---------- + dptrs : List[:py:obj:`~.CUdeviceptr`] + Array of pointers to be discarded + sizes : List[int] + Array of sizes for memory discard operations. + count : size_t + Size of `dptrs` and `sizes` arrays. + prefetchLocs : List[:py:obj:`~.CUmemLocation`] + Array of locations to prefetch to. + prefetchLocIdxs : List[int] + Array of indices to specify which operands each entry in the + `prefetchLocs` array applies to. The locations specified in + prefetchLocs[k] will be applied to operations starting from + prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also + prefetchLocs[numPrefetchLocs - 1] will apply to copies starting + from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. + numPrefetchLocs : size_t + Size of `prefetchLocs` and `prefetchLocIdxs` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + CUresult + + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + prefetchLocs = [] if prefetchLocs is None else prefetchLocs + if not all(isinstance(_x, (CUmemLocation,)) for _x in prefetchLocs): + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cydriver.CUmemLocation,] or List[cydriver.CUmemLocation,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): + raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + cdef cydriver.CUdeviceptr* cydptrs = NULL + if len(dptrs) > 1: + cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) + if cydptrs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dptrs)) + 'x' + str(sizeof(cydriver.CUdeviceptr))) + else: + for idx in range(len(dptrs)): + cydptrs[idx] = (dptrs[idx])._pvt_ptr[0] + elif len(dptrs) == 1: + cydptrs = (dptrs[0])._pvt_ptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cydriver.CUmemLocation* cyprefetchLocs = NULL + if len(prefetchLocs) > 1: + cyprefetchLocs = calloc(len(prefetchLocs), sizeof(cydriver.CUmemLocation)) + if cyprefetchLocs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(prefetchLocs)) + 'x' + str(sizeof(cydriver.CUmemLocation))) + for idx in range(len(prefetchLocs)): + string.memcpy(&cyprefetchLocs[idx], (prefetchLocs[idx])._pvt_ptr, sizeof(cydriver.CUmemLocation)) + elif len(prefetchLocs) == 1: + cyprefetchLocs = (prefetchLocs[0])._pvt_ptr + cdef vector[size_t] cyprefetchLocIdxs = prefetchLocIdxs + if numPrefetchLocs > len(prefetchLocs): raise RuntimeError("List is too small: " + str(len(prefetchLocs)) + " < " + str(numPrefetchLocs)) + if numPrefetchLocs > len(prefetchLocIdxs): raise RuntimeError("List is too small: " + str(len(prefetchLocIdxs)) + " < " + str(numPrefetchLocs)) + with nogil: + err = cydriver.cuMemDiscardAndPrefetchBatchAsync(cydptrs, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cyhStream) + if len(dptrs) > 1 and cydptrs is not NULL: + free(cydptrs) + if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: + free(cyprefetchLocs) return (_dict_CUresult[err],) {{endif}} @@ -36516,11 +36390,10 @@ def cuStreamGetCtx(hStream): Returns the CUDA context that the stream is associated with. - Note there is a later version of this API, - :py:obj:`~.cuStreamGetCtx_v2`. It will supplant this version in CUDA - 13.0. It is recommended to use :py:obj:`~.cuStreamGetCtx_v2` till then - as this version will return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` for - streams created via the API :py:obj:`~.cuGreenCtxStreamCreate`. + If the stream was created via the API + :py:obj:`~.cuGreenCtxStreamCreate`, the returned context is equivalent + to the one returned by :py:obj:`~.cuCtxFromGreenCtx()` on the green + context associated with the stream at creation time. The stream handle `hStream` can refer to any of the following: @@ -36556,7 +36429,7 @@ def cuStreamGetCtx(hStream): See Also -------- - :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice` :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cuStreamGetCtx_v2`, :py:obj:`~.cudaStreamCreateWithFlags` + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice` :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -37176,7 +37049,7 @@ def cuStreamIsCapturing(hStream): return (_dict_CUresult[err], CUstreamCaptureStatus(captureStatus)) {{endif}} -{{if 'cuStreamGetCaptureInfo_v2' in found_functions}} +{{if 'cuStreamGetCaptureInfo_v3' in found_functions}} @cython.embedsignature(True) def cuStreamGetCaptureInfo(hStream): @@ -37193,90 +37066,6 @@ def cuStreamGetCaptureInfo(hStream): - the call returns CUDA_SUCCESS - - the returned capture status is - :py:obj:`~.CU_STREAM_CAPTURE_STATUS_ACTIVE` - - Parameters - ---------- - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - The stream to query - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT` - captureStatus_out : :py:obj:`~.CUstreamCaptureStatus` - Location to return the capture status of the stream; required - id_out : :py:obj:`~.cuuint64_t` - Optional location to return an id for the capture sequence, which - is unique over the lifetime of the process - graph_out : :py:obj:`~.CUgraph` - Optional location to return the graph being captured into. All - operations other than destroy and node removal are permitted on the - graph while the capture sequence is in progress. This API does not - transfer ownership of the graph, which is transferred or destroyed - at :py:obj:`~.cuStreamEndCapture`. Note that the graph handle may - be invalidated before end of capture for certain errors. Nodes that - are or become unreachable from the original stream at - :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph - do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. - dependencies_out : List[:py:obj:`~.CUgraphNode`] - Optional location to store a pointer to an array of nodes. The next - node to be captured in the stream will depend on this set of nodes, - absent operations such as event wait which modify this set. The - array pointer is valid until the next API call which operates on - the stream or until the capture is terminated. The node handles may - be copied out and are valid until they or the graph is destroyed. - The driver-owned array may also be passed directly to APIs that - operate on the graph (not the stream) without copying. - numDependencies_out : int - Optional location to store the size of the array returned in - dependencies_out. - - See Also - -------- - :py:obj:`~.cuStreamGetCaptureInfo_v3` :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamUpdateCaptureDependencies` - """ - cdef cydriver.CUstream cyhStream - if hStream is None: - phStream = 0 - elif isinstance(hStream, (CUstream,)): - phStream = int(hStream) - else: - phStream = int(CUstream(hStream)) - cyhStream = phStream - cdef cydriver.CUstreamCaptureStatus captureStatus_out - cdef cuuint64_t id_out = cuuint64_t() - cdef CUgraph graph_out = CUgraph() - cdef const cydriver.CUgraphNode* cydependencies_out = NULL - pydependencies_out = [] - cdef size_t numDependencies_out = 0 - with nogil: - err = cydriver.cuStreamGetCaptureInfo(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) - if CUresult(err) == CUresult(0): - pydependencies_out = [CUgraphNode(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None, None, None) - return (_dict_CUresult[err], CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) -{{endif}} - -{{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - -@cython.embedsignature(True) -def cuStreamGetCaptureInfo_v3(hStream): - """ Query a stream's capture state (12.3+) - - Query stream state related to stream capture. - - If called on :py:obj:`~.CU_STREAM_LEGACY` (the "null stream") while a - stream not created with :py:obj:`~.CU_STREAM_NON_BLOCKING` is - capturing, returns :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`. - - Valid data (other than capture status) is returned only if both of the - following are true: - - - the call returns CUDA_SUCCESS - - the returned capture status is :py:obj:`~.CU_STREAM_CAPTURE_STATUS_ACTIVE` @@ -37331,7 +37120,7 @@ def cuStreamGetCaptureInfo_v3(hStream): See Also -------- - :py:obj:`~.cuStreamGetCaptureInfo`, :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamUpdateCaptureDependencies` + :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamUpdateCaptureDependencies` """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -37350,7 +37139,7 @@ def cuStreamGetCaptureInfo_v3(hStream): pyedgeData_out = [] cdef size_t numDependencies_out = 0 with nogil: - err = cydriver.cuStreamGetCaptureInfo_v3(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) + err = cydriver.cuStreamGetCaptureInfo(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) if CUresult(err) == CUresult(0): pydependencies_out = [CUgraphNode(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] if CUresult(err) == CUresult(0): @@ -37360,87 +37149,11 @@ def cuStreamGetCaptureInfo_v3(hStream): return (_dict_CUresult[err], CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) {{endif}} -{{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - -@cython.embedsignature(True) -def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, unsigned int flags): - """ Update the set of dependencies in a capturing stream (11.3+) - - Modifies the dependency set of a capturing stream. The dependency set - is the set of nodes that the next captured node in the stream will - depend on. - - Valid flags are :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES` and - :py:obj:`~.CU_STREAM_SET_CAPTURE_DEPENDENCIES`. These control whether - the set passed to the API is added to the existing set or replaces it. - A flags value of 0 defaults to - :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES`. - - Nodes that are removed from the dependency set via this API do not - result in :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED` if they are - unreachable from the stream at :py:obj:`~.cuStreamEndCapture`. - - Returns :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if the stream is not - capturing. - - This API is new in CUDA 11.3. Developers requiring compatibility across - minor versions to CUDA 11.0 should not use this API or provide a - fallback. - - Parameters - ---------- - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - The stream to update - dependencies : List[:py:obj:`~.CUgraphNode`] - The set of dependencies to add - numDependencies : size_t - The size of the dependencies array - flags : unsigned int - See above - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` - - See Also - -------- - :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamGetCaptureInfo`, - """ - dependencies = [] if dependencies is None else dependencies - if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - cdef cydriver.CUstream cyhStream - if hStream is None: - phStream = 0 - elif isinstance(hStream, (CUstream,)): - phStream = int(hStream) - else: - phStream = int(CUstream(hStream)) - cyhStream = phStream - cdef cydriver.CUgraphNode* cydependencies = NULL - if len(dependencies) > 1: - cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) - if cydependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(dependencies)): - cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] - elif len(dependencies) == 1: - cydependencies = (dependencies[0])._pvt_ptr - if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - with nogil: - err = cydriver.cuStreamUpdateCaptureDependencies(cyhStream, cydependencies, numDependencies, flags) - if len(dependencies) > 1 and cydependencies is not NULL: - free(cydependencies) - return (_dict_CUresult[err],) -{{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): - """ Update the set of dependencies in a capturing stream (12.3+) +def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream. Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the stream will @@ -37515,7 +37228,7 @@ def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[Tuple[ elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr with nogil: - err = cydriver.cuStreamUpdateCaptureDependencies_v2(cyhStream, cydependencies, cydependencyData, numDependencies, flags) + err = cydriver.cuStreamUpdateCaptureDependencies(cyhStream, cydependencies, cydependencyData, numDependencies, flags) if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: @@ -38202,83 +37915,10 @@ def cuEventDestroy(hEvent): return (_dict_CUresult[err],) {{endif}} -{{if 'cuEventElapsedTime' in found_functions}} - -@cython.embedsignature(True) -def cuEventElapsedTime(hStart, hEnd): - """ Computes the elapsed time between two events. - - Computes the elapsed time between two events (in milliseconds with a - resolution of around 0.5 microseconds). - - If either event was last recorded in a non-NULL stream, the resulting - time may be greater than expected (even if both used the same stream - handle). This happens because the :py:obj:`~.cuEventRecord()` operation - takes place asynchronously and there is no guarantee that the measured - latency is actually just between the two events. Any number of other - different stream operations could execute in between the two measured - events, thus altering the timing in a significant way. - - If :py:obj:`~.cuEventRecord()` has not been called on either event then - :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. If - :py:obj:`~.cuEventRecord()` has been called on both events but one or - both of them has not yet been completed (that is, - :py:obj:`~.cuEventQuery()` would return - :py:obj:`~.CUDA_ERROR_NOT_READY` on at least one of the events), - :py:obj:`~.CUDA_ERROR_NOT_READY` is returned. If either event was - created with the :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag, then this - function will return :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`. - - Note there is a later version of this API, - :py:obj:`~.cuEventElapsedTime_v2`. It will supplant this version in - CUDA 13.0, which is retained for minor version compatibility. - - Parameters - ---------- - hStart : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` - Starting event - hEnd : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` - Ending event - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_READY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` - pMilliseconds : float - Time between `hStart` and `hEnd` in ms - - See Also - -------- - :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cudaEventElapsedTime` - """ - cdef cydriver.CUevent cyhEnd - if hEnd is None: - phEnd = 0 - elif isinstance(hEnd, (CUevent,)): - phEnd = int(hEnd) - else: - phEnd = int(CUevent(hEnd)) - cyhEnd = phEnd - cdef cydriver.CUevent cyhStart - if hStart is None: - phStart = 0 - elif isinstance(hStart, (CUevent,)): - phStart = int(hStart) - else: - phStart = int(CUevent(hStart)) - cyhStart = phStart - cdef float pMilliseconds = 0 - with nogil: - err = cydriver.cuEventElapsedTime(&pMilliseconds, cyhStart, cyhEnd) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pMilliseconds) -{{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} @cython.embedsignature(True) -def cuEventElapsedTime_v2(hStart, hEnd): +def cuEventElapsedTime(hStart, hEnd): """ Computes the elapsed time between two events. Computes the elapsed time between two events (in milliseconds with a @@ -38342,7 +37982,7 @@ def cuEventElapsedTime_v2(hStart, hEnd): cyhStart = phStart cdef float pMilliseconds = 0 with nogil: - err = cydriver.cuEventElapsedTime_v2(&pMilliseconds, cyhStart, cyhEnd) + err = cydriver.cuEventElapsedTime(&pMilliseconds, cyhStart, cyhEnd) if err != cydriver.CUDA_SUCCESS: return (_dict_CUresult[err], None) return (_dict_CUresult[err], pMilliseconds) @@ -38462,6 +38102,16 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC` for memory synchronization. + If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`, then + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::fd must be a + valid file descriptor referencing a dma_buf object and + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.flags` must be zero. + Importing a dma_buf object is supported only on Tegra Jetson platform + starting with Thor series. Mapping an imported dma_buf object as CUDA + mipmapped array using + :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` is not supported. + The size of the memory object must be specified in :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.size`. @@ -38609,6 +38259,9 @@ def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_E :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.numLevels` must be equal to 1. + Mapping `extMem` imported from a handle of type + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`, is not supported. + The returned CUDA mipmapped array must be freed using :py:obj:`~.cuMipmappedArrayDestroy`. @@ -38903,7 +38556,21 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap handle such situations, either by not using the same semaphore object with deterministic fence support enabled in different streams or by adding explicit dependency amongst such streams so that the semaphore - is signaled in order. + is signaled in order. NvSciSyncFence associated with semaphore object + of the type :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC` can + be timestamp enabled. For this the NvSciSyncAttrList used to create the + object must have the value of NvSciSyncAttrKey_WaiterRequireTimestamps + key set to true. Timestamps are emitted asynchronously by the GPU and + CUDA saves the GPU timestamp in the corresponding NvSciSyncFence at the + time of signal on GPU. Users are expected to convert GPU clocks to CPU + clocks using appropriate scaling functions. Users are expected to wait + for the completion of the fence before extracting timestamp using + appropriate NvSciSync APIs. Users are expected to ensure that there is + only one outstanding timestamp enabled fence per Cuda-NvSciSync object + at any point of time, failing which leads to undefined behavior. + Extracting the timestamp before the corresponding fence is signalled + could lead to undefined behaviour. Timestamp extracted via appropriate + NvSciSync API would be in microseconds. If the semaphore object is any one of the following types: :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`, @@ -39457,7 +39124,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[C Notes ----- - Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. For more information, see the Stream Memory Operations section in the programming guide(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html). + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. """ paramArray = [] if paramArray is None else paramArray if not all(isinstance(_x, (CUstreamBatchMemOpParams,)) for _x in paramArray): @@ -42926,7 +42593,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] Notes ----- - Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. For more information, see the Stream Memory Operations section in the programming guide(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html). + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -43820,85 +43487,12 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): return (_dict_CUresult[err], pyrootNodes, numRootNodes) {{endif}} -{{if 'cuGraphGetEdges' in found_functions}} +{{if 'cuGraphGetEdges_v2' in found_functions}} @cython.embedsignature(True) def cuGraphGetEdges(hGraph, size_t numEdges = 0): """ Returns a graph's dependency edges. - Returns a list of `hGraph's` dependency edges. Edges are returned via - corresponding indices in `from` and `to`; that is, the node in `to`[i] - has a dependency on the node in `from`[i]. `from` and `to` may both be - NULL, in which case this function only returns the number of edges in - `numEdges`. Otherwise, `numEdges` entries will be filled in. If - `numEdges` is higher than the actual number of edges, the remaining - entries in `from` and `to` will be set to NULL, and the number of edges - actually returned will be written to `numEdges`. - - Parameters - ---------- - hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to get the edges from - numEdges : int - See description - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - from : List[:py:obj:`~.CUgraphNode`] - Location to return edge endpoints - to : List[:py:obj:`~.CUgraphNode`] - Location to return edge endpoints - numEdges : int - See description - - See Also - -------- - :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` - """ - cdef size_t _graph_length = numEdges - cdef cydriver.CUgraph cyhGraph - if hGraph is None: - phGraph = 0 - elif isinstance(hGraph, (CUgraph,)): - phGraph = int(hGraph) - else: - phGraph = int(CUgraph(hGraph)) - cyhGraph = phGraph - cdef cydriver.CUgraphNode* cyfrom_ = NULL - pyfrom_ = [] - if _graph_length != 0: - cyfrom_ = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) - cdef cydriver.CUgraphNode* cyto = NULL - pyto = [] - if _graph_length != 0: - cyto = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) - with nogil: - err = cydriver.cuGraphGetEdges(cyhGraph, cyfrom_, cyto, &numEdges) - if CUresult(err) == CUresult(0): - pyfrom_ = [CUgraphNode(init_value=cyfrom_[idx]) for idx in range(_graph_length)] - if cyfrom_ is not NULL: - free(cyfrom_) - if CUresult(err) == CUresult(0): - pyto = [CUgraphNode(init_value=cyto[idx]) for idx in range(_graph_length)] - if cyto is not NULL: - free(cyto) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None) - return (_dict_CUresult[err], pyfrom_, pyto, numEdges) -{{endif}} - -{{if 'cuGraphGetEdges_v2' in found_functions}} - -@cython.embedsignature(True) -def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): - """ Returns a graph's dependency edges (12.3+) - Returns a list of `hGraph's` dependency edges. Edges are returned via corresponding indices in `from`, `to` and `edgeData`; that is, the node in `to`[i] has a dependency on the node in `from`[i] with data @@ -43965,7 +43559,7 @@ def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) with nogil: - err = cydriver.cuGraphGetEdges_v2(cyhGraph, cyfrom_, cyto, cyedgeData, &numEdges) + err = cydriver.cuGraphGetEdges(cyhGraph, cyfrom_, cyto, cyedgeData, &numEdges) if CUresult(err) == CUresult(0): pyfrom_ = [CUgraphNode(init_value=cyfrom_[idx]) for idx in range(_graph_length)] if cyfrom_ is not NULL: @@ -43983,7 +43577,7 @@ def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): return (_dict_CUresult[err], pyfrom_, pyto, pyedgeData, numEdges) {{endif}} -{{if 'cuGraphNodeGetDependencies' in found_functions}} +{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): @@ -43997,66 +43591,6 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): NULL, and the number of nodes actually obtained will be returned in `numDependencies`. - Parameters - ---------- - hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` - Node to query - numDependencies : int - See description - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependencies : List[:py:obj:`~.CUgraphNode`] - Pointer to return the dependencies - numDependencies : int - See description - - See Also - -------- - :py:obj:`~.cuGraphNodeGetDependentNodes`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` - """ - cdef size_t _graph_length = numDependencies - cdef cydriver.CUgraphNode cyhNode - if hNode is None: - phNode = 0 - elif isinstance(hNode, (CUgraphNode,)): - phNode = int(hNode) - else: - phNode = int(CUgraphNode(hNode)) - cyhNode = phNode - cdef cydriver.CUgraphNode* cydependencies = NULL - pydependencies = [] - if _graph_length != 0: - cydependencies = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) - if cydependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) - with nogil: - err = cydriver.cuGraphNodeGetDependencies(cyhNode, cydependencies, &numDependencies) - if CUresult(err) == CUresult(0): - pydependencies = [CUgraphNode(init_value=cydependencies[idx]) for idx in range(_graph_length)] - if cydependencies is not NULL: - free(cydependencies) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pydependencies, numDependencies) -{{endif}} - -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - -@cython.embedsignature(True) -def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): - """ Returns a node's dependencies (12.3+) - - Returns a list of `node's` dependencies. `dependencies` may be NULL, in - which case this function will return the number of dependencies in - `numDependencies`. Otherwise, `numDependencies` entries will be filled - in. If `numDependencies` is higher than the actual number of - dependencies, the remaining entries in `dependencies` will be set to - NULL, and the number of nodes actually obtained will be returned in - `numDependencies`. - Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. If `edgeData` is non-NULL, then @@ -44106,7 +43640,7 @@ def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) with nogil: - err = cydriver.cuGraphNodeGetDependencies_v2(cyhNode, cydependencies, cyedgeData, &numDependencies) + err = cydriver.cuGraphNodeGetDependencies(cyhNode, cydependencies, cyedgeData, &numDependencies) if CUresult(err) == CUresult(0): pydependencies = [CUgraphNode(init_value=cydependencies[idx]) for idx in range(_graph_length)] if cydependencies is not NULL: @@ -44120,7 +43654,7 @@ def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): return (_dict_CUresult[err], pydependencies, pyedgeData, numDependencies) {{endif}} -{{if 'cuGraphNodeGetDependentNodes' in found_functions}} +{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): @@ -44134,66 +43668,6 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): will be set to NULL, and the number of nodes actually obtained will be returned in `numDependentNodes`. - Parameters - ---------- - hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` - Node to query - numDependentNodes : int - See description - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependentNodes : List[:py:obj:`~.CUgraphNode`] - Pointer to return the dependent nodes - numDependentNodes : int - See description - - See Also - -------- - :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` - """ - cdef size_t _graph_length = numDependentNodes - cdef cydriver.CUgraphNode cyhNode - if hNode is None: - phNode = 0 - elif isinstance(hNode, (CUgraphNode,)): - phNode = int(hNode) - else: - phNode = int(CUgraphNode(hNode)) - cyhNode = phNode - cdef cydriver.CUgraphNode* cydependentNodes = NULL - pydependentNodes = [] - if _graph_length != 0: - cydependentNodes = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) - if cydependentNodes is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) - with nogil: - err = cydriver.cuGraphNodeGetDependentNodes(cyhNode, cydependentNodes, &numDependentNodes) - if CUresult(err) == CUresult(0): - pydependentNodes = [CUgraphNode(init_value=cydependentNodes[idx]) for idx in range(_graph_length)] - if cydependentNodes is not NULL: - free(cydependentNodes) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pydependentNodes, numDependentNodes) -{{endif}} - -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - -@cython.embedsignature(True) -def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): - """ Returns a node's dependent nodes (12.3+) - - Returns a list of `node's` dependent nodes. `dependentNodes` may be - NULL, in which case this function will return the number of dependent - nodes in `numDependentNodes`. Otherwise, `numDependentNodes` entries - will be filled in. If `numDependentNodes` is higher than the actual - number of dependent nodes, the remaining entries in `dependentNodes` - will be set to NULL, and the number of nodes actually obtained will be - returned in `numDependentNodes`. - Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. If `edgeData` is non-NULL, then @@ -44243,7 +43717,7 @@ def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) with nogil: - err = cydriver.cuGraphNodeGetDependentNodes_v2(cyhNode, cydependentNodes, cyedgeData, &numDependentNodes) + err = cydriver.cuGraphNodeGetDependentNodes(cyhNode, cydependentNodes, cyedgeData, &numDependentNodes) if CUresult(err) == CUresult(0): pydependentNodes = [CUgraphNode(init_value=cydependentNodes[idx]) for idx in range(_graph_length)] if cydependentNodes is not NULL: @@ -44257,87 +43731,11 @@ def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): return (_dict_CUresult[err], pydependentNodes, pyedgeData, numDependentNodes) {{endif}} -{{if 'cuGraphAddDependencies' in found_functions}} - -@cython.embedsignature(True) -def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): - """ Adds dependency edges to a graph. - - The number of dependencies to be added is defined by `numDependencies` - Elements in `from` and `to` at corresponding indices define a - dependency. Each node in `from` and `to` must belong to `hGraph`. - - If `numDependencies` is 0, elements in `from` and `to` will be ignored. - Specifying an existing dependency will return an error. - - Parameters - ---------- - hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to which dependencies are added - from : List[:py:obj:`~.CUgraphNode`] - Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] - Array of dependent nodes - numDependencies : size_t - Number of dependencies to be added - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - - See Also - -------- - :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` - """ - to = [] if to is None else to - if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - from_ = [] if from_ is None else from_ - if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - cdef cydriver.CUgraph cyhGraph - if hGraph is None: - phGraph = 0 - elif isinstance(hGraph, (CUgraph,)): - phGraph = int(hGraph) - else: - phGraph = int(CUgraph(hGraph)) - cyhGraph = phGraph - cdef cydriver.CUgraphNode* cyfrom_ = NULL - if len(from_) > 1: - cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(from_)): - cyfrom_[idx] = (from_[idx])._pvt_ptr[0] - elif len(from_) == 1: - cyfrom_ = (from_[0])._pvt_ptr - cdef cydriver.CUgraphNode* cyto = NULL - if len(to) > 1: - cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(to)): - cyto[idx] = (to[idx])._pvt_ptr[0] - elif len(to) == 1: - cyto = (to[0])._pvt_ptr - with nogil: - err = cydriver.cuGraphAddDependencies(cyhGraph, cyfrom_, cyto, numDependencies) - if len(from_) > 1 and cyfrom_ is not NULL: - free(cyfrom_) - if len(to) > 1 and cyto is not NULL: - free(cyto) - return (_dict_CUresult[err],) -{{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): - """ Adds dependency edges to a graph (12.3+) +def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): + """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` Elements in `from` and `to` at corresponding indices define a @@ -44416,7 +43814,7 @@ def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List elif len(edgeData) == 1: cyedgeData = (edgeData[0])._pvt_ptr with nogil: - err = cydriver.cuGraphAddDependencies_v2(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) + err = cydriver.cuGraphAddDependencies(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) if len(from_) > 1 and cyfrom_ is not NULL: free(cyfrom_) if len(to) > 1 and cyto is not NULL: @@ -44426,91 +43824,11 @@ def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List return (_dict_CUresult[err],) {{endif}} -{{if 'cuGraphRemoveDependencies' in found_functions}} - -@cython.embedsignature(True) -def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): - """ Removes dependency edges from a graph. - - The number of `dependencies` to be removed is defined by - `numDependencies`. Elements in `from` and `to` at corresponding indices - define a dependency. Each node in `from` and `to` must belong to - `hGraph`. - - If `numDependencies` is 0, elements in `from` and `to` will be ignored. - Specifying a non-existing dependency will return an error. - - Dependencies cannot be removed from graphs which contain allocation or - free nodes. Any attempt to do so will return an error. - - Parameters - ---------- - hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph from which to remove dependencies - from : List[:py:obj:`~.CUgraphNode`] - Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] - Array of dependent nodes - numDependencies : size_t - Number of dependencies to be removed - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - - See Also - -------- - :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` - """ - to = [] if to is None else to - if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - from_ = [] if from_ is None else from_ - if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - cdef cydriver.CUgraph cyhGraph - if hGraph is None: - phGraph = 0 - elif isinstance(hGraph, (CUgraph,)): - phGraph = int(hGraph) - else: - phGraph = int(CUgraph(hGraph)) - cyhGraph = phGraph - cdef cydriver.CUgraphNode* cyfrom_ = NULL - if len(from_) > 1: - cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(from_)): - cyfrom_[idx] = (from_[idx])._pvt_ptr[0] - elif len(from_) == 1: - cyfrom_ = (from_[0])._pvt_ptr - cdef cydriver.CUgraphNode* cyto = NULL - if len(to) > 1: - cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(to)): - cyto[idx] = (to[idx])._pvt_ptr[0] - elif len(to) == 1: - cyto = (to[0])._pvt_ptr - with nogil: - err = cydriver.cuGraphRemoveDependencies(cyhGraph, cyfrom_, cyto, numDependencies) - if len(from_) > 1 and cyfrom_ is not NULL: - free(cyfrom_) - if len(to) > 1 and cyto is not NULL: - free(cyto) - return (_dict_CUresult[err],) -{{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): - """ Removes dependency edges from a graph (12.3+) +def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): + """ Removes dependency edges from a graph. The number of `dependencies` to be removed is defined by `numDependencies`. Elements in `from` and `to` at corresponding indices @@ -44595,7 +43913,7 @@ def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | L elif len(edgeData) == 1: cyedgeData = (edgeData[0])._pvt_ptr with nogil: - err = cydriver.cuGraphRemoveDependencies_v2(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) + err = cydriver.cuGraphRemoveDependencies(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) if len(from_) > 1 and cyfrom_ is not NULL: free(cyfrom_) if len(to) > 1 and cyto is not NULL: @@ -46459,91 +45777,11 @@ def cuGraphReleaseUserObject(graph, object, unsigned int count): return (_dict_CUresult[err],) {{endif}} -{{if 'cuGraphAddNode' in found_functions}} - -@cython.embedsignature(True) -def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): - """ Adds a node of arbitrary type to a graph. - - Creates a new node in `hGraph` described by `nodeParams` with - `numDependencies` dependencies specified via `dependencies`. - `numDependencies` may be 0. `dependencies` may be null if - `numDependencies` is 0. `dependencies` may not have any duplicate - entries. - - `nodeParams` is a tagged union. The node type should be specified in - the `typename` field, and type-specific parameters in the corresponding - union member. All unused bytes - that is, `reserved0` and all bytes - past the utilized union member - must be set to zero. It is recommended - to use brace initialization or memset to ensure all bytes are - initialized. - - Note that for some node types, `nodeParams` may contain "out - parameters" which are modified during the call, such as - `nodeParams->alloc.dptr`. - - A handle to the new node will be returned in `phGraphNode`. - - Parameters - ---------- - hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] - Dependencies of the node - numDependencies : size_t - Number of dependencies - nodeParams : :py:obj:`~.CUgraphNodeParams` - Specification of the node - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` - phGraphNode : :py:obj:`~.CUgraphNode` - Returns newly created node - - See Also - -------- - :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphExecNodeSetParams` - """ - dependencies = [] if dependencies is None else dependencies - if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") - cdef cydriver.CUgraph cyhGraph - if hGraph is None: - phGraph = 0 - elif isinstance(hGraph, (CUgraph,)): - phGraph = int(hGraph) - else: - phGraph = int(CUgraph(hGraph)) - cyhGraph = phGraph - cdef CUgraphNode phGraphNode = CUgraphNode() - cdef cydriver.CUgraphNode* cydependencies = NULL - if len(dependencies) > 1: - cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) - if cydependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) - else: - for idx in range(len(dependencies)): - cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] - elif len(dependencies) == 1: - cydependencies = (dependencies[0])._pvt_ptr - if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL - with nogil: - err = cydriver.cuGraphAddNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) - if len(dependencies) > 1 and cydependencies is not NULL: - free(cydependencies) - if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) -{{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): - """ Adds a node of arbitrary type to a graph (12.3+) +def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): + """ Adds a node of arbitrary type to a graph. Creates a new node in `hGraph` described by `nodeParams` with `numDependencies` dependencies specified via `dependencies`. @@ -46623,11 +45861,9 @@ def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[ string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr - if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL with nogil: - err = cydriver.cuGraphAddNode_v2(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) + err = cydriver.cuGraphAddNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: @@ -50386,12 +49622,17 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED` P2P: 1 if P2P Access is enable. - - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`: 1 if - Atomic operations over the link are supported. + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`: 1 if all + CUDA-valid atomic operations over the link are supported. - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED`: 1 if cudaArray can be accessed over the link. + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED`: + 1 if some CUDA-valid atomic operations over the link are supported. + Information about specific operations can be retrieved with + :py:obj:`~.cuDeviceGetP2PAtomicCapabilities`. + Returns :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if `srcDevice` or `dstDevice` are not valid or if they represent the same device. @@ -50417,7 +49658,7 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, See Also -------- - :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cuCtxDisablePeerAccess`, :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cudaDeviceGetP2PAttribute` + :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cuCtxDisablePeerAccess`, :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cuDeviceGetP2PAtomicCapabilities`, :py:obj:`~.cudaDeviceGetP2PAttribute` """ cdef cydriver.CUdevice cydstDevice if dstDevice is None: @@ -50444,6 +49685,89 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, return (_dict_CUresult[err], value) {{endif}} +{{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + +@cython.embedsignature(True) +def cuDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[CUatomicOperation] | List[CUatomicOperation]], unsigned int count, srcDevice, dstDevice): + """ Queries details about atomic operations supported between two devices. + + Returns in `*capabilities` the details about requested atomic + `*operations` over the the link between `srcDevice` and `dstDevice`. + The allocated size of `*operations` and `*capabilities` must be + `count`. + + For each :py:obj:`~.CUatomicOperation` in `*operations`, the + corresponding result in `*capabilities` will be a bitmask indicating + which of :py:obj:`~.CUatomicOperationCapability` the link supports + natively. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if `srcDevice` or + `dstDevice` are not valid or if they represent the same device. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if `*capabilities` or + `*operations` is NULL, if `count` is 0, or if any of `*operations` is + not valid. + + Parameters + ---------- + operations : List[:py:obj:`~.CUatomicOperation`] + Requested operations + count : unsigned int + Count of requested operations and size of capabilities + srcDevice : :py:obj:`~.CUdevice` + The source device of the target link + dstDevice : :py:obj:`~.CUdevice` + The destination device of the target link + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + capabilities : List[unsigned int] + Returned capability details of each requested operation + + See Also + -------- + :py:obj:`~.cuDeviceGetP2PAttribute`, :py:obj:`~.cudaDeviceGetP2PAttribute`, :py:obj:`~.cudaDeviceGetP2PAtomicCapabilities` + """ + cdef cydriver.CUdevice cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdevice,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdevice(dstDevice)) + cydstDevice = pdstDevice + cdef cydriver.CUdevice cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdevice,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdevice(srcDevice)) + cysrcDevice = psrcDevice + operations = [] if operations is None else operations + if not all(isinstance(_x, (CUatomicOperation)) for _x in operations): + raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cydriver.CUatomicOperation] or List[cydriver.CUatomicOperation]") + cdef unsigned int* cycapabilities = NULL + pycapabilities = [] + if count != 0: + cycapabilities = calloc(count, sizeof(unsigned int)) + if cycapabilities is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(count) + 'x' + str(sizeof(unsigned int))) + cdef vector[cydriver.CUatomicOperation] cyoperations = [pyoperations.value for pyoperations in (operations)] + if count > len(operations): raise RuntimeError("List is too small: " + str(len(operations)) + " < " + str(count)) + with nogil: + err = cydriver.cuDeviceGetP2PAtomicCapabilities(cycapabilities, cyoperations.data(), count, cysrcDevice, cydstDevice) + if CUresult(err) == CUresult(0): + pycapabilities = [cycapabilities[idx] for idx in range(count)] + if cycapabilities is not NULL: + free(cycapabilities) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], pycapabilities) +{{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} @cython.embedsignature(True) @@ -50831,7 +50155,9 @@ def cuGetProcAddress(char* symbol, int cudaVersion, flags): 11.2 should be specified as 11020. For a requested driver symbol, if the specified CUDA version is greater than or equal to the CUDA version in which the driver symbol was introduced, this API will return the - function pointer to the corresponding versioned function. + function pointer to the corresponding versioned function. If the + specified CUDA version is greater than the driver version, the API will + return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. The pointer returned by the API should be cast to a function pointer matching the requested driver function's definition in the API header @@ -50903,7 +50229,7 @@ def cuGetProcAddress(char* symbol, int cudaVersion, flags): See Also -------- - :py:obj:`~.cudaGetDriverEntryPoint` + :py:obj:`~.cudaGetDriverEntryPointByVersion` """ cdef cydriver.cuuint64_t cyflags if flags is None: @@ -51482,7 +50808,7 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): See Also -------- - :py:obj:`~.cuGreenCtxDestroy`, :py:obj:`~.cuCtxFromGreenCtx`, :py:obj:`~.cuCtxSetCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuDevResourceGenerateDesc`, :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxCreate_v3` + :py:obj:`~.cuGreenCtxDestroy`, :py:obj:`~.cuCtxFromGreenCtx`, :py:obj:`~.cuCtxSetCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuDevResourceGenerateDesc`, :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuCtxCreate` """ cdef cydriver.CUdevice cydev if dev is None: @@ -51517,7 +50843,14 @@ def cuGreenCtxDestroy(hCtx): Destroys the green context, releasing the primary context of the device that this green context was created for. Any resources provisioned for this green context (that were initially available via the resource - descriptor) are released as well. + descriptor) are released as well. The API does not destroy streams + created via :py:obj:`~.cuGreenCtxStreamCreate`, + :py:obj:`~.cuStreamCreate`, or :py:obj:`~.cuStreamCreateWithPriority`. + Once the green context is destroyed, any subsequent API calls involving + these streams (including :py:obj:`~.cuStreamDestroy`) will return + :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`. Users must explicitly + destroy all such streams before invoking :py:obj:`~.cuGreenCtxDestroy`. + Failure to do so will result in a memory leak. Parameters ---------- @@ -51758,7 +51091,13 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe guarantee a split that will create a disjoint set of symmetrical partitions. This may lead to fewer groups created than purely dividing the total SM count by the `minCount` due to cluster requirements or - alignment and granularity requirements for the minCount. + alignment and granularity requirements for the minCount. These + requirements can be queried with :py:obj:`~.cuDeviceGetDevResource`, + :py:obj:`~.cuCtxGetDevResource`, and + :py:obj:`~.cuGreenCtxGetDevResource` for + :py:obj:`~.CU_DEV_RESOURCE_TYPE_SM`, using the `minSmPartitionSize` and + `smCoscheduledAlignment` fields to determine minimum partition size and + alignment granularity, respectively. The `remainder` set does not have the same functional or performance guarantees as the groups in `result`. Its use should be carefully @@ -52067,7 +51406,7 @@ def cuStreamGetGreenCtx(hStream): See Also -------- - :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetCtx_v2`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetCtx`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -52160,6 +51499,50 @@ def cuGreenCtxStreamCreate(greenCtx, unsigned int flags, int priority): return (_dict_CUresult[err], phStream) {{endif}} +{{if 'cuGreenCtxGetId' in found_functions}} + +@cython.embedsignature(True) +def cuGreenCtxGetId(greenCtx): + """ Returns the unique Id associated with the green context supplied. + + Returns in `greenCtxId` the unique Id which is associated with a given + green context. The Id is unique for the life of the program for this + instance of CUDA. If green context is supplied as NULL and the current + context is set to a green context, the Id of the current green context + is returned. + + Parameters + ---------- + greenCtx : :py:obj:`~.CUgreenCtx` + Green context for which to obtain the Id + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + greenCtxId : unsigned long long + Pointer to store the Id of the green context + + See Also + -------- + :py:obj:`~.cuGreenCtxCreate`, :py:obj:`~.cuGreenCtxDestroy`, :py:obj:`~.cuCtxGetId` + """ + cdef cydriver.CUgreenCtx cygreenCtx + if greenCtx is None: + pgreenCtx = 0 + elif isinstance(greenCtx, (CUgreenCtx,)): + pgreenCtx = int(greenCtx) + else: + pgreenCtx = int(CUgreenCtx(greenCtx)) + cygreenCtx = pgreenCtx + cdef unsigned long long greenCtxId = 0 + with nogil: + err = cydriver.cuGreenCtxGetId(cygreenCtx, &greenCtxId) + if err != cydriver.CUDA_SUCCESS: + return (_dict_CUresult[err], None) + return (_dict_CUresult[err], greenCtxId) +{{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} ctypedef struct cuLogsCallbackData_st: @@ -52505,42 +51888,6 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin return (_dict_CUresult[err],) {{endif}} -{{if 'cuCheckpointProcessRestore' in found_functions}} - -@cython.embedsignature(True) -def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs]): - """ Restore a CUDA process's GPU memory contents from its last checkpoint. - - Restores a CUDA process specified by `pid` from its last checkpoint. - Process must be in the CHECKPOINTED state to restore. - - Upon successful return the process will be in the LOCKED state. - - CUDA process restore requires persistence mode to be enabled or - :py:obj:`~.cuInit` to have been called before execution. - - Parameters - ---------- - pid : int - The process ID of the CUDA process - args : :py:obj:`~.CUcheckpointRestoreArgs` - Optional restore operation arguments - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` - - See Also - -------- - :py:obj:`~.cuInit` - """ - cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL - with nogil: - err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) - return (_dict_CUresult[err],) -{{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} @cython.embedsignature(True) @@ -54513,12 +53860,12 @@ def sizeof(objType): {{if 'CUcheckpointCheckpointArgs' in found_types}} if objType == CUcheckpointCheckpointArgs: return sizeof(cydriver.CUcheckpointCheckpointArgs){{endif}} - {{if 'CUcheckpointRestoreArgs_st' in found_struct}} - if objType == CUcheckpointRestoreArgs_st: - return sizeof(cydriver.CUcheckpointRestoreArgs_st){{endif}} - {{if 'CUcheckpointRestoreArgs' in found_types}} - if objType == CUcheckpointRestoreArgs: - return sizeof(cydriver.CUcheckpointRestoreArgs){{endif}} + {{if 'CUcheckpointGpuPair_st' in found_struct}} + if objType == CUcheckpointGpuPair_st: + return sizeof(cydriver.CUcheckpointGpuPair_st){{endif}} + {{if 'CUcheckpointGpuPair' in found_types}} + if objType == CUcheckpointGpuPair: + return sizeof(cydriver.CUcheckpointGpuPair){{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} if objType == CUcheckpointUnlockArgs_st: return sizeof(cydriver.CUcheckpointUnlockArgs_st){{endif}} diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 6941f2328..40f21351a 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index a0a4d9a98..a05b63fea 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. cimport cython # NOQA @@ -29,6 +29,15 @@ class Result(_IntEnum): ERROR_THREADPOOL = NVJITLINK_ERROR_THREADPOOL ERROR_UNRECOGNIZED_INPUT = NVJITLINK_ERROR_UNRECOGNIZED_INPUT ERROR_FINALIZE = NVJITLINK_ERROR_FINALIZE + ERROR_NULL_INPUT = NVJITLINK_ERROR_NULL_INPUT + ERROR_INCOMPATIBLE_OPTIONS = NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS + ERROR_INCORRECT_INPUT_TYPE = NVJITLINK_ERROR_INCORRECT_INPUT_TYPE + ERROR_ARCH_MISMATCH = NVJITLINK_ERROR_ARCH_MISMATCH + ERROR_OUTDATED_LIBRARY = NVJITLINK_ERROR_OUTDATED_LIBRARY + ERROR_MISSING_FATBIN = NVJITLINK_ERROR_MISSING_FATBIN + ERROR_UNRECOGNIZED_ARCH = NVJITLINK_ERROR_UNRECOGNIZED_ARCH + ERROR_UNSUPPORTED_ARCH = NVJITLINK_ERROR_UNSUPPORTED_ARCH + ERROR_LTO_NOT_ENABLED = NVJITLINK_ERROR_LTO_NOT_ENABLED class InputType(_IntEnum): """See `nvJitLinkInputType`.""" diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/cuda/bindings/nvrtc.pxd.in index a839b1c56..c9f797520 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cynvrtc as cynvrtc cimport cuda.bindings._lib.utils as utils diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index d274acc99..f852867a3 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from typing import List, Tuple, Any, Optional from enum import IntEnum import cython @@ -81,6 +81,8 @@ class nvrtcResult(IntEnum): NVRTC_ERROR_PCH_CREATE = cynvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE{{endif}} {{if 'NVRTC_ERROR_CANCELLED' in found_values}} NVRTC_ERROR_CANCELLED = cynvrtc.nvrtcResult.NVRTC_ERROR_CANCELLED{{endif}} + {{if 'NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED' in found_values}} + NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = cynvrtc.nvrtcResult.NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED{{endif}} _dict_nvrtcResult = dict(((int(v), v) for k, v in nvrtcResult.__members__.items())) {{endif}} @@ -519,71 +521,6 @@ def nvrtcGetCUBIN(prog, char* cubin): return (_dict_nvrtcResult[err],) {{endif}} -{{if 'nvrtcGetNVVMSize' in found_functions}} - -@cython.embedsignature(True) -def nvrtcGetNVVMSize(prog): - """ DEPRECATION NOTICE: This function will be removed in a future release. Please use nvrtcGetLTOIRSize (and nvrtcGetLTOIR) instead. - - Parameters - ---------- - prog : :py:obj:`~.nvrtcProgram` - None - - Returns - ------- - nvrtcResult - - nvvmSizeRet : int - None - """ - cdef cynvrtc.nvrtcProgram cyprog - if prog is None: - pprog = 0 - elif isinstance(prog, (nvrtcProgram,)): - pprog = int(prog) - else: - pprog = int(nvrtcProgram(prog)) - cyprog = pprog - cdef size_t nvvmSizeRet = 0 - with nogil: - err = cynvrtc.nvrtcGetNVVMSize(cyprog, &nvvmSizeRet) - if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], nvvmSizeRet) -{{endif}} - -{{if 'nvrtcGetNVVM' in found_functions}} - -@cython.embedsignature(True) -def nvrtcGetNVVM(prog, char* nvvm): - """ DEPRECATION NOTICE: This function will be removed in a future release. Please use nvrtcGetLTOIR (and nvrtcGetLTOIRSize) instead. - - Parameters - ---------- - prog : :py:obj:`~.nvrtcProgram` - None - nvvm : bytes - None - - Returns - ------- - nvrtcResult - - """ - cdef cynvrtc.nvrtcProgram cyprog - if prog is None: - pprog = 0 - elif isinstance(prog, (nvrtcProgram,)): - pprog = int(prog) - else: - pprog = int(nvrtcProgram(prog)) - cyprog = pprog - with nogil: - err = cynvrtc.nvrtcGetNVVM(cyprog, nvvm) - return (_dict_nvrtcResult[err],) -{{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} @cython.embedsignature(True) diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index a5a5e1ca7..ea79a3b01 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 24729aa77..8daef79ce 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. cimport cython # NOQA diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in index 6ff973d61..29687849b 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd.in +++ b/cuda_bindings/cuda/bindings/runtime.pxd.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cyruntime as cyruntime cimport cuda.bindings._lib.utils as utils cimport cuda.bindings.driver as driver @@ -193,6 +193,21 @@ cdef class cudaAsyncCallbackHandle_t: cdef cyruntime.cudaAsyncCallbackHandle_t* _pvt_ptr {{endif}} +{{if 'cudaLogsCallbackHandle' in found_types}} + +cdef class cudaLogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogsCallbackHandle _pvt_val + cdef cyruntime.cudaLogsCallbackHandle* _pvt_ptr +{{endif}} + {{if True}} cdef class EGLImageKHR: @@ -283,6 +298,21 @@ cdef class cudaStreamCallback_t: cdef cyruntime.cudaStreamCallback_t* _pvt_ptr {{endif}} +{{if 'cudaLogsCallback_t' in found_types}} + +cdef class cudaLogsCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogsCallback_t _pvt_val + cdef cyruntime.cudaLogsCallback_t* _pvt_ptr +{{endif}} + {{if 'dim3' in found_struct}} cdef class dim3: @@ -1004,6 +1034,24 @@ cdef class anon_struct4: cdef cudaChannelFormatDesc _desc {{endif}} {{endif}} +{{if 'cudaResourceDesc.res.reserved' in found_struct}} + +cdef class anon_struct5: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} + reserved : List[int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr +{{endif}} {{if 'cudaResourceDesc.res' in found_struct}} cdef class anon_union0: @@ -1025,6 +1073,10 @@ cdef class anon_union0: {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} pitch2D : anon_struct4 + {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + reserved : anon_struct5 + {{endif}} Methods @@ -1045,6 +1097,9 @@ cdef class anon_union0: {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} cdef anon_struct4 _pitch2D {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + cdef anon_struct5 _reserved + {{endif}} {{endif}} {{if 'cudaResourceDesc' in found_struct}} @@ -1062,6 +1117,10 @@ cdef class cudaResourceDesc: res : anon_union0 {{endif}} + {{if 'cudaResourceDesc.flags' in found_struct}} + flags : unsigned int + Flags (must be zero) + {{endif}} Methods ------- @@ -1114,6 +1173,10 @@ cdef class cudaResourceViewDesc: lastLayer : unsigned int Last layer index {{endif}} + {{if 'cudaResourceViewDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -1158,6 +1221,10 @@ cdef class cudaPointerAttributes: unregistered memory is allocated so this field may contain invalid pointer if an invalid pointer has been passed to CUDA. {{endif}} + {{if 'cudaPointerAttributes.reserved' in found_struct}} + reserved : List[long] + Must be zero + {{endif}} Methods ------- @@ -1612,7 +1679,7 @@ cdef class cudaOffset3D: {{endif}} {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} -cdef class anon_struct5: +cdef class anon_struct6: """ Attributes ---------- @@ -1645,7 +1712,7 @@ cdef class anon_struct5: {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} -cdef class anon_struct6: +cdef class anon_struct7: """ Attributes ---------- @@ -1678,11 +1745,11 @@ cdef class anon_union1: Attributes ---------- {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} - ptr : anon_struct5 + ptr : anon_struct6 {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} - array : anon_struct6 + array : anon_struct7 {{endif}} @@ -1693,10 +1760,10 @@ cdef class anon_union1: """ cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} - cdef anon_struct5 _ptr + cdef anon_struct6 _ptr {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} - cdef anon_struct6 _array + cdef anon_struct7 _array {{endif}} {{endif}} {{if 'cudaMemcpy3DOperand' in found_struct}} @@ -1849,10 +1916,6 @@ cdef class cudaDeviceProp: maxGridSize : List[int] Maximum size of each dimension of a grid {{endif}} - {{if 'cudaDeviceProp.clockRate' in found_struct}} - clockRate : int - Deprecated, Clock frequency in kilohertz - {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} totalConstMem : size_t Constant memory available on device in bytes @@ -1874,19 +1937,10 @@ cdef class cudaDeviceProp: Pitch alignment requirement for texture references bound to pitched memory {{endif}} - {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} - deviceOverlap : int - Device can concurrently copy memory and execute a kernel. - Deprecated. Use instead asyncEngineCount. - {{endif}} {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} multiProcessorCount : int Number of multiprocessors on device {{endif}} - {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} - kernelExecTimeoutEnabled : int - Deprecated, Specified whether there is a run time limit on kernels - {{endif}} {{if 'cudaDeviceProp.integrated' in found_struct}} integrated : int Device is integrated as opposed to discrete @@ -1896,10 +1950,6 @@ cdef class cudaDeviceProp: Device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer {{endif}} - {{if 'cudaDeviceProp.computeMode' in found_struct}} - computeMode : int - Deprecated, Compute mode (See cudaComputeMode) - {{endif}} {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} maxTexture1D : int Maximum 1D texture size @@ -1908,11 +1958,6 @@ cdef class cudaDeviceProp: maxTexture1DMipmap : int Maximum 1D mipmapped texture size {{endif}} - {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} - maxTexture1DLinear : int - Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() - or cuDeviceGetTexture1DLinearMaxWidth() instead. - {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} maxTexture2D : List[int] Maximum 2D texture dimensions @@ -2019,10 +2064,6 @@ cdef class cudaDeviceProp: unifiedAddressing : int Device shares a unified address space with the host {{endif}} - {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} - memoryClockRate : int - Deprecated, Peak memory clock frequency in kilohertz - {{endif}} {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} memoryBusWidth : int Global memory bus width in bits @@ -2077,11 +2118,6 @@ cdef class cudaDeviceProp: Link between the device and the host supports native atomic operations {{endif}} - {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} - singleToDoublePrecisionPerfRatio : int - Deprecated, Ratio of single precision performance (in floating- - point operations per second) to double precision performance - {{endif}} {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} pageableMemoryAccess : int Device supports coherently accessing pageable memory without @@ -2106,10 +2142,6 @@ cdef class cudaDeviceProp: Device supports launching cooperative kernels via cudaLaunchCooperativeKernel {{endif}} - {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} - cooperativeMultiDeviceLaunch : int - Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. - {{endif}} {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} sharedMemPerBlockOptin : size_t Per device maximum shared memory per block usable by special opt in @@ -2193,6 +2225,38 @@ cdef class cudaDeviceProp: unifiedFunctionPointers : int Indicates device supports unified pointers {{endif}} + {{if 'cudaDeviceProp.deviceNumaConfig' in found_struct}} + deviceNumaConfig : int + NUMA configuration of a device: value is of type + cudaDeviceNumaConfig enum + {{endif}} + {{if 'cudaDeviceProp.deviceNumaId' in found_struct}} + deviceNumaId : int + NUMA node ID of the GPU memory + {{endif}} + {{if 'cudaDeviceProp.mpsEnabled' in found_struct}} + mpsEnabled : int + Indicates if contexts created on this device will be shared via MPS + {{endif}} + {{if 'cudaDeviceProp.hostNumaId' in found_struct}} + hostNumaId : int + NUMA ID of the host node closest to the device or -1 when system + does not support NUMA + {{endif}} + {{if 'cudaDeviceProp.gpuPciDeviceID' in found_struct}} + gpuPciDeviceID : unsigned int + The combined 16-bit PCI device ID and 16-bit PCI vendor ID + {{endif}} + {{if 'cudaDeviceProp.gpuPciSubsystemID' in found_struct}} + gpuPciSubsystemID : unsigned int + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem + vendor ID + {{endif}} + {{if 'cudaDeviceProp.hostNumaMultinodeIpcSupported' in found_struct}} + hostNumaMultinodeIpcSupported : int + 1 if the device supports HostNuma location IPC between nodes in a + multi-node system. + {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} reserved : List[int] Reserved for future use @@ -2272,7 +2336,7 @@ cdef class cudaMemFabricHandle_st: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} -cdef class anon_struct7: +cdef class anon_struct8: """ Attributes ---------- @@ -2303,7 +2367,7 @@ cdef class anon_union2: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} - win32 : anon_struct7 + win32 : anon_struct8 {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} @@ -2318,7 +2382,7 @@ cdef class anon_union2: """ cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} - cdef anon_struct7 _win32 + cdef anon_struct8 _win32 {{endif}} {{endif}} {{if 'cudaExternalMemoryHandleDesc' in found_struct}} @@ -2345,6 +2409,10 @@ cdef class cudaExternalMemoryHandleDesc: flags : unsigned int Flags must either be zero or cudaExternalMemoryDedicated {{endif}} + {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -2377,6 +2445,10 @@ cdef class cudaExternalMemoryBufferDesc: flags : unsigned int Flags reserved for future use. Must be zero. {{endif}} + {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -2416,6 +2488,10 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: numLevels : unsigned int Total number of levels in the mipmap chain {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -2433,7 +2509,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} -cdef class anon_struct8: +cdef class anon_struct9: """ Attributes ---------- @@ -2464,7 +2540,7 @@ cdef class anon_union3: {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} - win32 : anon_struct8 + win32 : anon_struct9 {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} @@ -2479,7 +2555,7 @@ cdef class anon_union3: """ cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} - cdef anon_struct8 _win32 + cdef anon_struct9 _win32 {{endif}} {{endif}} {{if 'cudaExternalSemaphoreHandleDesc' in found_struct}} @@ -2502,6 +2578,10 @@ cdef class cudaExternalSemaphoreHandleDesc: flags : unsigned int Flags reserved for the future. Must be zero. {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -2516,7 +2596,7 @@ cdef class cudaExternalSemaphoreHandleDesc: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} -cdef class anon_struct15: +cdef class anon_struct10: """ Attributes ---------- @@ -2534,7 +2614,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} -cdef class anon_union6: +cdef class anon_union4: """ Attributes ---------- @@ -2556,7 +2636,7 @@ cdef class anon_union6: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} -cdef class anon_struct16: +cdef class anon_struct11: """ Attributes ---------- @@ -2574,20 +2654,20 @@ cdef class anon_struct16: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} -cdef class anon_struct17: +cdef class anon_struct12: """ Attributes ---------- {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} - fence : anon_struct15 + fence : anon_struct10 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union6 + nvSciSync : anon_union4 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} - keyedMutex : anon_struct16 + keyedMutex : anon_struct11 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} @@ -2602,13 +2682,13 @@ cdef class anon_struct17: """ cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} - cdef anon_struct15 _fence + cdef anon_struct10 _fence {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - cdef anon_union6 _nvSciSync + cdef anon_union4 _nvSciSync {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} - cdef anon_struct16 _keyedMutex + cdef anon_struct11 _keyedMutex {{endif}} {{endif}} {{if 'cudaExternalSemaphoreSignalParams' in found_struct}} @@ -2620,7 +2700,7 @@ cdef class cudaExternalSemaphoreSignalParams: Attributes ---------- {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} - params : anon_struct17 + params : anon_struct12 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} @@ -2647,12 +2727,12 @@ cdef class cudaExternalSemaphoreSignalParams: cdef cyruntime.cudaExternalSemaphoreSignalParams _pvt_val cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} - cdef anon_struct17 _params + cdef anon_struct12 _params {{endif}} {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} -cdef class anon_struct18: +cdef class anon_struct13: """ Attributes ---------- @@ -2670,7 +2750,7 @@ cdef class anon_struct18: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} -cdef class anon_union7: +cdef class anon_union5: """ Attributes ---------- @@ -2692,7 +2772,7 @@ cdef class anon_union7: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} -cdef class anon_struct19: +cdef class anon_struct14: """ Attributes ---------- @@ -2714,20 +2794,20 @@ cdef class anon_struct19: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} -cdef class anon_struct20: +cdef class anon_struct15: """ Attributes ---------- {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} - fence : anon_struct18 + fence : anon_struct13 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union7 + nvSciSync : anon_union5 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} - keyedMutex : anon_struct19 + keyedMutex : anon_struct14 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} @@ -2742,13 +2822,13 @@ cdef class anon_struct20: """ cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} - cdef anon_struct18 _fence + cdef anon_struct13 _fence {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - cdef anon_union7 _nvSciSync + cdef anon_union5 _nvSciSync {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} - cdef anon_struct19 _keyedMutex + cdef anon_struct14 _keyedMutex {{endif}} {{endif}} {{if 'cudaExternalSemaphoreWaitParams' in found_struct}} @@ -2760,7 +2840,7 @@ cdef class cudaExternalSemaphoreWaitParams: Attributes ---------- {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} - params : anon_struct20 + params : anon_struct15 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} @@ -2787,7 +2867,7 @@ cdef class cudaExternalSemaphoreWaitParams: cdef cyruntime.cudaExternalSemaphoreWaitParams _pvt_val cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} - cdef anon_struct20 _params + cdef anon_struct15 _params {{endif}} {{endif}} {{if 'cudalibraryHostUniversalFunctionAndDataTable' in found_struct}} @@ -3093,7 +3173,7 @@ cdef class cudaConditionalNodeParams: {{if 'cudaConditionalNodeParams.size' in found_struct}} size : unsigned int Size of graph output array. Allowed values are 1 for - cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeWhile, or any + cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeIf, or any value greater than zero for cudaGraphCondTypeSwitch. {{endif}} {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} @@ -3459,7 +3539,7 @@ cdef class cudaGraphExecUpdateResultInfo_st: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} -cdef class anon_struct21: +cdef class anon_struct16: """ Attributes ---------- @@ -3485,7 +3565,7 @@ cdef class anon_struct21: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} -cdef class anon_union9: +cdef class anon_union7: """ Attributes ---------- @@ -3494,7 +3574,7 @@ cdef class anon_union9: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} - param : anon_struct21 + param : anon_struct16 {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} @@ -3512,7 +3592,7 @@ cdef class anon_union9: cdef dim3 _gridDim {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} - cdef anon_struct21 _param + cdef anon_struct16 _param {{endif}} {{endif}} {{if 'cudaGraphKernelNodeUpdate' in found_struct}} @@ -3534,7 +3614,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - updateData : anon_union9 + updateData : anon_union7 Update data to apply. Which field is used depends on field's value {{endif}} @@ -3549,7 +3629,7 @@ cdef class cudaGraphKernelNodeUpdate: cdef cudaGraphDeviceNode_t _node {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - cdef anon_union9 _updateData + cdef anon_union7 _updateData {{endif}} {{endif}} {{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} @@ -3585,7 +3665,7 @@ cdef class cudaLaunchMemSyncDomainMap_st: {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} -cdef class anon_struct22: +cdef class anon_struct17: """ Attributes ---------- @@ -3611,7 +3691,7 @@ cdef class anon_struct22: {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} -cdef class anon_struct23: +cdef class anon_struct18: """ Attributes ---------- @@ -3640,7 +3720,7 @@ cdef class anon_struct23: {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} -cdef class anon_struct24: +cdef class anon_struct19: """ Attributes ---------- @@ -3666,7 +3746,7 @@ cdef class anon_struct24: {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} -cdef class anon_struct25: +cdef class anon_struct20: """ Attributes ---------- @@ -3691,7 +3771,7 @@ cdef class anon_struct25: {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} -cdef class anon_struct26: +cdef class anon_struct21: """ Attributes ---------- @@ -3742,7 +3822,7 @@ cdef class cudaLaunchAttributeValue: ::cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - clusterDim : anon_struct22 + clusterDim : anon_struct17 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -3763,7 +3843,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeProgrammaticStreamSerialization. {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - programmaticEvent : anon_struct23 + programmaticEvent : anon_struct18 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -3787,7 +3867,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchMemSyncDomain. {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - preferredClusterDim : anon_struct24 + preferredClusterDim : anon_struct19 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type @@ -3802,7 +3882,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - launchCompletionEvent : anon_struct25 + launchCompletionEvent : anon_struct20 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -3810,7 +3890,7 @@ cdef class cudaLaunchAttributeValue: cudaEventRecordExternal. {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - deviceUpdatableKernelNode : anon_struct26 + deviceUpdatableKernelNode : anon_struct21 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -3823,6 +3903,11 @@ cdef class cudaLaunchAttributeValue: Value of launch attribute cudaLaunchAttributePreferredSharedMemoryCarveout. {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + {{endif}} Methods ------- @@ -3835,22 +3920,22 @@ cdef class cudaLaunchAttributeValue: cdef cudaAccessPolicyWindow _accessPolicyWindow {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - cdef anon_struct22 _clusterDim + cdef anon_struct17 _clusterDim {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - cdef anon_struct23 _programmaticEvent + cdef anon_struct18 _programmaticEvent {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} cdef cudaLaunchMemSyncDomainMap _memSyncDomainMap {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - cdef anon_struct24 _preferredClusterDim + cdef anon_struct19 _preferredClusterDim {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - cdef anon_struct25 _launchCompletionEvent + cdef anon_struct20 _launchCompletionEvent {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - cdef anon_struct26 _deviceUpdatableKernelNode + cdef anon_struct21 _deviceUpdatableKernelNode {{endif}} {{endif}} {{if 'cudaLaunchAttribute_st' in found_struct}} @@ -3883,7 +3968,7 @@ cdef class cudaLaunchAttribute_st: {{endif}} {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} -cdef class anon_struct27: +cdef class anon_struct22: """ Attributes ---------- @@ -3901,12 +3986,12 @@ cdef class anon_struct27: {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} -cdef class anon_union10: +cdef class anon_union8: """ Attributes ---------- {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} - overBudget : anon_struct27 + overBudget : anon_struct22 {{endif}} @@ -3917,7 +4002,7 @@ cdef class anon_union10: """ cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} - cdef anon_struct27 _overBudget + cdef anon_struct22 _overBudget {{endif}} {{endif}} {{if 'cudaAsyncNotificationInfo' in found_struct}} @@ -3933,7 +4018,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union8 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -3946,7 +4031,7 @@ cdef class cudaAsyncNotificationInfo: cdef cyruntime.cudaAsyncNotificationInfo* _val_ptr cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - cdef anon_union10 _info + cdef anon_union8 _info {{endif}} {{endif}} {{if 'cudaTextureDesc' in found_struct}} @@ -4069,7 +4154,7 @@ cdef class cudaEglPlaneDesc_st: {{endif}} {{if True}} -cdef class anon_union11: +cdef class anon_union9: """ Attributes ---------- @@ -4105,7 +4190,7 @@ cdef class cudaEglFrame_st: Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union9 {{endif}} {{if True}} @@ -4133,7 +4218,7 @@ cdef class cudaEglFrame_st: cdef cyruntime.cudaEglFrame_st* _val_ptr cdef cyruntime.cudaEglFrame_st* _pvt_ptr {{if True}} - cdef anon_union11 _frame + cdef anon_union9 _frame {{endif}} {{endif}} {{if 'CUuuid' in found_types}} @@ -4411,7 +4496,7 @@ cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union8 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -4451,7 +4536,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): ::cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - clusterDim : anon_struct22 + clusterDim : anon_struct17 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -4472,7 +4557,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeProgrammaticStreamSerialization. {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - programmaticEvent : anon_struct23 + programmaticEvent : anon_struct18 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -4496,7 +4581,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaLaunchMemSyncDomain. {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - preferredClusterDim : anon_struct24 + preferredClusterDim : anon_struct19 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type @@ -4511,7 +4596,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - launchCompletionEvent : anon_struct25 + launchCompletionEvent : anon_struct20 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -4519,7 +4604,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaEventRecordExternal. {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - deviceUpdatableKernelNode : anon_struct26 + deviceUpdatableKernelNode : anon_struct21 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -4532,6 +4617,11 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): Value of launch attribute cudaLaunchAttributePreferredSharedMemoryCarveout. {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + {{endif}} Methods ------- @@ -4568,7 +4658,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): ::cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - clusterDim : anon_struct22 + clusterDim : anon_struct17 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -4589,7 +4679,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeProgrammaticStreamSerialization. {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - programmaticEvent : anon_struct23 + programmaticEvent : anon_struct18 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -4613,7 +4703,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaLaunchMemSyncDomain. {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - preferredClusterDim : anon_struct24 + preferredClusterDim : anon_struct19 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type @@ -4628,7 +4718,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - launchCompletionEvent : anon_struct25 + launchCompletionEvent : anon_struct20 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -4636,7 +4726,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaEventRecordExternal. {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - deviceUpdatableKernelNode : anon_struct26 + deviceUpdatableKernelNode : anon_struct21 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -4649,6 +4739,11 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): Value of launch attribute cudaLaunchAttributePreferredSharedMemoryCarveout. {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + {{endif}} Methods ------- @@ -4718,7 +4813,7 @@ cdef class cudaEglFrame(cudaEglFrame_st): Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union9 {{endif}} {{if True}} @@ -4906,6 +5001,21 @@ cdef class cudaGraphConditionalHandle: cdef cyruntime.cudaGraphConditionalHandle* _pvt_ptr {{endif}} +{{if 'cudaLogIterator' in found_types}} + +cdef class cudaLogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogIterator _pvt_val + cdef cyruntime.cudaLogIterator* _pvt_ptr +{{endif}} + {{if 'cudaSurfaceObject_t' in found_types}} cdef class cudaSurfaceObject_t: diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 1f1fc7272..43ce11ee8 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from typing import List, Tuple, Any, Optional from enum import IntEnum import cython @@ -210,18 +210,6 @@ cudaInvalidDeviceId = cyruntime.cudaInvalidDeviceId #: call cudaInitDeviceFlagsAreValid = cyruntime.cudaInitDeviceFlagsAreValid -#: If set, each kernel launched as part of -#: :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior -#: work in the stream corresponding to that GPU to complete before the -#: kernel begins execution. -cudaCooperativeLaunchMultiDeviceNoPreSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPreSync - -#: If set, any subsequent work pushed in a stream that participated in a -#: call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only -#: wait for the kernel launched on the GPU corresponding to that stream to -#: complete before it begins execution. -cudaCooperativeLaunchMultiDeviceNoPostSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPostSync - #: Indicates that the layered sparse CUDA array or CUDA mipmapped array has #: a single mip tail region for all layers cudaArraySparsePropertiesSingleMipTail = cyruntime.cudaArraySparsePropertiesSingleMipTail @@ -307,6 +295,8 @@ cudaKernelNodeAttributePreferredSharedMemoryCarveout = cyruntime.cudaKernelNodeA cudaKernelNodeAttributeDeviceUpdatableKernelNode = cyruntime.cudaKernelNodeAttributeDeviceUpdatableKernelNode +cudaKernelNodeAttributeNvlinkUtilCentricScheduling = cyruntime.cudaKernelNodeAttributeNvlinkUtilCentricScheduling + cudaSurfaceType1D = cyruntime.cudaSurfaceType1D cudaSurfaceType2D = cyruntime.cudaSurfaceType2D @@ -853,8 +843,8 @@ class cudaError_t(IntEnum): {{if 'cudaErrorLaunchTimeout' in found_values}} #: This indicates that the device kernel took too long to execute. This - #: can only occur if timeouts are enabled - see the device property - #: :py:obj:`~.kernelExecTimeoutEnabled` for more information. This + #: can only occur if timeouts are enabled - see the device attribute + #: :py:obj:`~.cudaDevAttrKernelExecTimeout` for more information. This #: leaves the process in an inconsistent state and any further CUDA #: work will return the same error. To continue using CUDA, the process #: must be terminated and relaunched. @@ -976,9 +966,8 @@ class cudaError_t(IntEnum): #: This error indicates that the number of blocks launched per grid for #: a kernel that was launched via either - #: :py:obj:`~.cudaLaunchCooperativeKernel` or - #: :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` exceeds the - #: maximum number of blocks as allowed by + #: :py:obj:`~.cudaLaunchCooperativeKernel` exceeds the maximum number + #: of blocks as allowed by #: :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` or #: :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` #: times the number of multiprocessors as specified by the device @@ -1443,6 +1432,29 @@ class cudaLaunchAttributeID(IntEnum): #: only a hint, and the driver can choose a different configuration if #: required for the launch. cudaLaunchAttributePreferredSharedMemoryCarveout = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout{{endif}} + {{if 'cudaLaunchAttributeNvlinkUtilCentricScheduling' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.cudaLaunchAttributeValue.nvlinkUtilCentricScheduling` are + #: 0 (disabled) and 1 (enabled). + cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} _dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} @@ -1459,6 +1471,19 @@ class cudaAsyncNotificationType(IntEnum): _dict_cudaAsyncNotificationType = dict(((int(v), v) for k, v in cudaAsyncNotificationType.__members__.items())) {{endif}} +{{if 'CUDAlogLevel_enum' in found_types}} + +class cudaLogLevel(IntEnum): + """ + + """ + {{if 'cudaLogLevelError' in found_values}} + cudaLogLevelError = cyruntime.CUDAlogLevel_enum.cudaLogLevelError{{endif}} + {{if 'cudaLogLevelWarning' in found_values}} + cudaLogLevelWarning = cyruntime.CUDAlogLevel_enum.cudaLogLevelWarning{{endif}} + +_dict_cudaLogLevel = dict(((int(v), v) for k, v in cudaLogLevel.__members__.items())) +{{endif}} {{if 'cudaDataType_t' in found_types}} class cudaDataType(IntEnum): @@ -1536,6 +1561,19 @@ class cudaDataType(IntEnum): _dict_cudaDataType = dict(((int(v), v) for k, v in cudaDataType.__members__.items())) {{endif}} +{{if 'cudaEmulationStrategy_t' in found_types}} + +class cudaEmulationStrategy(IntEnum): + """""" + {{if 'CUDA_EMULATION_STRATEGY_DEFAULT' in found_values}} + CUDA_EMULATION_STRATEGY_DEFAULT = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_DEFAULT{{endif}} + {{if 'CUDA_EMULATION_STRATEGY_PERFORMANT' in found_values}} + CUDA_EMULATION_STRATEGY_PERFORMANT = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_PERFORMANT{{endif}} + {{if 'CUDA_EMULATION_STRATEGY_EAGER' in found_values}} + CUDA_EMULATION_STRATEGY_EAGER = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_EAGER{{endif}} + +_dict_cudaEmulationStrategy = dict(((int(v), v) for k, v in cudaEmulationStrategy.__members__.items())) +{{endif}} {{if 'libraryPropertyType_t' in found_types}} class libraryPropertyType(IntEnum): @@ -3471,10 +3509,8 @@ class cudaDeviceAttr(IntEnum): #: Device supports launching cooperative kernels via #: :py:obj:`~.cudaLaunchCooperativeKernel` cudaDevAttrCooperativeLaunch = cyruntime.cudaDeviceAttr.cudaDevAttrCooperativeLaunch{{endif}} - {{if 'cudaDevAttrCooperativeMultiDeviceLaunch' in found_values}} - - #: Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. - cudaDevAttrCooperativeMultiDeviceLaunch = cyruntime.cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch{{endif}} + {{if 'cudaDevAttrReserved96' in found_values}} + cudaDevAttrReserved96 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved96{{endif}} {{if 'cudaDevAttrMaxSharedMemoryPerBlockOptin' in found_values}} #: The maximum optin shared memory per block. This value may vary by @@ -3528,11 +3564,6 @@ class cudaDeviceAttr(IntEnum): #: External timeline semaphore interop is supported on the device cudaDevAttrTimelineSemaphoreInteropSupported = cyruntime.cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported{{endif}} - {{if 'cudaDevAttrMaxTimelineSemaphoreInteropSupported' in found_values}} - - #: Deprecated, External timeline semaphore interop is supported on the - #: device - cudaDevAttrMaxTimelineSemaphoreInteropSupported = cyruntime.cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported{{endif}} {{if 'cudaDevAttrMemoryPoolsSupported' in found_values}} #: Device supports using the :py:obj:`~.cudaMallocAsync` and @@ -3639,6 +3670,18 @@ class cudaDeviceAttr(IntEnum): #: Device supports HostNuma location IPC between nodes in a multi-node #: system. cudaDevAttrHostNumaMultinodeIpcSupported = cyruntime.cudaDeviceAttr.cudaDevAttrHostNumaMultinodeIpcSupported{{endif}} + {{if 'cudaDevAttrHostMemoryPoolsSupported' in found_values}} + + #: Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` + #: and :py:obj:`~.cuMemPool` family of APIs + cudaDevAttrHostMemoryPoolsSupported = cyruntime.cudaDeviceAttr.cudaDevAttrHostMemoryPoolsSupported{{endif}} + {{if 'cudaDevAttrReserved145' in found_values}} + cudaDevAttrReserved145 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved145{{endif}} + {{if 'cudaDevAttrOnlyPartialHostNativeAtomicSupported' in found_values}} + + #: Link between the device and the host supports only some native + #: atomic operations + cudaDevAttrOnlyPartialHostNativeAtomicSupported = cyruntime.cudaDeviceAttr.cudaDevAttrOnlyPartialHostNativeAtomicSupported{{endif}} {{if 'cudaDevAttrMax' in found_values}} cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax{{endif}} @@ -3710,6 +3753,11 @@ class cudaMemLocationType(IntEnum): """ {{if 'cudaMemLocationTypeInvalid' in found_values}} cudaMemLocationTypeInvalid = cyruntime.cudaMemLocationType.cudaMemLocationTypeInvalid{{endif}} + {{if 'cudaMemLocationTypeNone' in found_values}} + + #: Location is unspecified. This is used when creating a managed memory + #: pool to indicate no preferred location for the pool + cudaMemLocationTypeNone = cyruntime.cudaMemLocationType.cudaMemLocationTypeNone{{endif}} {{if 'cudaMemLocationTypeDevice' in found_values}} #: Location is a device location, thus id is a device ordinal @@ -3764,6 +3812,10 @@ class cudaMemAllocationType(IntEnum): #: This allocation type is 'pinned', i.e. cannot migrate from its #: current location while the application is actively using it cudaMemAllocationTypePinned = cyruntime.cudaMemAllocationType.cudaMemAllocationTypePinned{{endif}} + {{if 'cudaMemAllocationTypeManaged' in found_values}} + + #: This allocation type is managed memory + cudaMemAllocationTypeManaged = cyruntime.cudaMemAllocationType.cudaMemAllocationTypeManaged{{endif}} {{if 'cudaMemAllocationTypeMax' in found_values}} cudaMemAllocationTypeMax = cyruntime.cudaMemAllocationType.cudaMemAllocationTypeMax{{endif}} @@ -3931,9 +3983,71 @@ class cudaDeviceP2PAttr(IntEnum): #: Accessing CUDA arrays over the link supported cudaDevP2PAttrCudaArrayAccessSupported = cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported{{endif}} + {{if 'cudaDevP2PAttrOnlyPartialNativeAtomicSupported' in found_values}} + + #: Only some CUDA-valid atomic operations over the link are supported. + cudaDevP2PAttrOnlyPartialNativeAtomicSupported = cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrOnlyPartialNativeAtomicSupported{{endif}} _dict_cudaDeviceP2PAttr = dict(((int(v), v) for k, v in cudaDeviceP2PAttr.__members__.items())) {{endif}} +{{if 'cudaAtomicOperation' in found_types}} + +class cudaAtomicOperation(IntEnum): + """ + CUDA-valid Atomic Operations + """ + {{if 'cudaAtomicOperationIntegerAdd' in found_values}} + cudaAtomicOperationIntegerAdd = cyruntime.cudaAtomicOperation.cudaAtomicOperationIntegerAdd{{endif}} + {{if 'cudaAtomicOperationIntegerMin' in found_values}} + cudaAtomicOperationIntegerMin = cyruntime.cudaAtomicOperation.cudaAtomicOperationIntegerMin{{endif}} + {{if 'cudaAtomicOperationIntegerMax' in found_values}} + cudaAtomicOperationIntegerMax = cyruntime.cudaAtomicOperation.cudaAtomicOperationIntegerMax{{endif}} + {{if 'cudaAtomicOperationIntegerIncrement' in found_values}} + cudaAtomicOperationIntegerIncrement = cyruntime.cudaAtomicOperation.cudaAtomicOperationIntegerIncrement{{endif}} + {{if 'cudaAtomicOperationIntegerDecrement' in found_values}} + cudaAtomicOperationIntegerDecrement = cyruntime.cudaAtomicOperation.cudaAtomicOperationIntegerDecrement{{endif}} + {{if 'cudaAtomicOperationAnd' in found_values}} + cudaAtomicOperationAnd = cyruntime.cudaAtomicOperation.cudaAtomicOperationAnd{{endif}} + {{if 'cudaAtomicOperationOr' in found_values}} + cudaAtomicOperationOr = cyruntime.cudaAtomicOperation.cudaAtomicOperationOr{{endif}} + {{if 'cudaAtomicOperationXOR' in found_values}} + cudaAtomicOperationXOR = cyruntime.cudaAtomicOperation.cudaAtomicOperationXOR{{endif}} + {{if 'cudaAtomicOperationExchange' in found_values}} + cudaAtomicOperationExchange = cyruntime.cudaAtomicOperation.cudaAtomicOperationExchange{{endif}} + {{if 'cudaAtomicOperationCAS' in found_values}} + cudaAtomicOperationCAS = cyruntime.cudaAtomicOperation.cudaAtomicOperationCAS{{endif}} + {{if 'cudaAtomicOperationFloatAdd' in found_values}} + cudaAtomicOperationFloatAdd = cyruntime.cudaAtomicOperation.cudaAtomicOperationFloatAdd{{endif}} + {{if 'cudaAtomicOperationFloatMin' in found_values}} + cudaAtomicOperationFloatMin = cyruntime.cudaAtomicOperation.cudaAtomicOperationFloatMin{{endif}} + {{if 'cudaAtomicOperationFloatMax' in found_values}} + cudaAtomicOperationFloatMax = cyruntime.cudaAtomicOperation.cudaAtomicOperationFloatMax{{endif}} + +_dict_cudaAtomicOperation = dict(((int(v), v) for k, v in cudaAtomicOperation.__members__.items())) +{{endif}} +{{if 'cudaAtomicOperationCapability' in found_types}} + +class cudaAtomicOperationCapability(IntEnum): + """ + CUDA-valid Atomic Operation capabilities + """ + {{if 'cudaAtomicCapabilitySigned' in found_values}} + cudaAtomicCapabilitySigned = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilitySigned{{endif}} + {{if 'cudaAtomicCapabilityUnsigned' in found_values}} + cudaAtomicCapabilityUnsigned = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityUnsigned{{endif}} + {{if 'cudaAtomicCapabilityReduction' in found_values}} + cudaAtomicCapabilityReduction = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityReduction{{endif}} + {{if 'cudaAtomicCapabilityScalar32' in found_values}} + cudaAtomicCapabilityScalar32 = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar32{{endif}} + {{if 'cudaAtomicCapabilityScalar64' in found_values}} + cudaAtomicCapabilityScalar64 = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar64{{endif}} + {{if 'cudaAtomicCapabilityScalar128' in found_values}} + cudaAtomicCapabilityScalar128 = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar128{{endif}} + {{if 'cudaAtomicCapabilityVector32x4' in found_values}} + cudaAtomicCapabilityVector32x4 = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityVector32x4{{endif}} + +_dict_cudaAtomicOperationCapability = dict(((int(v), v) for k, v in cudaAtomicOperationCapability.__members__.items())) +{{endif}} {{if 'cudaExternalMemoryHandleType' in found_types}} class cudaExternalMemoryHandleType(IntEnum): @@ -4253,10 +4367,10 @@ class cudaCGScope(IntEnum): #: Scope represented by a grid_group cudaCGScopeGrid = cyruntime.cudaCGScope.cudaCGScopeGrid{{endif}} - {{if 'cudaCGScopeMultiGrid' in found_values}} + {{if 'cudaCGScopeReserved' in found_values}} - #: Scope represented by a multi_grid_group - cudaCGScopeMultiGrid = cyruntime.cudaCGScope.cudaCGScopeMultiGrid{{endif}} + #: Reserved + cudaCGScopeReserved = cyruntime.cudaCGScope.cudaCGScopeReserved{{endif}} _dict_cudaCGScope = dict(((int(v), v) for k, v in cudaCGScope.__members__.items())) {{endif}} @@ -4983,6 +5097,29 @@ class cudaStreamAttrID(IntEnum): #: only a hint, and the driver can choose a different configuration if #: required for the launch. cudaLaunchAttributePreferredSharedMemoryCarveout = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout{{endif}} + {{if 'cudaLaunchAttributeNvlinkUtilCentricScheduling' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.cudaLaunchAttributeValue.nvlinkUtilCentricScheduling` are + #: 0 (disabled) and 1 (enabled). + cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} _dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} @@ -5174,6 +5311,29 @@ class cudaKernelNodeAttrID(IntEnum): #: only a hint, and the driver can choose a different configuration if #: required for the launch. cudaLaunchAttributePreferredSharedMemoryCarveout = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout{{endif}} + {{if 'cudaLaunchAttributeNvlinkUtilCentricScheduling' in found_values}} + + #: Valid for streams, graph nodes, launches. This attribute is a hint + #: to the CUDA runtime that the launch should attempt to make the + #: kernel maximize its NVLINK utilization. + #: + #: When possible to honor this hint, CUDA will assume each block in + #: the grid launch will carry out an even amount of NVLINK traffic, and + #: make a best-effort attempt to adjust the kernel launch based on that + #: assumption. + #: This attribute is a hint only. CUDA makes no functional or + #: performance guarantee. Its applicability can be affected by many + #: different factors, including driver version (i.e. CUDA doesn't + #: guarantee the performance characteristics will be maintained between + #: driver versions or a driver update could alter or regress previously + #: observed perf characteristics.) It also doesn't guarantee a + #: successful result, i.e. applying the attribute may not improve the + #: performance of either the targeted kernel or the encapsulating + #: application. + #: Valid values for + #: :py:obj:`~.cudaLaunchAttributeValue.nvlinkUtilCentricScheduling` are + #: 0 (disabled) and 1 (enabled). + cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} _dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} @@ -5584,6 +5744,41 @@ cdef class cudaAsyncCallbackHandle_t: return self._pvt_ptr {{endif}} +{{if 'cudaLogsCallbackHandle' in found_types}} + +cdef class cudaLogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaLogsCallbackHandle): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + {{if True}} cdef class EGLImageKHR: @@ -5776,6 +5971,35 @@ cdef class cudaStreamCallback_t: return self._pvt_ptr {{endif}} +{{if 'cudaLogsCallback_t' in found_types}} + +cdef class cudaLogsCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + {{if 'dim3' in found_struct}} cdef class dim3: @@ -8000,6 +8224,52 @@ cdef class anon_struct4: self._pvt_ptr[0].res.pitch2D.pitchInBytes = pitchInBytes {{endif}} {{endif}} +{{if 'cudaResourceDesc.res.reserved' in found_struct}} + +cdef class anon_struct5: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} + reserved : List[int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.reserved + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].res.reserved.reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].res.reserved.reserved = reserved + {{endif}} +{{endif}} {{if 'cudaResourceDesc.res' in found_struct}} cdef class anon_union0: @@ -8021,6 +8291,10 @@ cdef class anon_union0: {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} pitch2D : anon_struct4 + {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + reserved : anon_struct5 + {{endif}} Methods @@ -8045,6 +8319,9 @@ cdef class anon_union0: {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} self._pitch2D = anon_struct4(_ptr=self._pvt_ptr) {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + self._reserved = anon_struct5(_ptr=self._pvt_ptr) + {{endif}} def __dealloc__(self): pass def getPtr(self): @@ -8076,6 +8353,12 @@ cdef class anon_union0: except ValueError: str_list += ['pitch2D : '] {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + try: + str_list += ['reserved :\n' + '\n'.join([' ' + line for line in str(self.reserved).splitlines()])] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -8111,6 +8394,14 @@ cdef class anon_union0: def pitch2D(self, pitch2D not None : anon_struct4): string.memcpy(&self._pvt_ptr[0].res.pitch2D, pitch2D.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D)) {{endif}} + {{if 'cudaResourceDesc.res.reserved' in found_struct}} + @property + def reserved(self): + return self._reserved + @reserved.setter + def reserved(self, reserved not None : anon_struct5): + string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) + {{endif}} {{endif}} {{if 'cudaResourceDesc' in found_struct}} @@ -8128,6 +8419,10 @@ cdef class cudaResourceDesc: res : anon_union0 {{endif}} + {{if 'cudaResourceDesc.flags' in found_struct}} + flags : unsigned int + Flags (must be zero) + {{endif}} Methods ------- @@ -8165,6 +8460,12 @@ cdef class cudaResourceDesc: except ValueError: str_list += ['res : '] {{endif}} + {{if 'cudaResourceDesc.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -8186,6 +8487,14 @@ cdef class cudaResourceDesc: def res(self, res not None : anon_union0): string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) {{endif}} + {{if 'cudaResourceDesc.flags' in found_struct}} + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + {{endif}} {{endif}} {{if 'cudaResourceViewDesc' in found_struct}} @@ -8227,6 +8536,10 @@ cdef class cudaResourceViewDesc: lastLayer : unsigned int Last layer index {{endif}} + {{if 'cudaResourceViewDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -8295,6 +8608,12 @@ cdef class cudaResourceViewDesc: except ValueError: str_list += ['lastLayer : '] {{endif}} + {{if 'cudaResourceViewDesc.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -8364,6 +8683,14 @@ cdef class cudaResourceViewDesc: def lastLayer(self, unsigned int lastLayer): self._pvt_ptr[0].lastLayer = lastLayer {{endif}} + {{if 'cudaResourceViewDesc.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaPointerAttributes' in found_struct}} @@ -8400,6 +8727,10 @@ cdef class cudaPointerAttributes: unregistered memory is allocated so this field may contain invalid pointer if an invalid pointer has been passed to CUDA. {{endif}} + {{if 'cudaPointerAttributes.reserved' in found_struct}} + reserved : List[long] + Must be zero + {{endif}} Methods ------- @@ -8444,6 +8775,12 @@ cdef class cudaPointerAttributes: except ValueError: str_list += ['hostPointer : '] {{endif}} + {{if 'cudaPointerAttributes.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -8483,6 +8820,14 @@ cdef class cudaPointerAttributes: _chostPointer = utils.HelperInputVoidPtr(hostPointer) self._pvt_ptr[0].hostPointer = _chostPointer.cptr {{endif}} + {{if 'cudaPointerAttributes.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaFuncAttributes' in found_struct}} @@ -9787,7 +10132,7 @@ cdef class cudaOffset3D: {{endif}} {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} -cdef class anon_struct5: +cdef class anon_struct6: """ Attributes ---------- @@ -9891,7 +10236,7 @@ cdef class anon_struct5: {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} -cdef class anon_struct6: +cdef class anon_struct7: """ Attributes ---------- @@ -9975,11 +10320,11 @@ cdef class anon_union1: Attributes ---------- {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} - ptr : anon_struct5 + ptr : anon_struct6 {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} - array : anon_struct6 + array : anon_struct7 {{endif}} @@ -9994,10 +10339,10 @@ cdef class anon_union1: def __init__(self, void_ptr _ptr): pass {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} - self._ptr = anon_struct5(_ptr=self._pvt_ptr) + self._ptr = anon_struct6(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} - self._array = anon_struct6(_ptr=self._pvt_ptr) + self._array = anon_struct7(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -10026,16 +10371,16 @@ cdef class anon_union1: def ptr(self): return self._ptr @ptr.setter - def ptr(self, ptr not None : anon_struct5): - string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) + def ptr(self, ptr not None : anon_struct6): + string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} @property def array(self): return self._array @array.setter - def array(self, array not None : anon_struct6): - string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) + def array(self, array not None : anon_struct7): + string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) {{endif}} {{endif}} {{if 'cudaMemcpy3DOperand' in found_struct}} @@ -10348,10 +10693,6 @@ cdef class cudaDeviceProp: maxGridSize : List[int] Maximum size of each dimension of a grid {{endif}} - {{if 'cudaDeviceProp.clockRate' in found_struct}} - clockRate : int - Deprecated, Clock frequency in kilohertz - {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} totalConstMem : size_t Constant memory available on device in bytes @@ -10373,19 +10714,10 @@ cdef class cudaDeviceProp: Pitch alignment requirement for texture references bound to pitched memory {{endif}} - {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} - deviceOverlap : int - Device can concurrently copy memory and execute a kernel. - Deprecated. Use instead asyncEngineCount. - {{endif}} {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} multiProcessorCount : int Number of multiprocessors on device {{endif}} - {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} - kernelExecTimeoutEnabled : int - Deprecated, Specified whether there is a run time limit on kernels - {{endif}} {{if 'cudaDeviceProp.integrated' in found_struct}} integrated : int Device is integrated as opposed to discrete @@ -10395,10 +10727,6 @@ cdef class cudaDeviceProp: Device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer {{endif}} - {{if 'cudaDeviceProp.computeMode' in found_struct}} - computeMode : int - Deprecated, Compute mode (See cudaComputeMode) - {{endif}} {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} maxTexture1D : int Maximum 1D texture size @@ -10407,11 +10735,6 @@ cdef class cudaDeviceProp: maxTexture1DMipmap : int Maximum 1D mipmapped texture size {{endif}} - {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} - maxTexture1DLinear : int - Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() - or cuDeviceGetTexture1DLinearMaxWidth() instead. - {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} maxTexture2D : List[int] Maximum 2D texture dimensions @@ -10518,10 +10841,6 @@ cdef class cudaDeviceProp: unifiedAddressing : int Device shares a unified address space with the host {{endif}} - {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} - memoryClockRate : int - Deprecated, Peak memory clock frequency in kilohertz - {{endif}} {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} memoryBusWidth : int Global memory bus width in bits @@ -10576,11 +10895,6 @@ cdef class cudaDeviceProp: Link between the device and the host supports native atomic operations {{endif}} - {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} - singleToDoublePrecisionPerfRatio : int - Deprecated, Ratio of single precision performance (in floating- - point operations per second) to double precision performance - {{endif}} {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} pageableMemoryAccess : int Device supports coherently accessing pageable memory without @@ -10605,10 +10919,6 @@ cdef class cudaDeviceProp: Device supports launching cooperative kernels via cudaLaunchCooperativeKernel {{endif}} - {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} - cooperativeMultiDeviceLaunch : int - Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. - {{endif}} {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} sharedMemPerBlockOptin : size_t Per device maximum shared memory per block usable by special opt in @@ -10692,6 +11002,38 @@ cdef class cudaDeviceProp: unifiedFunctionPointers : int Indicates device supports unified pointers {{endif}} + {{if 'cudaDeviceProp.deviceNumaConfig' in found_struct}} + deviceNumaConfig : int + NUMA configuration of a device: value is of type + cudaDeviceNumaConfig enum + {{endif}} + {{if 'cudaDeviceProp.deviceNumaId' in found_struct}} + deviceNumaId : int + NUMA node ID of the GPU memory + {{endif}} + {{if 'cudaDeviceProp.mpsEnabled' in found_struct}} + mpsEnabled : int + Indicates if contexts created on this device will be shared via MPS + {{endif}} + {{if 'cudaDeviceProp.hostNumaId' in found_struct}} + hostNumaId : int + NUMA ID of the host node closest to the device or -1 when system + does not support NUMA + {{endif}} + {{if 'cudaDeviceProp.gpuPciDeviceID' in found_struct}} + gpuPciDeviceID : unsigned int + The combined 16-bit PCI device ID and 16-bit PCI vendor ID + {{endif}} + {{if 'cudaDeviceProp.gpuPciSubsystemID' in found_struct}} + gpuPciSubsystemID : unsigned int + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem + vendor ID + {{endif}} + {{if 'cudaDeviceProp.hostNumaMultinodeIpcSupported' in found_struct}} + hostNumaMultinodeIpcSupported : int + 1 if the device supports HostNuma location IPC between nodes in a + multi-node system. + {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} reserved : List[int] Reserved for future use @@ -10791,12 +11133,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['maxGridSize : '] {{endif}} - {{if 'cudaDeviceProp.clockRate' in found_struct}} - try: - str_list += ['clockRate : ' + str(self.clockRate)] - except ValueError: - str_list += ['clockRate : '] - {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} try: str_list += ['totalConstMem : ' + str(self.totalConstMem)] @@ -10827,24 +11163,12 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['texturePitchAlignment : '] {{endif}} - {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} - try: - str_list += ['deviceOverlap : ' + str(self.deviceOverlap)] - except ValueError: - str_list += ['deviceOverlap : '] - {{endif}} {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} try: str_list += ['multiProcessorCount : ' + str(self.multiProcessorCount)] except ValueError: str_list += ['multiProcessorCount : '] {{endif}} - {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} - try: - str_list += ['kernelExecTimeoutEnabled : ' + str(self.kernelExecTimeoutEnabled)] - except ValueError: - str_list += ['kernelExecTimeoutEnabled : '] - {{endif}} {{if 'cudaDeviceProp.integrated' in found_struct}} try: str_list += ['integrated : ' + str(self.integrated)] @@ -10857,12 +11181,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['canMapHostMemory : '] {{endif}} - {{if 'cudaDeviceProp.computeMode' in found_struct}} - try: - str_list += ['computeMode : ' + str(self.computeMode)] - except ValueError: - str_list += ['computeMode : '] - {{endif}} {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} try: str_list += ['maxTexture1D : ' + str(self.maxTexture1D)] @@ -10875,12 +11193,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['maxTexture1DMipmap : '] {{endif}} - {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} - try: - str_list += ['maxTexture1DLinear : ' + str(self.maxTexture1DLinear)] - except ValueError: - str_list += ['maxTexture1DLinear : '] - {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} try: str_list += ['maxTexture2D : ' + str(self.maxTexture2D)] @@ -11037,12 +11349,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['unifiedAddressing : '] {{endif}} - {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} - try: - str_list += ['memoryClockRate : ' + str(self.memoryClockRate)] - except ValueError: - str_list += ['memoryClockRate : '] - {{endif}} {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} try: str_list += ['memoryBusWidth : ' + str(self.memoryBusWidth)] @@ -11121,12 +11427,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['hostNativeAtomicSupported : '] {{endif}} - {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} - try: - str_list += ['singleToDoublePrecisionPerfRatio : ' + str(self.singleToDoublePrecisionPerfRatio)] - except ValueError: - str_list += ['singleToDoublePrecisionPerfRatio : '] - {{endif}} {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} try: str_list += ['pageableMemoryAccess : ' + str(self.pageableMemoryAccess)] @@ -11157,12 +11457,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['cooperativeLaunch : '] {{endif}} - {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} - try: - str_list += ['cooperativeMultiDeviceLaunch : ' + str(self.cooperativeMultiDeviceLaunch)] - except ValueError: - str_list += ['cooperativeMultiDeviceLaunch : '] - {{endif}} {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} try: str_list += ['sharedMemPerBlockOptin : ' + str(self.sharedMemPerBlockOptin)] @@ -11277,6 +11571,48 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['unifiedFunctionPointers : '] {{endif}} + {{if 'cudaDeviceProp.deviceNumaConfig' in found_struct}} + try: + str_list += ['deviceNumaConfig : ' + str(self.deviceNumaConfig)] + except ValueError: + str_list += ['deviceNumaConfig : '] + {{endif}} + {{if 'cudaDeviceProp.deviceNumaId' in found_struct}} + try: + str_list += ['deviceNumaId : ' + str(self.deviceNumaId)] + except ValueError: + str_list += ['deviceNumaId : '] + {{endif}} + {{if 'cudaDeviceProp.mpsEnabled' in found_struct}} + try: + str_list += ['mpsEnabled : ' + str(self.mpsEnabled)] + except ValueError: + str_list += ['mpsEnabled : '] + {{endif}} + {{if 'cudaDeviceProp.hostNumaId' in found_struct}} + try: + str_list += ['hostNumaId : ' + str(self.hostNumaId)] + except ValueError: + str_list += ['hostNumaId : '] + {{endif}} + {{if 'cudaDeviceProp.gpuPciDeviceID' in found_struct}} + try: + str_list += ['gpuPciDeviceID : ' + str(self.gpuPciDeviceID)] + except ValueError: + str_list += ['gpuPciDeviceID : '] + {{endif}} + {{if 'cudaDeviceProp.gpuPciSubsystemID' in found_struct}} + try: + str_list += ['gpuPciSubsystemID : ' + str(self.gpuPciSubsystemID)] + except ValueError: + str_list += ['gpuPciSubsystemID : '] + {{endif}} + {{if 'cudaDeviceProp.hostNumaMultinodeIpcSupported' in found_struct}} + try: + str_list += ['hostNumaMultinodeIpcSupported : ' + str(self.hostNumaMultinodeIpcSupported)] + except ValueError: + str_list += ['hostNumaMultinodeIpcSupported : '] + {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} try: str_list += ['reserved : ' + str(self.reserved)] @@ -11394,14 +11730,6 @@ cdef class cudaDeviceProp: def maxGridSize(self, maxGridSize): self._pvt_ptr[0].maxGridSize = maxGridSize {{endif}} - {{if 'cudaDeviceProp.clockRate' in found_struct}} - @property - def clockRate(self): - return self._pvt_ptr[0].clockRate - @clockRate.setter - def clockRate(self, int clockRate): - self._pvt_ptr[0].clockRate = clockRate - {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} @property def totalConstMem(self): @@ -11442,14 +11770,6 @@ cdef class cudaDeviceProp: def texturePitchAlignment(self, size_t texturePitchAlignment): self._pvt_ptr[0].texturePitchAlignment = texturePitchAlignment {{endif}} - {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} - @property - def deviceOverlap(self): - return self._pvt_ptr[0].deviceOverlap - @deviceOverlap.setter - def deviceOverlap(self, int deviceOverlap): - self._pvt_ptr[0].deviceOverlap = deviceOverlap - {{endif}} {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} @property def multiProcessorCount(self): @@ -11458,14 +11778,6 @@ cdef class cudaDeviceProp: def multiProcessorCount(self, int multiProcessorCount): self._pvt_ptr[0].multiProcessorCount = multiProcessorCount {{endif}} - {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} - @property - def kernelExecTimeoutEnabled(self): - return self._pvt_ptr[0].kernelExecTimeoutEnabled - @kernelExecTimeoutEnabled.setter - def kernelExecTimeoutEnabled(self, int kernelExecTimeoutEnabled): - self._pvt_ptr[0].kernelExecTimeoutEnabled = kernelExecTimeoutEnabled - {{endif}} {{if 'cudaDeviceProp.integrated' in found_struct}} @property def integrated(self): @@ -11482,14 +11794,6 @@ cdef class cudaDeviceProp: def canMapHostMemory(self, int canMapHostMemory): self._pvt_ptr[0].canMapHostMemory = canMapHostMemory {{endif}} - {{if 'cudaDeviceProp.computeMode' in found_struct}} - @property - def computeMode(self): - return self._pvt_ptr[0].computeMode - @computeMode.setter - def computeMode(self, int computeMode): - self._pvt_ptr[0].computeMode = computeMode - {{endif}} {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} @property def maxTexture1D(self): @@ -11506,14 +11810,6 @@ cdef class cudaDeviceProp: def maxTexture1DMipmap(self, int maxTexture1DMipmap): self._pvt_ptr[0].maxTexture1DMipmap = maxTexture1DMipmap {{endif}} - {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} - @property - def maxTexture1DLinear(self): - return self._pvt_ptr[0].maxTexture1DLinear - @maxTexture1DLinear.setter - def maxTexture1DLinear(self, int maxTexture1DLinear): - self._pvt_ptr[0].maxTexture1DLinear = maxTexture1DLinear - {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} @property def maxTexture2D(self): @@ -11722,14 +12018,6 @@ cdef class cudaDeviceProp: def unifiedAddressing(self, int unifiedAddressing): self._pvt_ptr[0].unifiedAddressing = unifiedAddressing {{endif}} - {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} - @property - def memoryClockRate(self): - return self._pvt_ptr[0].memoryClockRate - @memoryClockRate.setter - def memoryClockRate(self, int memoryClockRate): - self._pvt_ptr[0].memoryClockRate = memoryClockRate - {{endif}} {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} @property def memoryBusWidth(self): @@ -11834,14 +12122,6 @@ cdef class cudaDeviceProp: def hostNativeAtomicSupported(self, int hostNativeAtomicSupported): self._pvt_ptr[0].hostNativeAtomicSupported = hostNativeAtomicSupported {{endif}} - {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} - @property - def singleToDoublePrecisionPerfRatio(self): - return self._pvt_ptr[0].singleToDoublePrecisionPerfRatio - @singleToDoublePrecisionPerfRatio.setter - def singleToDoublePrecisionPerfRatio(self, int singleToDoublePrecisionPerfRatio): - self._pvt_ptr[0].singleToDoublePrecisionPerfRatio = singleToDoublePrecisionPerfRatio - {{endif}} {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} @property def pageableMemoryAccess(self): @@ -11882,14 +12162,6 @@ cdef class cudaDeviceProp: def cooperativeLaunch(self, int cooperativeLaunch): self._pvt_ptr[0].cooperativeLaunch = cooperativeLaunch {{endif}} - {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} - @property - def cooperativeMultiDeviceLaunch(self): - return self._pvt_ptr[0].cooperativeMultiDeviceLaunch - @cooperativeMultiDeviceLaunch.setter - def cooperativeMultiDeviceLaunch(self, int cooperativeMultiDeviceLaunch): - self._pvt_ptr[0].cooperativeMultiDeviceLaunch = cooperativeMultiDeviceLaunch - {{endif}} {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} @property def sharedMemPerBlockOptin(self): @@ -12042,6 +12314,62 @@ cdef class cudaDeviceProp: def unifiedFunctionPointers(self, int unifiedFunctionPointers): self._pvt_ptr[0].unifiedFunctionPointers = unifiedFunctionPointers {{endif}} + {{if 'cudaDeviceProp.deviceNumaConfig' in found_struct}} + @property + def deviceNumaConfig(self): + return self._pvt_ptr[0].deviceNumaConfig + @deviceNumaConfig.setter + def deviceNumaConfig(self, int deviceNumaConfig): + self._pvt_ptr[0].deviceNumaConfig = deviceNumaConfig + {{endif}} + {{if 'cudaDeviceProp.deviceNumaId' in found_struct}} + @property + def deviceNumaId(self): + return self._pvt_ptr[0].deviceNumaId + @deviceNumaId.setter + def deviceNumaId(self, int deviceNumaId): + self._pvt_ptr[0].deviceNumaId = deviceNumaId + {{endif}} + {{if 'cudaDeviceProp.mpsEnabled' in found_struct}} + @property + def mpsEnabled(self): + return self._pvt_ptr[0].mpsEnabled + @mpsEnabled.setter + def mpsEnabled(self, int mpsEnabled): + self._pvt_ptr[0].mpsEnabled = mpsEnabled + {{endif}} + {{if 'cudaDeviceProp.hostNumaId' in found_struct}} + @property + def hostNumaId(self): + return self._pvt_ptr[0].hostNumaId + @hostNumaId.setter + def hostNumaId(self, int hostNumaId): + self._pvt_ptr[0].hostNumaId = hostNumaId + {{endif}} + {{if 'cudaDeviceProp.gpuPciDeviceID' in found_struct}} + @property + def gpuPciDeviceID(self): + return self._pvt_ptr[0].gpuPciDeviceID + @gpuPciDeviceID.setter + def gpuPciDeviceID(self, unsigned int gpuPciDeviceID): + self._pvt_ptr[0].gpuPciDeviceID = gpuPciDeviceID + {{endif}} + {{if 'cudaDeviceProp.gpuPciSubsystemID' in found_struct}} + @property + def gpuPciSubsystemID(self): + return self._pvt_ptr[0].gpuPciSubsystemID + @gpuPciSubsystemID.setter + def gpuPciSubsystemID(self, unsigned int gpuPciSubsystemID): + self._pvt_ptr[0].gpuPciSubsystemID = gpuPciSubsystemID + {{endif}} + {{if 'cudaDeviceProp.hostNumaMultinodeIpcSupported' in found_struct}} + @property + def hostNumaMultinodeIpcSupported(self): + return self._pvt_ptr[0].hostNumaMultinodeIpcSupported + @hostNumaMultinodeIpcSupported.setter + def hostNumaMultinodeIpcSupported(self, int hostNumaMultinodeIpcSupported): + self._pvt_ptr[0].hostNumaMultinodeIpcSupported = hostNumaMultinodeIpcSupported + {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} @property def reserved(self): @@ -12234,7 +12562,7 @@ cdef class cudaMemFabricHandle_st: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} -cdef class anon_struct7: +cdef class anon_struct8: """ Attributes ---------- @@ -12309,7 +12637,7 @@ cdef class anon_union2: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} - win32 : anon_struct7 + win32 : anon_struct8 {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} @@ -12328,7 +12656,7 @@ cdef class anon_union2: def __init__(self, void_ptr _ptr): pass {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} - self._win32 = anon_struct7(_ptr=self._pvt_ptr) + self._win32 = anon_struct8(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -12371,8 +12699,8 @@ cdef class anon_union2: def win32(self): return self._win32 @win32.setter - def win32(self, win32 not None : anon_struct7): - string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + def win32(self, win32 not None : anon_struct8): + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} @property @@ -12408,6 +12736,10 @@ cdef class cudaExternalMemoryHandleDesc: flags : unsigned int Flags must either be zero or cudaExternalMemoryDedicated {{endif}} + {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -12457,6 +12789,12 @@ cdef class cudaExternalMemoryHandleDesc: except ValueError: str_list += ['flags : '] {{endif}} + {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -12494,6 +12832,14 @@ cdef class cudaExternalMemoryHandleDesc: def flags(self, unsigned int flags): self._pvt_ptr[0].flags = flags {{endif}} + {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaExternalMemoryBufferDesc' in found_struct}} @@ -12515,6 +12861,10 @@ cdef class cudaExternalMemoryBufferDesc: flags : unsigned int Flags reserved for future use. Must be zero. {{endif}} + {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -12553,6 +12903,12 @@ cdef class cudaExternalMemoryBufferDesc: except ValueError: str_list += ['flags : '] {{endif}} + {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -12580,6 +12936,14 @@ cdef class cudaExternalMemoryBufferDesc: def flags(self, unsigned int flags): self._pvt_ptr[0].flags = flags {{endif}} + {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaExternalMemoryMipmappedArrayDesc' in found_struct}} @@ -12611,6 +12975,10 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: numLevels : unsigned int Total number of levels in the mipmap chain {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -12667,6 +13035,12 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: except ValueError: str_list += ['numLevels : '] {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -12710,10 +13084,18 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: def numLevels(self, unsigned int numLevels): self._pvt_ptr[0].numLevels = numLevels {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} -cdef class anon_struct8: +cdef class anon_struct9: """ Attributes ---------- @@ -12788,7 +13170,7 @@ cdef class anon_union3: {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} - win32 : anon_struct8 + win32 : anon_struct9 {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} @@ -12807,7 +13189,7 @@ cdef class anon_union3: def __init__(self, void_ptr _ptr): pass {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} - self._win32 = anon_struct8(_ptr=self._pvt_ptr) + self._win32 = anon_struct9(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -12850,8 +13232,8 @@ cdef class anon_union3: def win32(self): return self._win32 @win32.setter - def win32(self, win32 not None : anon_struct8): - string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + def win32(self, win32 not None : anon_struct9): + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} @property @@ -12883,6 +13265,10 @@ cdef class cudaExternalSemaphoreHandleDesc: flags : unsigned int Flags reserved for the future. Must be zero. {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} + reserved : List[unsigned int] + Must be zero + {{endif}} Methods ------- @@ -12926,6 +13312,12 @@ cdef class cudaExternalSemaphoreHandleDesc: except ValueError: str_list += ['flags : '] {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -12955,10 +13347,18 @@ cdef class cudaExternalSemaphoreHandleDesc: def flags(self, unsigned int flags): self._pvt_ptr[0].flags = flags {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} + @property + def reserved(self): + return self._pvt_ptr[0].reserved + @reserved.setter + def reserved(self, reserved): + self._pvt_ptr[0].reserved = reserved + {{endif}} {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} -cdef class anon_struct15: +cdef class anon_struct10: """ Attributes ---------- @@ -13004,7 +13404,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} -cdef class anon_union6: +cdef class anon_union4: """ Attributes ---------- @@ -13069,7 +13469,7 @@ cdef class anon_union6: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} -cdef class anon_struct16: +cdef class anon_struct11: """ Attributes ---------- @@ -13115,20 +13515,20 @@ cdef class anon_struct16: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} -cdef class anon_struct17: +cdef class anon_struct12: """ Attributes ---------- {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} - fence : anon_struct15 + fence : anon_struct10 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union6 + nvSciSync : anon_union4 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} - keyedMutex : anon_struct16 + keyedMutex : anon_struct11 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} @@ -13147,13 +13547,13 @@ cdef class anon_struct17: def __init__(self, void_ptr _ptr): pass {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} - self._fence = anon_struct15(_ptr=self._pvt_ptr) + self._fence = anon_struct10(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - self._nvSciSync = anon_union6(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union4(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} - self._keyedMutex = anon_struct16(_ptr=self._pvt_ptr) + self._keyedMutex = anon_struct11(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -13194,24 +13594,24 @@ cdef class anon_struct17: def fence(self): return self._fence @fence.setter - def fence(self, fence not None : anon_struct15): - string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + def fence(self, fence not None : anon_struct10): + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} @property def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union6): - string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + def nvSciSync(self, nvSciSync not None : anon_union4): + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} @property def keyedMutex(self): return self._keyedMutex @keyedMutex.setter - def keyedMutex(self, keyedMutex not None : anon_struct16): - string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + def keyedMutex(self, keyedMutex not None : anon_struct11): + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} @property @@ -13231,7 +13631,7 @@ cdef class cudaExternalSemaphoreSignalParams: Attributes ---------- {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} - params : anon_struct17 + params : anon_struct12 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} @@ -13263,7 +13663,7 @@ cdef class cudaExternalSemaphoreSignalParams: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} - self._params = anon_struct17(_ptr=self._pvt_ptr) + self._params = anon_struct12(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -13298,8 +13698,8 @@ cdef class cudaExternalSemaphoreSignalParams: def params(self): return self._params @params.setter - def params(self, params not None : anon_struct17): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + def params(self, params not None : anon_struct12): + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} @property @@ -13320,7 +13720,7 @@ cdef class cudaExternalSemaphoreSignalParams: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} -cdef class anon_struct18: +cdef class anon_struct13: """ Attributes ---------- @@ -13366,7 +13766,7 @@ cdef class anon_struct18: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} -cdef class anon_union7: +cdef class anon_union5: """ Attributes ---------- @@ -13431,7 +13831,7 @@ cdef class anon_union7: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} -cdef class anon_struct19: +cdef class anon_struct14: """ Attributes ---------- @@ -13495,20 +13895,20 @@ cdef class anon_struct19: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} -cdef class anon_struct20: +cdef class anon_struct15: """ Attributes ---------- {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} - fence : anon_struct18 + fence : anon_struct13 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union7 + nvSciSync : anon_union5 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} - keyedMutex : anon_struct19 + keyedMutex : anon_struct14 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} @@ -13527,13 +13927,13 @@ cdef class anon_struct20: def __init__(self, void_ptr _ptr): pass {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} - self._fence = anon_struct18(_ptr=self._pvt_ptr) + self._fence = anon_struct13(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union5(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} - self._keyedMutex = anon_struct19(_ptr=self._pvt_ptr) + self._keyedMutex = anon_struct14(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -13574,24 +13974,24 @@ cdef class anon_struct20: def fence(self): return self._fence @fence.setter - def fence(self, fence not None : anon_struct18): - string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + def fence(self, fence not None : anon_struct13): + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} @property def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union7): - string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + def nvSciSync(self, nvSciSync not None : anon_union5): + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} @property def keyedMutex(self): return self._keyedMutex @keyedMutex.setter - def keyedMutex(self, keyedMutex not None : anon_struct19): - string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + def keyedMutex(self, keyedMutex not None : anon_struct14): + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} @property @@ -13611,7 +14011,7 @@ cdef class cudaExternalSemaphoreWaitParams: Attributes ---------- {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} - params : anon_struct20 + params : anon_struct15 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} @@ -13643,7 +14043,7 @@ cdef class cudaExternalSemaphoreWaitParams: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} - self._params = anon_struct20(_ptr=self._pvt_ptr) + self._params = anon_struct15(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -13678,8 +14078,8 @@ cdef class cudaExternalSemaphoreWaitParams: def params(self): return self._params @params.setter - def params(self, params not None : anon_struct20): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + def params(self, params not None : anon_struct15): + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} @property @@ -14618,7 +15018,7 @@ cdef class cudaConditionalNodeParams: {{if 'cudaConditionalNodeParams.size' in found_struct}} size : unsigned int Size of graph output array. Allowed values are 1 for - cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeWhile, or any + cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeIf, or any value greater than zero for cudaGraphCondTypeSwitch. {{endif}} {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} @@ -15676,7 +16076,7 @@ cdef class cudaGraphExecUpdateResultInfo_st: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} -cdef class anon_struct21: +cdef class anon_struct16: """ Attributes ---------- @@ -15759,7 +16159,7 @@ cdef class anon_struct21: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} -cdef class anon_union9: +cdef class anon_union7: """ Attributes ---------- @@ -15768,7 +16168,7 @@ cdef class anon_union9: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} - param : anon_struct21 + param : anon_struct16 {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} @@ -15790,7 +16190,7 @@ cdef class anon_union9: self._gridDim = dim3(_ptr=&self._pvt_ptr[0].updateData.gridDim) {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} - self._param = anon_struct21(_ptr=self._pvt_ptr) + self._param = anon_struct16(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -15833,8 +16233,8 @@ cdef class anon_union9: def param(self): return self._param @param.setter - def param(self, param not None : anon_struct21): - string.memcpy(&self._pvt_ptr[0].updateData.param, param.getPtr(), sizeof(self._pvt_ptr[0].updateData.param)) + def param(self, param not None : anon_struct16): + string.memcpy(&self._pvt_ptr[0].updateData.param, param.getPtr(), sizeof(self._pvt_ptr[0].updateData.param)) {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} @property @@ -15864,7 +16264,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - updateData : anon_union9 + updateData : anon_union7 Update data to apply. Which field is used depends on field's value {{endif}} @@ -15885,7 +16285,7 @@ cdef class cudaGraphKernelNodeUpdate: self._node = cudaGraphDeviceNode_t(_ptr=&self._pvt_ptr[0].node) {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - self._updateData = anon_union9(_ptr=self._pvt_ptr) + self._updateData = anon_union7(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -15948,8 +16348,8 @@ cdef class cudaGraphKernelNodeUpdate: def updateData(self): return self._updateData @updateData.setter - def updateData(self, updateData not None : anon_union9): - string.memcpy(&self._pvt_ptr[0].updateData, updateData.getPtr(), sizeof(self._pvt_ptr[0].updateData)) + def updateData(self, updateData not None : anon_union7): + string.memcpy(&self._pvt_ptr[0].updateData, updateData.getPtr(), sizeof(self._pvt_ptr[0].updateData)) {{endif}} {{endif}} {{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} @@ -16028,7 +16428,7 @@ cdef class cudaLaunchMemSyncDomainMap_st: {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} -cdef class anon_struct22: +cdef class anon_struct17: """ Attributes ---------- @@ -16110,7 +16510,7 @@ cdef class anon_struct22: {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} -cdef class anon_struct23: +cdef class anon_struct18: """ Attributes ---------- @@ -16204,7 +16604,7 @@ cdef class anon_struct23: {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} -cdef class anon_struct24: +cdef class anon_struct19: """ Attributes ---------- @@ -16286,7 +16686,7 @@ cdef class anon_struct24: {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} -cdef class anon_struct25: +cdef class anon_struct20: """ Attributes ---------- @@ -16362,7 +16762,7 @@ cdef class anon_struct25: {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} -cdef class anon_struct26: +cdef class anon_struct21: """ Attributes ---------- @@ -16464,7 +16864,7 @@ cdef class cudaLaunchAttributeValue: ::cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - clusterDim : anon_struct22 + clusterDim : anon_struct17 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -16485,7 +16885,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeProgrammaticStreamSerialization. {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - programmaticEvent : anon_struct23 + programmaticEvent : anon_struct18 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -16509,7 +16909,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchMemSyncDomain. {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - preferredClusterDim : anon_struct24 + preferredClusterDim : anon_struct19 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type @@ -16524,7 +16924,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - launchCompletionEvent : anon_struct25 + launchCompletionEvent : anon_struct20 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -16532,7 +16932,7 @@ cdef class cudaLaunchAttributeValue: cudaEventRecordExternal. {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - deviceUpdatableKernelNode : anon_struct26 + deviceUpdatableKernelNode : anon_struct21 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -16545,6 +16945,11 @@ cdef class cudaLaunchAttributeValue: Value of launch attribute cudaLaunchAttributePreferredSharedMemoryCarveout. {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + {{endif}} Methods ------- @@ -16562,22 +16967,22 @@ cdef class cudaLaunchAttributeValue: self._accessPolicyWindow = cudaAccessPolicyWindow(_ptr=&self._pvt_ptr[0].accessPolicyWindow) {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} - self._clusterDim = anon_struct22(_ptr=self._pvt_ptr) + self._clusterDim = anon_struct17(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} - self._programmaticEvent = anon_struct23(_ptr=self._pvt_ptr) + self._programmaticEvent = anon_struct18(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} self._memSyncDomainMap = cudaLaunchMemSyncDomainMap(_ptr=&self._pvt_ptr[0].memSyncDomainMap) {{endif}} {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} - self._preferredClusterDim = anon_struct24(_ptr=self._pvt_ptr) + self._preferredClusterDim = anon_struct19(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} - self._launchCompletionEvent = anon_struct25(_ptr=self._pvt_ptr) + self._launchCompletionEvent = anon_struct20(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} - self._deviceUpdatableKernelNode = anon_struct26(_ptr=self._pvt_ptr) + self._deviceUpdatableKernelNode = anon_struct21(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -16676,6 +17081,12 @@ cdef class cudaLaunchAttributeValue: except ValueError: str_list += ['sharedMemCarveout : '] {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + try: + str_list += ['nvlinkUtilCentricScheduling : ' + str(self.nvlinkUtilCentricScheduling)] + except ValueError: + str_list += ['nvlinkUtilCentricScheduling : '] + {{endif}} return '\n'.join(str_list) else: return '' @@ -16729,8 +17140,8 @@ cdef class cudaLaunchAttributeValue: def clusterDim(self): return self._clusterDim @clusterDim.setter - def clusterDim(self, clusterDim not None : anon_struct22): - string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) + def clusterDim(self, clusterDim not None : anon_struct17): + string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) {{endif}} {{if 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} @property @@ -16755,8 +17166,8 @@ cdef class cudaLaunchAttributeValue: def programmaticEvent(self): return self._programmaticEvent @programmaticEvent.setter - def programmaticEvent(self, programmaticEvent not None : anon_struct23): - string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) + def programmaticEvent(self, programmaticEvent not None : anon_struct18): + string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) {{endif}} {{if 'cudaLaunchAttributeValue.priority' in found_struct}} @property @@ -16789,24 +17200,24 @@ cdef class cudaLaunchAttributeValue: def preferredClusterDim(self): return self._preferredClusterDim @preferredClusterDim.setter - def preferredClusterDim(self, preferredClusterDim not None : anon_struct24): - string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) + def preferredClusterDim(self, preferredClusterDim not None : anon_struct19): + string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} @property def launchCompletionEvent(self): return self._launchCompletionEvent @launchCompletionEvent.setter - def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct25): - string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) + def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct20): + string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} @property def deviceUpdatableKernelNode(self): return self._deviceUpdatableKernelNode @deviceUpdatableKernelNode.setter - def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct26): - string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) + def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct21): + string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) {{endif}} {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} @property @@ -16816,6 +17227,14 @@ cdef class cudaLaunchAttributeValue: def sharedMemCarveout(self, unsigned int sharedMemCarveout): self._pvt_ptr[0].sharedMemCarveout = sharedMemCarveout {{endif}} + {{if 'cudaLaunchAttributeValue.nvlinkUtilCentricScheduling' in found_struct}} + @property + def nvlinkUtilCentricScheduling(self): + return self._pvt_ptr[0].nvlinkUtilCentricScheduling + @nvlinkUtilCentricScheduling.setter + def nvlinkUtilCentricScheduling(self, unsigned int nvlinkUtilCentricScheduling): + self._pvt_ptr[0].nvlinkUtilCentricScheduling = nvlinkUtilCentricScheduling + {{endif}} {{endif}} {{if 'cudaLaunchAttribute_st' in found_struct}} @@ -16892,7 +17311,7 @@ cdef class cudaLaunchAttribute_st: {{endif}} {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} -cdef class anon_struct27: +cdef class anon_struct22: """ Attributes ---------- @@ -16938,12 +17357,12 @@ cdef class anon_struct27: {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} -cdef class anon_union10: +cdef class anon_union8: """ Attributes ---------- {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} - overBudget : anon_struct27 + overBudget : anon_struct22 {{endif}} @@ -16958,7 +17377,7 @@ cdef class anon_union10: def __init__(self, void_ptr _ptr): pass {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} - self._overBudget = anon_struct27(_ptr=self._pvt_ptr) + self._overBudget = anon_struct22(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): pass @@ -16981,8 +17400,8 @@ cdef class anon_union10: def overBudget(self): return self._overBudget @overBudget.setter - def overBudget(self, overBudget not None : anon_struct27): - string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) + def overBudget(self, overBudget not None : anon_struct22): + string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) {{endif}} {{endif}} {{if 'cudaAsyncNotificationInfo' in found_struct}} @@ -16998,7 +17417,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union8 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -17017,7 +17436,7 @@ cdef class cudaAsyncNotificationInfo: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - self._info = anon_union10(_ptr=self._pvt_ptr) + self._info = anon_union8(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -17057,8 +17476,8 @@ cdef class cudaAsyncNotificationInfo: def info(self): return self._info @info.setter - def info(self, info not None : anon_union10): - string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) + def info(self, info not None : anon_union8): + string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) {{endif}} {{endif}} {{if 'cudaTextureDesc' in found_struct}} @@ -17497,7 +17916,7 @@ cdef class cudaEglPlaneDesc_st: {{endif}} {{if True}} -cdef class anon_union11: +cdef class anon_union9: """ Attributes ---------- @@ -17587,7 +18006,7 @@ cdef class cudaEglFrame_st: Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union9 {{endif}} {{if True}} @@ -17621,7 +18040,7 @@ cdef class cudaEglFrame_st: def __init__(self, void_ptr _ptr = 0): pass {{if True}} - self._frame = anon_union11(_ptr=self._pvt_ptr) + self._frame = anon_union9(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -17669,8 +18088,8 @@ cdef class cudaEglFrame_st: def frame(self): return self._frame @frame.setter - def frame(self, frame not None : anon_union11): - string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) + def frame(self, frame not None : anon_union9): + string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) {{endif}} {{if True}} @property @@ -17746,6 +18165,34 @@ cdef class cudaGraphConditionalHandle: return self._pvt_ptr {{endif}} +{{if 'cudaLogIterator' in found_types}} + +cdef class cudaLogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + {{if 'cudaSurfaceObject_t' in found_types}} cdef class cudaSurfaceObject_t: @@ -19204,326 +19651,29 @@ def cudaGetDeviceCount(): return (_dict_cudaError_t[err], count) {{endif}} -{{if 'cudaGetDeviceProperties_v2' in found_functions}} +{{if 'cudaGetDeviceProperties' in found_functions}} @cython.embedsignature(True) def cudaGetDeviceProperties(int device): """ Returns information about the compute-device. - Returns in `*prop` the properties of device `dev`. The - :py:obj:`~.cudaDeviceProp` structure is defined as: - - **View CUDA Toolkit Documentation for a C++ code example** - - where: - - - :py:obj:`~.name[256]` is an ASCII string identifying the device. - - - :py:obj:`~.uuid` is a 16-byte unique identifier. - - - :py:obj:`~.totalGlobalMem` is the total amount of global memory - available on the device in bytes. - - - :py:obj:`~.sharedMemPerBlock` is the maximum amount of shared memory - available to a thread block in bytes. - - - :py:obj:`~.regsPerBlock` is the maximum number of 32-bit registers - available to a thread block. - - - :py:obj:`~.warpSize` is the warp size in threads. - - - :py:obj:`~.memPitch` is the maximum pitch in bytes allowed by the - memory copy functions that involve memory regions allocated through - :py:obj:`~.cudaMallocPitch()`. - - - :py:obj:`~.maxThreadsPerBlock` is the maximum number of threads per - block. - - - :py:obj:`~.maxThreadsDim[3]` contains the maximum size of each - dimension of a block. - - - :py:obj:`~.maxGridSize[3]` contains the maximum size of each - dimension of a grid. - - - :py:obj:`~.clockRate` is the clock frequency in kilohertz. - - - :py:obj:`~.totalConstMem` is the total amount of constant memory - available on the device in bytes. - - - :py:obj:`~.major`, :py:obj:`~.minor` are the major and minor revision - numbers defining the device's compute capability. - - - :py:obj:`~.textureAlignment` is the alignment requirement; texture - base addresses that are aligned to :py:obj:`~.textureAlignment` bytes - do not need an offset applied to texture fetches. - - - :py:obj:`~.texturePitchAlignment` is the pitch alignment requirement - for 2D texture references that are bound to pitched memory. - - - :py:obj:`~.deviceOverlap` is 1 if the device can concurrently copy - memory between host and device while executing a kernel, or 0 if not. - Deprecated, use instead asyncEngineCount. - - - :py:obj:`~.multiProcessorCount` is the number of multiprocessors on - the device. - - - :py:obj:`~.kernelExecTimeoutEnabled` is 1 if there is a run time - limit for kernels executed on the device, or 0 if not. - - - :py:obj:`~.integrated` is 1 if the device is an integrated - (motherboard) GPU and 0 if it is a discrete (card) component. - - - :py:obj:`~.canMapHostMemory` is 1 if the device can map host memory - into the CUDA address space for use with - :py:obj:`~.cudaHostAlloc()`/:py:obj:`~.cudaHostGetDevicePointer()`, - or 0 if not. - - - :py:obj:`~.computeMode` is the compute mode that the device is - currently in. Available modes are as follows: - - - cudaComputeModeDefault: Default mode - Device is not restricted and - multiple threads can use :py:obj:`~.cudaSetDevice()` with this - device. - - - cudaComputeModeProhibited: Compute-prohibited mode - No threads can - use :py:obj:`~.cudaSetDevice()` with this device. - - - cudaComputeModeExclusiveProcess: Compute-exclusive-process mode - - Many threads in one process will be able to use - :py:obj:`~.cudaSetDevice()` with this device. When an occupied - exclusive mode device is chosen with :py:obj:`~.cudaSetDevice`, all - subsequent non-device management runtime functions will return - :py:obj:`~.cudaErrorDevicesUnavailable`. - - - :py:obj:`~.maxTexture1D` is the maximum 1D texture size. - - - :py:obj:`~.maxTexture1DMipmap` is the maximum 1D mipmapped texture - texture size. - - - :py:obj:`~.maxTexture1DLinear` is the maximum 1D texture size for - textures bound to linear memory. - - - :py:obj:`~.maxTexture2D[2]` contains the maximum 2D texture - dimensions. - - - :py:obj:`~.maxTexture2DMipmap[2]` contains the maximum 2D mipmapped - texture dimensions. - - - :py:obj:`~.maxTexture2DLinear[3]` contains the maximum 2D texture - dimensions for 2D textures bound to pitch linear memory. - - - :py:obj:`~.maxTexture2DGather[2]` contains the maximum 2D texture - dimensions if texture gather operations have to be performed. - - - :py:obj:`~.maxTexture3D[3]` contains the maximum 3D texture - dimensions. - - - :py:obj:`~.maxTexture3DAlt[3]` contains the maximum alternate 3D - texture dimensions. - - - :py:obj:`~.maxTextureCubemap` is the maximum cubemap texture width or - height. - - - :py:obj:`~.maxTexture1DLayered[2]` contains the maximum 1D layered - texture dimensions. - - - :py:obj:`~.maxTexture2DLayered[3]` contains the maximum 2D layered - texture dimensions. - - - :py:obj:`~.maxTextureCubemapLayered[2]` contains the maximum cubemap - layered texture dimensions. - - - :py:obj:`~.maxSurface1D` is the maximum 1D surface size. - - - :py:obj:`~.maxSurface2D[2]` contains the maximum 2D surface - dimensions. - - - :py:obj:`~.maxSurface3D[3]` contains the maximum 3D surface - dimensions. - - - :py:obj:`~.maxSurface1DLayered[2]` contains the maximum 1D layered - surface dimensions. - - - :py:obj:`~.maxSurface2DLayered[3]` contains the maximum 2D layered - surface dimensions. - - - :py:obj:`~.maxSurfaceCubemap` is the maximum cubemap surface width or - height. - - - :py:obj:`~.maxSurfaceCubemapLayered[2]` contains the maximum cubemap - layered surface dimensions. - - - :py:obj:`~.surfaceAlignment` specifies the alignment requirements for - surfaces. - - - :py:obj:`~.concurrentKernels` is 1 if the device supports executing - multiple kernels within the same context simultaneously, or 0 if not. - It is not guaranteed that multiple kernels will be resident on the - device concurrently so this feature should not be relied upon for - correctness. - - - :py:obj:`~.ECCEnabled` is 1 if the device has ECC support turned on, - or 0 if not. - - - :py:obj:`~.pciBusID` is the PCI bus identifier of the device. - - - :py:obj:`~.pciDeviceID` is the PCI device (sometimes called slot) - identifier of the device. - - - :py:obj:`~.pciDomainID` is the PCI domain identifier of the device. - - - :py:obj:`~.tccDriver` is 1 if the device is using a TCC driver or 0 - if not. - - - :py:obj:`~.asyncEngineCount` is 1 when the device can concurrently - copy memory between host and device while executing a kernel. It is 2 - when the device can concurrently copy memory between host and device - in both directions and execute a kernel at the same time. It is 0 if - neither of these is supported. - - - :py:obj:`~.unifiedAddressing` is 1 if the device shares a unified - address space with the host and 0 otherwise. - - - :py:obj:`~.memoryClockRate` is the peak memory clock frequency in - kilohertz. - - - :py:obj:`~.memoryBusWidth` is the memory bus width in bits. - - - :py:obj:`~.l2CacheSize` is L2 cache size in bytes. - - - :py:obj:`~.persistingL2CacheMaxSize` is L2 cache's maximum persisting - lines size in bytes. - - - :py:obj:`~.maxThreadsPerMultiProcessor` is the number of maximum - resident threads per multiprocessor. - - - :py:obj:`~.streamPrioritiesSupported` is 1 if the device supports - stream priorities, or 0 if it is not supported. - - - :py:obj:`~.globalL1CacheSupported` is 1 if the device supports - caching of globals in L1 cache, or 0 if it is not supported. - - - :py:obj:`~.localL1CacheSupported` is 1 if the device supports caching - of locals in L1 cache, or 0 if it is not supported. - - - :py:obj:`~.sharedMemPerMultiprocessor` is the maximum amount of - shared memory available to a multiprocessor in bytes; this amount is - shared by all thread blocks simultaneously resident on a - multiprocessor. - - - :py:obj:`~.regsPerMultiprocessor` is the maximum number of 32-bit - registers available to a multiprocessor; this number is shared by all - thread blocks simultaneously resident on a multiprocessor. - - - :py:obj:`~.managedMemory` is 1 if the device supports allocating - managed memory on this system, or 0 if it is not supported. - - - :py:obj:`~.isMultiGpuBoard` is 1 if the device is on a multi-GPU - board (e.g. Gemini cards), and 0 if not; - - - :py:obj:`~.multiGpuBoardGroupID` is a unique identifier for a group - of devices associated with the same board. Devices on the same multi- - GPU board will share the same identifier. - - - :py:obj:`~.hostNativeAtomicSupported` is 1 if the link between the - device and the host supports native atomic operations, or 0 if it is - not supported. - - - :py:obj:`~.singleToDoublePrecisionPerfRatio` is the ratio of single - precision performance (in floating-point operations per second) to - double precision performance. - - - :py:obj:`~.pageableMemoryAccess` is 1 if the device supports - coherently accessing pageable memory without calling cudaHostRegister - on it, and 0 otherwise. - - - :py:obj:`~.concurrentManagedAccess` is 1 if the device can coherently - access managed memory concurrently with the CPU, and 0 otherwise. - - - :py:obj:`~.computePreemptionSupported` is 1 if the device supports - Compute Preemption, and 0 otherwise. - - - :py:obj:`~.canUseHostPointerForRegisteredMem` is 1 if the device can - access host registered memory at the same virtual address as the CPU, - and 0 otherwise. - - - :py:obj:`~.cooperativeLaunch` is 1 if the device supports launching - cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel`, and - 0 otherwise. - - - :py:obj:`~.cooperativeMultiDeviceLaunch` is 1 if the device supports - launching cooperative kernels via - :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice`, and 0 otherwise. - - - :py:obj:`~.sharedMemPerBlockOptin` is the per device maximum shared - memory per block usable by special opt in - - - :py:obj:`~.pageableMemoryAccessUsesHostPageTables` is 1 if the device - accesses pageable memory via the host's page tables, and 0 otherwise. - - - :py:obj:`~.directManagedMemAccessFromHost` is 1 if the host can - directly access managed memory on the device without migration, and 0 - otherwise. - - - :py:obj:`~.maxBlocksPerMultiProcessor` is the maximum number of - thread blocks that can reside on a multiprocessor. - - - :py:obj:`~.accessPolicyMaxWindowSize` is the maximum value of - :py:obj:`~.cudaAccessPolicyWindow.num_bytes`. - - - :py:obj:`~.reservedSharedMemPerBlock` is the shared memory reserved - by CUDA driver per block in bytes - - - :py:obj:`~.hostRegisterSupported` is 1 if the device supports host - memory registration via :py:obj:`~.cudaHostRegister`, and 0 - otherwise. - - - :py:obj:`~.sparseCudaArraySupported` is 1 if the device supports - sparse CUDA arrays and sparse CUDA mipmapped arrays, 0 otherwise - - - :py:obj:`~.hostRegisterReadOnlySupported` is 1 if the device supports - using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly - to register memory that must be mapped as read-only to the GPU - - - :py:obj:`~.timelineSemaphoreInteropSupported` is 1 if external - timeline semaphore interop is supported on the device, 0 otherwise - - - :py:obj:`~.memoryPoolsSupported` is 1 if the device supports using - the cudaMallocAsync and cudaMemPool family of APIs, 0 otherwise - - - :py:obj:`~.gpuDirectRDMASupported` is 1 if the device supports - GPUDirect RDMA APIs, 0 otherwise - - - :py:obj:`~.gpuDirectRDMAFlushWritesOptions` is a bitmask to be - interpreted according to the - :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum - - - :py:obj:`~.gpuDirectRDMAWritesOrdering` See the - :py:obj:`~.cudaGPUDirectRDMAWritesOrdering` enum for numerical values - - - :py:obj:`~.memoryPoolSupportedHandleTypes` is a bitmask of handle - types supported with mempool-based IPC - - - :py:obj:`~.deferredMappingCudaArraySupported` is 1 if the device - supports deferred mapping CUDA arrays and CUDA mipmapped arrays - - - :py:obj:`~.ipcEventSupported` is 1 if the device supports IPC Events, - and 0 otherwise - - - :py:obj:`~.unifiedFunctionPointers` is 1 if the device support - unified pointers, and 0 otherwise + Returns in `*prop` the properties of device `dev`. Parameters ---------- device : int - None + Device number to get properties for Returns ------- cudaError_t - + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice` prop : :py:obj:`~.cudaDeviceProp` - None + Properties for the specified device + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaDeviceGetAttribute`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetName` """ cdef cudaDeviceProp prop = cudaDeviceProp() with nogil: @@ -19540,350 +19690,7 @@ def cudaDeviceGetAttribute(attr not None : cudaDeviceAttr, int device): """ Returns information about the device. Returns in `*value` the integer value of the attribute `attr` on device - `device`. The supported attributes are: - - - :py:obj:`~.cudaDevAttrMaxThreadsPerBlock`: Maximum number of threads - per block - - - :py:obj:`~.cudaDevAttrMaxBlockDimX`: Maximum x-dimension of a block - - - :py:obj:`~.cudaDevAttrMaxBlockDimY`: Maximum y-dimension of a block - - - :py:obj:`~.cudaDevAttrMaxBlockDimZ`: Maximum z-dimension of a block - - - :py:obj:`~.cudaDevAttrMaxGridDimX`: Maximum x-dimension of a grid - - - :py:obj:`~.cudaDevAttrMaxGridDimY`: Maximum y-dimension of a grid - - - :py:obj:`~.cudaDevAttrMaxGridDimZ`: Maximum z-dimension of a grid - - - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock`: Maximum amount of - shared memory available to a thread block in bytes - - - :py:obj:`~.cudaDevAttrTotalConstantMemory`: Memory available on - device for constant variables in a CUDA C kernel in bytes - - - :py:obj:`~.cudaDevAttrWarpSize`: Warp size in threads - - - :py:obj:`~.cudaDevAttrMaxPitch`: Maximum pitch in bytes allowed by - the memory copy functions that involve memory regions allocated - through :py:obj:`~.cudaMallocPitch()` - - - :py:obj:`~.cudaDevAttrMaxTexture1DWidth`: Maximum 1D texture width - - - :py:obj:`~.cudaDevAttrMaxTexture1DLinearWidth`: Maximum width for a - 1D texture bound to linear memory - - - :py:obj:`~.cudaDevAttrMaxTexture1DMipmappedWidth`: Maximum mipmapped - 1D texture width - - - :py:obj:`~.cudaDevAttrMaxTexture2DWidth`: Maximum 2D texture width - - - :py:obj:`~.cudaDevAttrMaxTexture2DHeight`: Maximum 2D texture height - - - :py:obj:`~.cudaDevAttrMaxTexture2DLinearWidth`: Maximum width for a - 2D texture bound to linear memory - - - :py:obj:`~.cudaDevAttrMaxTexture2DLinearHeight`: Maximum height for a - 2D texture bound to linear memory - - - :py:obj:`~.cudaDevAttrMaxTexture2DLinearPitch`: Maximum pitch in - bytes for a 2D texture bound to linear memory - - - :py:obj:`~.cudaDevAttrMaxTexture2DMipmappedWidth`: Maximum mipmapped - 2D texture width - - - :py:obj:`~.cudaDevAttrMaxTexture2DMipmappedHeight`: Maximum mipmapped - 2D texture height - - - :py:obj:`~.cudaDevAttrMaxTexture3DWidth`: Maximum 3D texture width - - - :py:obj:`~.cudaDevAttrMaxTexture3DHeight`: Maximum 3D texture height - - - :py:obj:`~.cudaDevAttrMaxTexture3DDepth`: Maximum 3D texture depth - - - :py:obj:`~.cudaDevAttrMaxTexture3DWidthAlt`: Alternate maximum 3D - texture width, 0 if no alternate maximum 3D texture size is supported - - - :py:obj:`~.cudaDevAttrMaxTexture3DHeightAlt`: Alternate maximum 3D - texture height, 0 if no alternate maximum 3D texture size is - supported - - - :py:obj:`~.cudaDevAttrMaxTexture3DDepthAlt`: Alternate maximum 3D - texture depth, 0 if no alternate maximum 3D texture size is supported - - - :py:obj:`~.cudaDevAttrMaxTextureCubemapWidth`: Maximum cubemap - texture width or height - - - :py:obj:`~.cudaDevAttrMaxTexture1DLayeredWidth`: Maximum 1D layered - texture width - - - :py:obj:`~.cudaDevAttrMaxTexture1DLayeredLayers`: Maximum layers in a - 1D layered texture - - - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredWidth`: Maximum 2D layered - texture width - - - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredHeight`: Maximum 2D layered - texture height - - - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredLayers`: Maximum layers in a - 2D layered texture - - - :py:obj:`~.cudaDevAttrMaxTextureCubemapLayeredWidth`: Maximum cubemap - layered texture width or height - - - :py:obj:`~.cudaDevAttrMaxTextureCubemapLayeredLayers`: Maximum layers - in a cubemap layered texture - - - :py:obj:`~.cudaDevAttrMaxSurface1DWidth`: Maximum 1D surface width - - - :py:obj:`~.cudaDevAttrMaxSurface2DWidth`: Maximum 2D surface width - - - :py:obj:`~.cudaDevAttrMaxSurface2DHeight`: Maximum 2D surface height - - - :py:obj:`~.cudaDevAttrMaxSurface3DWidth`: Maximum 3D surface width - - - :py:obj:`~.cudaDevAttrMaxSurface3DHeight`: Maximum 3D surface height - - - :py:obj:`~.cudaDevAttrMaxSurface3DDepth`: Maximum 3D surface depth - - - :py:obj:`~.cudaDevAttrMaxSurface1DLayeredWidth`: Maximum 1D layered - surface width - - - :py:obj:`~.cudaDevAttrMaxSurface1DLayeredLayers`: Maximum layers in a - 1D layered surface - - - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredWidth`: Maximum 2D layered - surface width - - - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredHeight`: Maximum 2D layered - surface height - - - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredLayers`: Maximum layers in a - 2D layered surface - - - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapWidth`: Maximum cubemap - surface width - - - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapLayeredWidth`: Maximum cubemap - layered surface width - - - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapLayeredLayers`: Maximum layers - in a cubemap layered surface - - - :py:obj:`~.cudaDevAttrMaxRegistersPerBlock`: Maximum number of 32-bit - registers available to a thread block - - - :py:obj:`~.cudaDevAttrClockRate`: Peak clock frequency in kilohertz - - - :py:obj:`~.cudaDevAttrTextureAlignment`: Alignment requirement; - texture base addresses aligned to :py:obj:`~.textureAlign` bytes do - not need an offset applied to texture fetches - - - :py:obj:`~.cudaDevAttrTexturePitchAlignment`: Pitch alignment - requirement for 2D texture references bound to pitched memory - - - :py:obj:`~.cudaDevAttrGpuOverlap`: 1 if the device can concurrently - copy memory between host and device while executing a kernel, or 0 if - not - - - :py:obj:`~.cudaDevAttrMultiProcessorCount`: Number of multiprocessors - on the device - - - :py:obj:`~.cudaDevAttrKernelExecTimeout`: 1 if there is a run time - limit for kernels executed on the device, or 0 if not - - - :py:obj:`~.cudaDevAttrIntegrated`: 1 if the device is integrated with - the memory subsystem, or 0 if not - - - :py:obj:`~.cudaDevAttrCanMapHostMemory`: 1 if the device can map host - memory into the CUDA address space, or 0 if not - - - :py:obj:`~.cudaDevAttrComputeMode`: Compute mode is the compute mode - that the device is currently in. Available modes are as follows: - - - :py:obj:`~.cudaComputeModeDefault`: Default mode - Device is not - restricted and multiple threads can use :py:obj:`~.cudaSetDevice()` - with this device. - - - :py:obj:`~.cudaComputeModeProhibited`: Compute-prohibited mode - No - threads can use :py:obj:`~.cudaSetDevice()` with this device. - - - :py:obj:`~.cudaComputeModeExclusiveProcess`: Compute-exclusive- - process mode - Many threads in one process will be able to use - :py:obj:`~.cudaSetDevice()` with this device. - - - :py:obj:`~.cudaDevAttrConcurrentKernels`: 1 if the device supports - executing multiple kernels within the same context simultaneously, or - 0 if not. It is not guaranteed that multiple kernels will be resident - on the device concurrently so this feature should not be relied upon - for correctness. - - - :py:obj:`~.cudaDevAttrEccEnabled`: 1 if error correction is enabled - on the device, 0 if error correction is disabled or not supported by - the device - - - :py:obj:`~.cudaDevAttrPciBusId`: PCI bus identifier of the device - - - :py:obj:`~.cudaDevAttrPciDeviceId`: PCI device (also known as slot) - identifier of the device - - - :py:obj:`~.cudaDevAttrTccDriver`: 1 if the device is using a TCC - driver. TCC is only available on Tesla hardware running Windows Vista - or later. - - - :py:obj:`~.cudaDevAttrMemoryClockRate`: Peak memory clock frequency - in kilohertz - - - :py:obj:`~.cudaDevAttrGlobalMemoryBusWidth`: Global memory bus width - in bits - - - :py:obj:`~.cudaDevAttrL2CacheSize`: Size of L2 cache in bytes. 0 if - the device doesn't have L2 cache. - - - :py:obj:`~.cudaDevAttrMaxThreadsPerMultiProcessor`: Maximum resident - threads per multiprocessor - - - :py:obj:`~.cudaDevAttrUnifiedAddressing`: 1 if the device shares a - unified address space with the host, or 0 if not - - - :py:obj:`~.cudaDevAttrComputeCapabilityMajor`: Major compute - capability version number - - - :py:obj:`~.cudaDevAttrComputeCapabilityMinor`: Minor compute - capability version number - - - :py:obj:`~.cudaDevAttrStreamPrioritiesSupported`: 1 if the device - supports stream priorities, or 0 if not - - - :py:obj:`~.cudaDevAttrGlobalL1CacheSupported`: 1 if device supports - caching globals in L1 cache, 0 if not - - - :py:obj:`~.cudaDevAttrLocalL1CacheSupported`: 1 if device supports - caching locals in L1 cache, 0 if not - - - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerMultiprocessor`: Maximum - amount of shared memory available to a multiprocessor in bytes; this - amount is shared by all thread blocks simultaneously resident on a - multiprocessor - - - :py:obj:`~.cudaDevAttrMaxRegistersPerMultiprocessor`: Maximum number - of 32-bit registers available to a multiprocessor; this number is - shared by all thread blocks simultaneously resident on a - multiprocessor - - - :py:obj:`~.cudaDevAttrManagedMemory`: 1 if device supports allocating - managed memory, 0 if not - - - :py:obj:`~.cudaDevAttrIsMultiGpuBoard`: 1 if device is on a multi-GPU - board, 0 if not - - - :py:obj:`~.cudaDevAttrMultiGpuBoardGroupID`: Unique identifier for a - group of devices on the same multi-GPU board - - - :py:obj:`~.cudaDevAttrHostNativeAtomicSupported`: 1 if the link - between the device and the host supports native atomic operations - - - :py:obj:`~.cudaDevAttrSingleToDoublePrecisionPerfRatio`: Ratio of - single precision performance (in floating-point operations per - second) to double precision performance - - - :py:obj:`~.cudaDevAttrPageableMemoryAccess`: 1 if the device supports - coherently accessing pageable memory without calling cudaHostRegister - on it, and 0 otherwise - - - :py:obj:`~.cudaDevAttrConcurrentManagedAccess`: 1 if the device can - coherently access managed memory concurrently with the CPU, and 0 - otherwise - - - :py:obj:`~.cudaDevAttrComputePreemptionSupported`: 1 if the device - supports Compute Preemption, 0 if not - - - :py:obj:`~.cudaDevAttrCanUseHostPointerForRegisteredMem`: 1 if the - device can access host registered memory at the same virtual address - as the CPU, and 0 otherwise - - - :py:obj:`~.cudaDevAttrCooperativeLaunch`: 1 if the device supports - launching cooperative kernels via - :py:obj:`~.cudaLaunchCooperativeKernel`, and 0 otherwise - - - :py:obj:`~.cudaDevAttrCooperativeMultiDeviceLaunch`: 1 if the device - supports launching cooperative kernels via - :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice`, and 0 otherwise - - - :py:obj:`~.cudaDevAttrCanFlushRemoteWrites`: 1 if the device supports - flushing of outstanding remote writes, and 0 otherwise - - - :py:obj:`~.cudaDevAttrHostRegisterSupported`: 1 if the device - supports host memory registration via :py:obj:`~.cudaHostRegister`, - and 0 otherwise - - - :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`: 1 if - the device accesses pageable memory via the host's page tables, and 0 - otherwise - - - :py:obj:`~.cudaDevAttrDirectManagedMemAccessFromHost`: 1 if the host - can directly access managed memory on the device without migration, - and 0 otherwise - - - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`: Maximum per - block shared memory size on the device. This value can be opted into - when using :py:obj:`~.cudaFuncSetAttribute` - - - :py:obj:`~.cudaDevAttrMaxBlocksPerMultiprocessor`: Maximum number of - thread blocks that can reside on a multiprocessor - - - :py:obj:`~.cudaDevAttrMaxPersistingL2CacheSize`: Maximum L2 - persisting lines capacity setting in bytes - - - :py:obj:`~.cudaDevAttrMaxAccessPolicyWindowSize`: Maximum value of - :py:obj:`~.cudaAccessPolicyWindow.num_bytes` - - - :py:obj:`~.cudaDevAttrReservedSharedMemoryPerBlock`: Shared memory - reserved by CUDA driver per block in bytes - - - :py:obj:`~.cudaDevAttrSparseCudaArraySupported`: 1 if the device - supports sparse CUDA arrays and sparse CUDA mipmapped arrays. - - - :py:obj:`~.cudaDevAttrHostRegisterReadOnlySupported`: Device supports - using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly - to register memory that must be mapped as read-only to the GPU - - - :py:obj:`~.cudaDevAttrMemoryPoolsSupported`: 1 if the device supports - using the cudaMallocAsync and cudaMemPool family of APIs, and 0 - otherwise - - - :py:obj:`~.cudaDevAttrGPUDirectRDMASupported`: 1 if the device - supports GPUDirect RDMA APIs, and 0 otherwise - - - :py:obj:`~.cudaDevAttrGPUDirectRDMAFlushWritesOptions`: bitmask to be - interpreted according to the - :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum - - - :py:obj:`~.cudaDevAttrGPUDirectRDMAWritesOrdering`: see the - :py:obj:`~.cudaGPUDirectRDMAWritesOrdering` enum for numerical values - - - :py:obj:`~.cudaDevAttrMemoryPoolSupportedHandleTypes`: Bitmask of - handle types supported with mempool based IPC - - - :py:obj:`~.cudaDevAttrDeferredMappingCudaArraySupported` : 1 if the - device supports deferred mapping CUDA arrays and CUDA mipmapped - arrays. - - - :py:obj:`~.cudaDevAttrIpcEventSupport`: 1 if the device supports IPC - Events. - - - :py:obj:`~.cudaDevAttrNumaConfig`: NUMA configuration of a device: - value is of type :py:obj:`~.cudaDeviceNumaConfig` enum - - - :py:obj:`~.cudaDevAttrNumaId`: NUMA node ID of the GPU memory - - - :py:obj:`~.cudaDevAttrGpuPciDeviceId`: The combined 16-bit PCI device - ID and 16-bit PCI vendor ID. - - - :py:obj:`~.cudaDevAttrGpuPciSubsystemId`: The combined 16-bit PCI - subsystem ID and 16-bit PCI vendor subsystem ID. + `device`. Parameters ---------- @@ -19912,6 +19719,69 @@ def cudaDeviceGetAttribute(attr not None : cudaDeviceAttr, int device): return (_dict_cudaError_t[err], value) {{endif}} +{{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOperation] | List[cudaAtomicOperation]], unsigned int count, int device): + """ Queries details about atomic operations supported between the device and host. + + Returns in `*capabilities` the details about requested atomic + `*operations` over the the link between `dev` and the host. The + allocated size of `*operations` and `*capabilities` must be `count`. + + For each :py:obj:`~.cudaAtomicOperation` in `*operations`, the + corresponding result in `*capabilities` will be a bitmask indicating + which of :py:obj:`~.cudaAtomicOperationCapability` the link supports + natively. + + Returns :py:obj:`~.cudaErrorInvalidDevice` if `dev` is not valid. + + Returns :py:obj:`~.cudaErrorInvalidValue` if `*capabilities` or + `*operations` is NULL, if `count` is 0, or if any of `*operations` is + not valid. + + Parameters + ---------- + operations : List[:py:obj:`~.cudaAtomicOperation`] + Requested operations + count : unsigned int + Count of requested operations and size of capabilities + dev : int + Device handle + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` + capabilities : List[unsigned int] + Returned capability details of each requested operation + + See Also + -------- + :py:obj:`~.cudaDeviceGetAttribute`, :py:obj:`~.cudaDeviceGetP2PAtomicCapabilities`, :py:obj:`~.cuDeviceGeHostAtomicCapabilities` + """ + operations = [] if operations is None else operations + if not all(isinstance(_x, (cudaAtomicOperation)) for _x in operations): + raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cyruntime.cudaAtomicOperation] or List[cyruntime.cudaAtomicOperation]") + cdef unsigned int* cycapabilities = NULL + pycapabilities = [] + if count != 0: + cycapabilities = calloc(count, sizeof(unsigned int)) + if cycapabilities is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(count) + 'x' + str(sizeof(unsigned int))) + cdef vector[cyruntime.cudaAtomicOperation] cyoperations = [pyoperations.value for pyoperations in (operations)] + if count > len(operations): raise RuntimeError("List is too small: " + str(len(operations)) + " < " + str(count)) + with nogil: + err = cyruntime.cudaDeviceGetHostAtomicCapabilities(cycapabilities, cyoperations.data(), count, device) + if cudaError_t(err) == cudaError_t(0): + pycapabilities = [cycapabilities[idx] for idx in range(count)] + if cycapabilities is not NULL: + free(cycapabilities) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], pycapabilities) +{{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} @cython.embedsignature(True) @@ -20131,12 +20001,17 @@ def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, - :py:obj:`~.cudaDevP2PAttrAccessSupported`: 1 if peer access is enabled. - - :py:obj:`~.cudaDevP2PAttrNativeAtomicSupported`: 1 if native atomic - operations over the link are supported. + - :py:obj:`~.cudaDevP2PAttrNativeAtomicSupported`: 1 if all native + atomic operations over the link are supported. - :py:obj:`~.cudaDevP2PAttrCudaArrayAccessSupported`: 1 if accessing CUDA arrays over the link is supported. + - :py:obj:`~.cudaDevP2PAttrOnlyPartialNativeAtomicSupported`: 1 if some + CUDA-valid atomic operations over the link are supported. Information + about specific operations can be retrieved with + :py:obj:`~.cudaDeviceGetP2PAtomicCapabilities`. + Returns :py:obj:`~.cudaErrorInvalidDevice` if `srcDevice` or `dstDevice` are not valid or if they represent the same device. @@ -20162,7 +20037,7 @@ def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, See Also -------- - :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cudaDeviceDisablePeerAccess`, :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cuDeviceGetP2PAttribute` + :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cudaDeviceDisablePeerAccess`, :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cuDeviceGetP2PAttribute` :py:obj:`~.cudaDeviceGetP2PAtomicCapabilities` """ cdef int value = 0 cdef cyruntime.cudaDeviceP2PAttr cyattr = attr.value @@ -20173,6 +20048,73 @@ def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, return (_dict_cudaError_t[err], value) {{endif}} +{{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOperation] | List[cudaAtomicOperation]], unsigned int count, int srcDevice, int dstDevice): + """ Queries details about atomic operations supported between two devices. + + Returns in `*capabilities` the details about requested atomic + `*operations` over the the link between `srcDevice` and `dstDevice`. + The allocated size of `*operations` and `*capabilities` must be + `count`. + + For each :py:obj:`~.cudaAtomicOperation` in `*operations`, the + corresponding result in `*capabilities` will be a bitmask indicating + which of :py:obj:`~.cudaAtomicOperationCapability` the link supports + natively. + + Returns :py:obj:`~.cudaErrorInvalidDevice` if `srcDevice` or + `dstDevice` are not valid or if they represent the same device. + + Returns :py:obj:`~.cudaErrorInvalidValue` if `*capabilities` or + `*operations` is NULL, if `count` is 0, or if any of `*operations` is + not valid. + + Parameters + ---------- + operations : List[:py:obj:`~.cudaAtomicOperation`] + Requested operations + count : unsigned int + Count of requested operations and size of capabilities + srcDevice : int + The source device of the target link + dstDevice : int + The destination device of the target link + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` + capabilities : List[unsigned int] + Returned capability details of each requested operation + + See Also + -------- + :py:obj:`~.cudaDeviceGetP2PAttribute`, :py:obj:`~.cuDeviceGetP2PAttribute`, :py:obj:`~.cuDeviceGetP2PAtomicCapabilities` + """ + operations = [] if operations is None else operations + if not all(isinstance(_x, (cudaAtomicOperation)) for _x in operations): + raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cyruntime.cudaAtomicOperation] or List[cyruntime.cudaAtomicOperation]") + cdef unsigned int* cycapabilities = NULL + pycapabilities = [] + if count != 0: + cycapabilities = calloc(count, sizeof(unsigned int)) + if cycapabilities is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(count) + 'x' + str(sizeof(unsigned int))) + cdef vector[cyruntime.cudaAtomicOperation] cyoperations = [pyoperations.value for pyoperations in (operations)] + if count > len(operations): raise RuntimeError("List is too small: " + str(len(operations)) + " < " + str(count)) + with nogil: + err = cyruntime.cudaDeviceGetP2PAtomicCapabilities(cycapabilities, cyoperations.data(), count, srcDevice, dstDevice) + if cudaError_t(err) == cudaError_t(0): + pycapabilities = [cycapabilities[idx] for idx in range(count)] + if cycapabilities is not NULL: + free(cycapabilities) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], pycapabilities) +{{endif}} + {{if 'cudaChooseDevice' in found_functions}} @cython.embedsignature(True) @@ -21696,7 +21638,7 @@ def cudaStreamIsCapturing(stream): return (_dict_cudaError_t[err], cudaStreamCaptureStatus(pCaptureStatus)) {{endif}} -{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} +{{if 'cudaStreamGetCaptureInfo' in found_functions}} @cython.embedsignature(True) def cudaStreamGetCaptureInfo(stream): @@ -21713,90 +21655,6 @@ def cudaStreamGetCaptureInfo(stream): - the call returns cudaSuccess - - the returned capture status is - :py:obj:`~.cudaStreamCaptureStatusActive` - - Parameters - ---------- - stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - The stream to query - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorStreamCaptureImplicit` - captureStatus_out : :py:obj:`~.cudaStreamCaptureStatus` - Location to return the capture status of the stream; required - id_out : unsigned long long - Optional location to return an id for the capture sequence, which - is unique over the lifetime of the process - graph_out : :py:obj:`~.cudaGraph_t` - Optional location to return the graph being captured into. All - operations other than destroy and node removal are permitted on the - graph while the capture sequence is in progress. This API does not - transfer ownership of the graph, which is transferred or destroyed - at :py:obj:`~.cudaStreamEndCapture`. Note that the graph handle may - be invalidated before end of capture for certain errors. Nodes that - are or become unreachable from the original stream at - :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph - do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. - dependencies_out : List[:py:obj:`~.cudaGraphNode_t`] - Optional location to store a pointer to an array of nodes. The next - node to be captured in the stream will depend on this set of nodes, - absent operations such as event wait which modify this set. The - array pointer is valid until the next API call which operates on - the stream or until the capture is terminated. The node handles may - be copied out and are valid until they or the graph is destroyed. - The driver-owned array may also be passed directly to APIs that - operate on the graph (not the stream) without copying. - numDependencies_out : int - Optional location to store the size of the array returned in - dependencies_out. - - See Also - -------- - :py:obj:`~.cudaStreamGetCaptureInfo_v3`, :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamUpdateCaptureDependencies` - """ - cdef cyruntime.cudaStream_t cystream - if stream is None: - pstream = 0 - elif isinstance(stream, (cudaStream_t,driver.CUstream)): - pstream = int(stream) - else: - pstream = int(cudaStream_t(stream)) - cystream = pstream - cdef cyruntime.cudaStreamCaptureStatus captureStatus_out - cdef unsigned long long id_out = 0 - cdef cudaGraph_t graph_out = cudaGraph_t() - cdef const cyruntime.cudaGraphNode_t* cydependencies_out = NULL - pydependencies_out = [] - cdef size_t numDependencies_out = 0 - with nogil: - err = cyruntime.cudaStreamGetCaptureInfo(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) - if cudaError_t(err) == cudaError_t(0): - pydependencies_out = [cudaGraphNode_t(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None, None, None) - return (_dict_cudaError_t[err], cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) -{{endif}} - -{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} - -@cython.embedsignature(True) -def cudaStreamGetCaptureInfo_v3(stream): - """ Query a stream's capture state (12.3+) - - Query stream state related to stream capture. - - If called on :py:obj:`~.cudaStreamLegacy` (the "null stream") while a - stream not created with :py:obj:`~.cudaStreamNonBlocking` is capturing, - returns :py:obj:`~.cudaErrorStreamCaptureImplicit`. - - Valid data (other than capture status) is returned only if both of the - following are true: - - - the call returns cudaSuccess - - the returned capture status is :py:obj:`~.cudaStreamCaptureStatusActive` @@ -21870,7 +21728,7 @@ def cudaStreamGetCaptureInfo_v3(stream): pyedgeData_out = [] cdef size_t numDependencies_out = 0 with nogil: - err = cyruntime.cudaStreamGetCaptureInfo_v3(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) + err = cyruntime.cudaStreamGetCaptureInfo(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) if cudaError_t(err) == cudaError_t(0): pydependencies_out = [cudaGraphNode_t(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] if cudaError_t(err) == cudaError_t(0): @@ -21883,84 +21741,8 @@ def cudaStreamGetCaptureInfo_v3(stream): {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} @cython.embedsignature(True) -def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, unsigned int flags): - """ Update the set of dependencies in a capturing stream (11.3+) - - Modifies the dependency set of a capturing stream. The dependency set - is the set of nodes that the next captured node in the stream will - depend on. - - Valid flags are :py:obj:`~.cudaStreamAddCaptureDependencies` and - :py:obj:`~.cudaStreamSetCaptureDependencies`. These control whether the - set passed to the API is added to the existing set or replaces it. A - flags value of 0 defaults to - :py:obj:`~.cudaStreamAddCaptureDependencies`. - - Nodes that are removed from the dependency set via this API do not - result in :py:obj:`~.cudaErrorStreamCaptureUnjoined` if they are - unreachable from the stream at :py:obj:`~.cudaStreamEndCapture`. - - Returns :py:obj:`~.cudaErrorIllegalState` if the stream is not - capturing. - - This API is new in CUDA 11.3. Developers requiring compatibility across - minor versions of the CUDA driver to 11.0 should not use this API or - provide a fallback. - - Parameters - ---------- - stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - The stream to update - dependencies : List[:py:obj:`~.cudaGraphNode_t`] - The set of dependencies to add - numDependencies : size_t - The size of the dependencies array - flags : unsigned int - See above - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorIllegalState` - - See Also - -------- - :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamGetCaptureInfo`, - """ - dependencies = [] if dependencies is None else dependencies - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - cdef cyruntime.cudaStream_t cystream - if stream is None: - pstream = 0 - elif isinstance(stream, (cudaStream_t,driver.CUstream)): - pstream = int(stream) - else: - pstream = int(cudaStream_t(stream)) - cystream = pstream - cdef cyruntime.cudaGraphNode_t* cydependencies = NULL - if len(dependencies) > 1: - cydependencies = calloc(len(dependencies), sizeof(cyruntime.cudaGraphNode_t)) - if cydependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(dependencies)): - cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] - elif len(dependencies) == 1: - cydependencies = (dependencies[0])._pvt_ptr - if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - with nogil: - err = cyruntime.cudaStreamUpdateCaptureDependencies(cystream, cydependencies, numDependencies, flags) - if len(dependencies) > 1 and cydependencies is not NULL: - free(cydependencies) - return (_dict_cudaError_t[err],) -{{endif}} - -{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): - """ Update the set of dependencies in a capturing stream (12.3+) +def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream. Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the stream will @@ -22035,7 +21817,7 @@ def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[Tuple elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr with nogil: - err = cyruntime.cudaStreamUpdateCaptureDependencies_v2(cystream, cydependencies, cydependencyData, numDependencies, flags) + err = cyruntime.cudaStreamUpdateCaptureDependencies(cystream, cydependencies, cydependencyData, numDependencies, flags) if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: @@ -22386,75 +22168,6 @@ def cudaEventDestroy(event): def cudaEventElapsedTime(start, end): """ Computes the elapsed time between events. - Computes the elapsed time between two events (in milliseconds with a - resolution of around 0.5 microseconds). - - If either event was last recorded in a non-NULL stream, the resulting - time may be greater than expected (even if both used the same stream - handle). This happens because the :py:obj:`~.cudaEventRecord()` - operation takes place asynchronously and there is no guarantee that the - measured latency is actually just between the two events. Any number of - other different stream operations could execute in between the two - measured events, thus altering the timing in a significant way. - - If :py:obj:`~.cudaEventRecord()` has not been called on either event, - then :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. If - :py:obj:`~.cudaEventRecord()` has been called on both events but one or - both of them has not yet been completed (that is, - :py:obj:`~.cudaEventQuery()` would return :py:obj:`~.cudaErrorNotReady` - on at least one of the events), :py:obj:`~.cudaErrorNotReady` is - returned. If either event was created with the - :py:obj:`~.cudaEventDisableTiming` flag, then this function will return - :py:obj:`~.cudaErrorInvalidResourceHandle`. - - Parameters - ---------- - start : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` - Starting event - end : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` - Ending event - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorUnknown` - ms : float - Time between `start` and `end` in ms - - See Also - -------- - :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cuEventElapsedTime` - """ - cdef cyruntime.cudaEvent_t cyend - if end is None: - pend = 0 - elif isinstance(end, (cudaEvent_t,driver.CUevent)): - pend = int(end) - else: - pend = int(cudaEvent_t(end)) - cyend = pend - cdef cyruntime.cudaEvent_t cystart - if start is None: - pstart = 0 - elif isinstance(start, (cudaEvent_t,driver.CUevent)): - pstart = int(start) - else: - pstart = int(cudaEvent_t(start)) - cystart = pstart - cdef float ms = 0 - with nogil: - err = cyruntime.cudaEventElapsedTime(&ms, cystart, cyend) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ms) -{{endif}} - -{{if 'cudaEventElapsedTime_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaEventElapsedTime_v2(start, end): - """ Computes the elapsed time between events. - Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). Note this API is not guaranteed to return the latest errors for pending work. As such this API is @@ -22516,7 +22229,7 @@ def cudaEventElapsedTime_v2(start, end): cystart = pstart cdef float ms = 0 with nogil: - err = cyruntime.cudaEventElapsedTime_v2(&ms, cystart, cyend) + err = cyruntime.cudaEventElapsedTime(&ms, cystart, cyend) if err != cyruntime.cudaSuccess: return (_dict_cudaError_t[err], None) return (_dict_cudaError_t[err], ms) @@ -23003,7 +22716,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa return (_dict_cudaError_t[err], extSem_out) {{endif}} -{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreSignalParams] | List[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): @@ -23072,6 +22785,22 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS with deterministic fence support enabled in different streams or by adding explicit dependency amongst such streams so that the semaphore is signaled in order. + :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::nvSciSync::fence + associated with semaphore object of the type + :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync` can be timestamp + enabled. For this the NvSciSyncAttrList used to create the object must + have the value of NvSciSyncAttrKey_WaiterRequireTimestamps key set to + true. Timestamps are emitted asynchronously by the GPU and CUDA saves + the GPU timestamp in the corresponding NvSciSyncFence at the time of + signal on GPU. Users are expected to convert GPU clocks to CPU clocks + using appropriate scaling functions. Users are expected to wait for the + completion of the fence before extracting timestamp using appropriate + NvSciSync APIs. Users are expected to ensure that there is only one + outstanding timestamp enabled fence per Cuda-NvSciSync object at any + point of time, failing which leads to undefined behavior. Extracting + the timestamp before the corresponding fence is signalled could lead to + undefined behaviour. Timestamp extracted via appropriate NvSciSync API + would be in microseconds. If the semaphore object is any one of the following types: :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutex`, @@ -23143,7 +22872,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS return (_dict_cudaError_t[err],) {{endif}} -{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} +{{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreWaitParams] | List[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): @@ -26200,10 +25929,6 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. - If any error is encountered while parsing the batch, the index within - the batch where the error was encountered will be returned in - `failIdx`. - Parameters ---------- dsts : List[Any] @@ -26232,10 +25957,6 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona ------- cudaError_t :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` - failIdx : int - Pointer to a location to return the index of the copy where a - failure was encountered. The value will be SIZE_MAX if the error - doesn't pertain to any specific copy. """ cdef cyruntime.cudaStream_t cystream if stream is None: @@ -26256,10 +25977,10 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona dsts = [] if dsts is None else dsts pylist = [utils.HelperInputVoidPtr(pydsts) for pydsts in dsts] cdef utils.InputVoidPtrPtrHelper voidStarHelperdsts = utils.InputVoidPtrPtrHelper(pylist) - cdef void** cydsts_ptr = voidStarHelperdsts.cptr + cdef const void** cydsts_ptr = voidStarHelperdsts.cptr pylist = [utils.HelperInputVoidPtr(pysrcs) for pysrcs in srcs] cdef utils.InputVoidPtrPtrHelper voidStarHelpersrcs = utils.InputVoidPtrPtrHelper(pylist) - cdef void** cysrcs_ptr = voidStarHelpersrcs.cptr + cdef const void** cysrcs_ptr = voidStarHelpersrcs.cptr cdef vector[size_t] cysizes = sizes if count > len(dsts): raise RuntimeError("List is too small: " + str(len(dsts)) + " < " + str(count)) if count > len(srcs): raise RuntimeError("List is too small: " + str(len(srcs)) + " < " + str(count)) @@ -26276,14 +25997,11 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona cdef vector[size_t] cyattrsIdxs = attrsIdxs if numAttrs > len(attrs): raise RuntimeError("List is too small: " + str(len(attrs)) + " < " + str(numAttrs)) if numAttrs > len(attrsIdxs): raise RuntimeError("List is too small: " + str(len(attrsIdxs)) + " < " + str(numAttrs)) - cdef size_t failIdx = 0 with nogil: - err = cyruntime.cudaMemcpyBatchAsync(cydsts_ptr, cysrcs_ptr, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, &failIdx, cystream) + err = cyruntime.cudaMemcpyBatchAsync(cydsts_ptr, cysrcs_ptr, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, cystream) if len(attrs) > 1 and cyattrs is not NULL: free(cyattrs) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], failIdx) + return (_dict_cudaError_t[err],) {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} @@ -26371,10 +26089,6 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. - If any error is encountered while parsing the batch, the index within - the batch where the error was encountered will be returned in - `failIdx`. - Parameters ---------- numOps : size_t @@ -26391,10 +26105,6 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa ------- cudaError_t :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` - failIdx : int - Pointer to a location to return the index of the copy where a - failure was encountered. The value will be SIZE_MAX if the error - doesn't pertain to any specific copy. """ cdef cyruntime.cudaStream_t cystream if stream is None: @@ -26417,14 +26127,11 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa string.memcpy(&cyopList[idx], (opList[idx])._pvt_ptr, sizeof(cyruntime.cudaMemcpy3DBatchOp)) elif len(opList) == 1: cyopList = (opList[0])._pvt_ptr - cdef size_t failIdx = 0 with nogil: - err = cyruntime.cudaMemcpy3DBatchAsync(numOps, cyopList, &failIdx, flags, cystream) + err = cyruntime.cudaMemcpy3DBatchAsync(numOps, cyopList, flags, cystream) if len(opList) > 1 and cyopList is not NULL: free(cyopList) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], failIdx) + return (_dict_cudaError_t[err],) {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -27004,106 +26711,7 @@ def cudaMemset3DAsync(pitchedDevPtr not None : cudaPitchedPtr, int value, extent {{if 'cudaMemPrefetchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemPrefetchAsync(devPtr, size_t count, int dstDevice, stream): - """ Prefetches memory to the specified destination device. - - Prefetches memory to the specified destination device. `devPtr` is the - base device pointer of the memory to be prefetched and `dstDevice` is - the destination device. `count` specifies the number of bytes to copy. - `stream` is the stream in which the operation is enqueued. The memory - range must refer to managed memory allocated via - :py:obj:`~.cudaMallocManaged` or declared via managed variables, or it - may also refer to system-allocated memory on systems with non-zero - cudaDevAttrPageableMemoryAccess. - - Passing in cudaCpuDeviceId for `dstDevice` will prefetch the data to - host memory. If `dstDevice` is a GPU, then the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess` must be non-zero. - Additionally, `stream` must be associated with a device that has a non- - zero value for the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. - - The start address and end address of the memory range will be rounded - down and rounded up respectively to be aligned to CPU page size before - the prefetch operation is enqueued in the stream. - - If no physical memory has been allocated for this region, then this - memory region will be populated and mapped on the destination device. - If there's insufficient memory to prefetch the desired region, the - Unified Memory driver may evict pages from other - :py:obj:`~.cudaMallocManaged` allocations to host memory in order to - make room. Device memory allocated using :py:obj:`~.cudaMalloc` or - :py:obj:`~.cudaMallocArray` will not be evicted. - - By default, any mappings to the previous location of the migrated pages - are removed and mappings for the new location are only setup on - `dstDevice`. The exact behavior however also depends on the settings - applied to this memory range via :py:obj:`~.cudaMemAdvise` as described - below: - - If :py:obj:`~.cudaMemAdviseSetReadMostly` was set on any subset of this - memory range, then that subset will create a read-only copy of the - pages on `dstDevice`. - - If :py:obj:`~.cudaMemAdviseSetPreferredLocation` was called on any - subset of this memory range, then the pages will be migrated to - `dstDevice` even if `dstDevice` is not the preferred location of any - pages in the memory range. - - If :py:obj:`~.cudaMemAdviseSetAccessedBy` was called on any subset of - this memory range, then mappings to those pages from all the - appropriate processors are updated to refer to the new location if - establishing such a mapping is possible. Otherwise, those mappings are - cleared. - - Note that this API is not required for functionality and only serves to - improve performance by allowing the application to migrate data to a - suitable location before it is accessed. Memory accesses to this range - are always coherent and are allowed even when the data is actively - being migrated. - - Note that this function is asynchronous with respect to the host and - all work on other devices. - - Parameters - ---------- - devPtr : Any - Pointer to be prefetched - count : size_t - Size in bytes - dstDevice : int - Destination device to prefetch to - stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` - Stream to enqueue prefetch operation - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` - - See Also - -------- - :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cudaMemAdvise_v2` :py:obj:`~.cuMemPrefetchAsync` - """ - cdef cyruntime.cudaStream_t cystream - if stream is None: - pstream = 0 - elif isinstance(stream, (cudaStream_t,driver.CUstream)): - pstream = int(stream) - else: - pstream = int(cudaStream_t(stream)) - cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) - cdef void* cydevPtr_ptr = cydevPtr.cptr - with nogil: - err = cyruntime.cudaMemPrefetchAsync(cydevPtr_ptr, count, dstDevice, cystream) - return (_dict_cudaError_t[err],) -{{endif}} - -{{if 'cudaMemPrefetchAsync_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaMemPrefetchAsync_v2(devPtr, size_t count, location not None : cudaMemLocation, unsigned int flags, stream): +def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocation, unsigned int flags, stream): """ Prefetches memory to the specified destination location. Prefetches memory to the specified destination location. `devPtr` is @@ -27200,7 +26808,7 @@ def cudaMemPrefetchAsync_v2(devPtr, size_t count, location not None : cudaMemLoc See Also -------- - :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cudaMemAdvise_v2` :py:obj:`~.cuMemPrefetchAsync` + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cuMemPrefetchAsync` """ cdef cyruntime.cudaStream_t cystream if stream is None: @@ -27213,180 +26821,314 @@ def cudaMemPrefetchAsync_v2(devPtr, size_t count, location not None : cudaMemLoc cydevPtr = utils.HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: - err = cyruntime.cudaMemPrefetchAsync_v2(cydevPtr_ptr, count, location._pvt_ptr[0], flags, cystream) + err = cyruntime.cudaMemPrefetchAsync(cydevPtr_ptr, count, location._pvt_ptr[0], flags, cystream) return (_dict_cudaError_t[err],) {{endif}} -{{if 'cudaMemAdvise' in found_functions}} +{{if 'cudaMemPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, int device): - """ Advise about the usage of a given memory range. +def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[cudaMemLocation] | List[cudaMemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, stream): + """ Performs a batch of memory prefetches asynchronously. - Advise the Unified Memory subsystem about the usage pattern for the - memory range starting at `devPtr` with a size of `count` bytes. The - start address and end address of the memory range will be rounded down - and rounded up respectively to be aligned to CPU page size before the - advice is applied. The memory range must refer to managed memory + Performs a batch of memory prefetches. The batch as a whole executes in + stream order but operations within a batch are not guaranteed to + execute in any specific order. All devices in the system must have a + non-zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` otherwise the API will + return an error. + + The semantics of the individual prefetch operations are as described in + :py:obj:`~.cudaMemPrefetchAsync`. + + Performs memory prefetch on address ranges specified in `dptrs` and + `sizes`. Both arrays must be of the same length as specified by + `count`. Each memory range specified must refer to managed memory allocated via :py:obj:`~.cudaMallocManaged` or declared via managed - variables. The memory range could also refer to system-allocated - pageable memory provided it represents a valid, host-accessible region - of memory and all additional constraints imposed by `advice` as - outlined below are also satisfied. Specifying an invalid system- - allocated pageable memory range results in an error being returned. + variables or it may also refer to system-allocated memory when all + devices have a non-zero value for + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. The prefetch location for + every operation in the batch is specified in the `prefetchLocs` array. + Each entry in this array can apply to more than one operation. This can + be done by specifying in the `prefetchLocIdxs` array, the index of the + first prefetch operation that the corresponding entry in the + `prefetchLocs` array applies to. Both `prefetchLocs` and + `prefetchLocIdxs` must be of the same length as specified by + `numPrefetchLocs`. For example, if a batch has 10 prefetches listed in + dptrs/sizes, the first 4 of which are to be prefetched to one location + and the remaining 6 are to be prefetched to another, then + `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 4} and + `prefetchLocs` will contain the two locations. Note the first entry in + `prefetchLocIdxs` must always be 0. Also, each entry must be greater + than the previous entry and the last entry should be less than `count`. + Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`. + + Parameters + ---------- + dptrs : List[Any] + Array of pointers to be prefetched + sizes : List[int] + Array of sizes for memory prefetch operations. + count : size_t + Size of `dptrs` and `sizes` arrays. + prefetchLocs : List[:py:obj:`~.cudaMemLocation`] + Array of locations to prefetch to. + prefetchLocIdxs : List[int] + Array of indices to specify which operands each entry in the + `prefetchLocs` array applies to. The locations specified in + prefetchLocs[k] will be applied to copies starting from + prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also + prefetchLocs[numPrefetchLocs - 1] will apply to prefetches starting + from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. + numPrefetchLocs : size_t + Size of `prefetchLocs` and `prefetchLocIdxs` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. - The `advice` parameter can take the following values: + Returns + ------- + cudaError_t - - :py:obj:`~.cudaMemAdviseSetReadMostly`: This implies that the data is - mostly going to be read from and only occasionally written to. Any - read accesses from any processor to this region will create a read- - only copy of at least the accessed pages in that processor's memory. - Additionally, if :py:obj:`~.cudaMemPrefetchAsync` is called on this - region, it will create a read-only copy of the data on the - destination processor. If any processor writes to this region, all - copies of the corresponding page will be invalidated except for the - one where the write occurred. The `device` argument is ignored for - this advice. Note that for a page to be read-duplicated, the - accessing processor must either be the CPU or a GPU that has a non- - zero value for the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Also, if a context is - created on a device that does not have the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess` set, then read- - duplication will not occur until all such contexts are destroyed. If - the memory region refers to valid system-allocated pageable memory, - then the accessing device must have a non-zero value for the device - attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess` for a read-only - copy to be created on that device. Note however that if the accessing - device also has a non-zero value for the device attribute - :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then - setting this advice will not create a read-only copy when that device - accesses this memory region. + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + prefetchLocs = [] if prefetchLocs is None else prefetchLocs + if not all(isinstance(_x, (cudaMemLocation,)) for _x in prefetchLocs): + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cyruntime.cudaMemLocation,] or List[cyruntime.cudaMemLocation,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cyruntime.cudaMemLocation* cyprefetchLocs = NULL + if len(prefetchLocs) > 1: + cyprefetchLocs = calloc(len(prefetchLocs), sizeof(cyruntime.cudaMemLocation)) + if cyprefetchLocs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(prefetchLocs)) + 'x' + str(sizeof(cyruntime.cudaMemLocation))) + for idx in range(len(prefetchLocs)): + string.memcpy(&cyprefetchLocs[idx], (prefetchLocs[idx])._pvt_ptr, sizeof(cyruntime.cudaMemLocation)) + elif len(prefetchLocs) == 1: + cyprefetchLocs = (prefetchLocs[0])._pvt_ptr + cdef vector[size_t] cyprefetchLocIdxs = prefetchLocIdxs + if numPrefetchLocs > len(prefetchLocs): raise RuntimeError("List is too small: " + str(len(prefetchLocs)) + " < " + str(numPrefetchLocs)) + if numPrefetchLocs > len(prefetchLocIdxs): raise RuntimeError("List is too small: " + str(len(prefetchLocIdxs)) + " < " + str(numPrefetchLocs)) + with nogil: + err = cyruntime.cudaMemPrefetchBatchAsync(cydptrs_ptr, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cystream) + if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: + free(cyprefetchLocs) + return (_dict_cudaError_t[err],) +{{endif}} - - :py:obj:`~.cudaMemAdviceUnsetReadMostly`: Undoes the effect of - :py:obj:`~.cudaMemAdviceReadMostly` and also prevents the Unified - Memory driver from attempting heuristic read-duplication on the - memory range. Any read-duplicated copies of the data will be - collapsed into a single copy. The location for the collapsed copy - will be the preferred location if the page has a preferred location - and one of the read-duplicated copies was resident at that location. - Otherwise, the location chosen is arbitrary. +{{if 'cudaMemDiscardBatchAsync' in found_functions}} - - :py:obj:`~.cudaMemAdviseSetPreferredLocation`: This advice sets the - preferred location for the data to be the memory belonging to - `device`. Passing in cudaCpuDeviceId for `device` sets the preferred - location as host memory. If `device` is a GPU, then it must have a - non-zero value for the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Setting the preferred - location does not cause data to migrate to that location immediately. - Instead, it guides the migration policy when a fault occurs on that - memory region. If the data is already in its preferred location and - the faulting processor can establish a mapping without requiring the - data to be migrated, then data migration will be avoided. On the - other hand, if the data is not in its preferred location or if a - direct mapping cannot be established, then it will be migrated to the - processor accessing it. It is important to note that setting the - preferred location does not prevent data prefetching done using - :py:obj:`~.cudaMemPrefetchAsync`. Having a preferred location can - override the page thrash detection and resolution logic in the - Unified Memory driver. Normally, if a page is detected to be - constantly thrashing between for example host and device memory, the - page may eventually be pinned to host memory by the Unified Memory - driver. But if the preferred location is set as device memory, then - the page will continue to thrash indefinitely. If - :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory - region or any subset of it, then the policies associated with that - advice will override the policies of this advice, unless read - accesses from `device` will not result in a read-only copy being - created on that device as outlined in description for the advice - :py:obj:`~.cudaMemAdviseSetReadMostly`. If the memory region refers - to valid system-allocated pageable memory, then `device` must have a - non-zero value for the device attribute - :py:obj:`~.cudaDevAttrPageableMemoryAccess`. +@cython.embedsignature(True) +def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, unsigned long long flags, stream): + """ Performs a batch of memory discards asynchronously. - - :py:obj:`~.cudaMemAdviseUnsetPreferredLocation`: Undoes the effect of - :py:obj:`~.cudaMemAdviseSetPreferredLocation` and changes the - preferred location to none. + Performs a batch of memory discards. The batch as a whole executes in + stream order but operations within a batch are not guaranteed to + execute in any specific order. All devices in the system must have a + non-zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` otherwise the API will + return an error. - - :py:obj:`~.cudaMemAdviseSetAccessedBy`: This advice implies that the - data will be accessed by `device`. Passing in - :py:obj:`~.cudaCpuDeviceId` for `device` will set the advice for the - CPU. If `device` is a GPU, then the device attribute - :py:obj:`~.cudaDevAttrConcurrentManagedAccess` must be non-zero. This - advice does not cause data migration and has no impact on the - location of the data per se. Instead, it causes the data to always be - mapped in the specified processor's page tables, as long as the - location of the data permits a mapping to be established. If the data - gets migrated for any reason, the mappings are updated accordingly. - This advice is recommended in scenarios where data locality is not - important, but avoiding faults is. Consider for example a system - containing multiple GPUs with peer-to-peer access enabled, where the - data located on one GPU is occasionally accessed by peer GPUs. In - such scenarios, migrating data over to the other GPUs is not as - important because the accesses are infrequent and the overhead of - migration may be too high. But preventing faults can still help - improve performance, and so having a mapping set up in advance is - useful. Note that on CPU access of this data, the data may be - migrated to host memory because the CPU typically cannot access - device memory directly. Any GPU that had the - :py:obj:`~.cudaMemAdviceSetAccessedBy` flag set for this data will - now have its mapping updated to point to the page in host memory. If - :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory - region or any subset of it, then the policies associated with that - advice will override the policies of this advice. Additionally, if - the preferred location of this memory region or any subset of it is - also `device`, then the policies associated with - :py:obj:`~.cudaMemAdviseSetPreferredLocation` will override the - policies of this advice. If the memory region refers to valid system- - allocated pageable memory, then `device` must have a non-zero value - for the device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. - Additionally, if `device` has a non-zero value for the device - attribute - :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then - this call has no effect. + Discarding a memory range informs the driver that the contents of that + range are no longer useful. Discarding memory ranges allows the driver + to optimize certain data migrations and can also help reduce memory + pressure. This operation can be undone on any part of the range by + either writing to it or prefetching it via + :py:obj:`~.cudaMemPrefetchAsync` or + :py:obj:`~.cudaMemPrefetchBatchAsync`. Reading from a discarded range, + without a subsequent write or prefetch to that part of the range, will + return an indeterminate value. Note that any reads, writes or + prefetches to any part of the memory range that occur simultaneously + with the discard operation result in undefined behavior. - - :py:obj:`~.cudaMemAdviseUnsetAccessedBy`: Undoes the effect of - :py:obj:`~.cudaMemAdviseSetAccessedBy`. Any mappings to the data from - `device` may be removed at any time causing accesses to result in - non-fatal page faults. If the memory region refers to valid system- - allocated pageable memory, then `device` must have a non-zero value - for the device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. - Additionally, if `device` has a non-zero value for the device - attribute - :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then - this call has no effect. + Performs memory discard on address ranges specified in `dptrs` and + `sizes`. Both arrays must be of the same length as specified by + `count`. Each memory range specified must refer to managed memory + allocated via :py:obj:`~.cudaMallocManaged` or declared via managed + variables or it may also refer to system-allocated memory when all + devices have a non-zero value for + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. Parameters ---------- - devPtr : Any - Pointer to memory to set the advice for + dptrs : List[Any] + Array of pointers to be discarded + sizes : List[int] + Array of sizes for memory discard operations. count : size_t - Size in bytes of the memory range - advice : :py:obj:`~.cudaMemoryAdvise` - Advice to be applied for the specified memory range - device : int - Device to apply the advice for + Size of `dptrs` and `sizes` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` - See Also - -------- - :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) - cdef void* cydevPtr_ptr = cydevPtr.cptr - cdef cyruntime.cudaMemoryAdvise cyadvice = advice.value + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) with nogil: - err = cyruntime.cudaMemAdvise(cydevPtr_ptr, count, cyadvice, device) + err = cyruntime.cudaMemDiscardBatchAsync(cydptrs_ptr, cysizes.data(), count, flags, cystream) return (_dict_cudaError_t[err],) {{endif}} -{{if 'cudaMemAdvise_v2' in found_functions}} +{{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemAdvise_v2(devPtr, size_t count, advice not None : cudaMemoryAdvise, location not None : cudaMemLocation): +def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[cudaMemLocation] | List[cudaMemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, stream): + """ Performs a batch of memory discards and prefetches asynchronously. + + Performs a batch of memory discards followed by prefetches. The batch + as a whole executes in stream order but operations within a batch are + not guaranteed to execute in any specific order. All devices in the + system must have a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` otherwise the API will + return an error. + + Calling :py:obj:`~.cudaMemDiscardAndPrefetchBatchAsync` is semantically + equivalent to calling :py:obj:`~.cudaMemDiscardBatchAsync` followed by + :py:obj:`~.cudaMemPrefetchBatchAsync`, but is more optimal. For more + details on what discarding and prefetching imply, please refer to + :py:obj:`~.cudaMemDiscardBatchAsync` and + :py:obj:`~.cudaMemPrefetchBatchAsync` respectively. Note that any + reads, writes or prefetches to any part of the memory range that occur + simultaneously with this combined discard+prefetch operation result in + undefined behavior. + + Performs memory discard and prefetch on address ranges specified in + `dptrs` and `sizes`. Both arrays must be of the same length as + specified by `count`. Each memory range specified must refer to managed + memory allocated via :py:obj:`~.cudaMallocManaged` or declared via + managed variables or it may also refer to system-allocated memory when + all devices have a non-zero value for + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. Every operation in the + batch has to be associated with a valid location to prefetch the + address range to and specified in the `prefetchLocs` array. Each entry + in this array can apply to more than one operation. This can be done by + specifying in the `prefetchLocIdxs` array, the index of the first + operation that the corresponding entry in the `prefetchLocs` array + applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the + same length as specified by `numPrefetchLocs`. For example, if a batch + has 10 operations listed in dptrs/sizes, the first 6 of which are to be + prefetched to one location and the remaining 4 are to be prefetched to + another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be + {0, 6} and `prefetchLocs` will contain the two set of locations. Note + the first entry in `prefetchLocIdxs` must always be 0. Also, each entry + must be greater than the previous entry and the last entry should be + less than `count`. Furthermore, `numPrefetchLocs` must be lesser than + or equal to `count`. + + Parameters + ---------- + dptrs : List[Any] + Array of pointers to be discarded + sizes : List[int] + Array of sizes for memory discard operations. + count : size_t + Size of `dptrs` and `sizes` arrays. + prefetchLocs : List[:py:obj:`~.cudaMemLocation`] + Array of locations to prefetch to. + prefetchLocIdxs : List[int] + Array of indices to specify which operands each entry in the + `prefetchLocs` array applies to. The locations specified in + prefetchLocs[k] will be applied to operations starting from + prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also + prefetchLocs[numPrefetchLocs - 1] will apply to copies starting + from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. + numPrefetchLocs : size_t + Size of `prefetchLocs` and `prefetchLocIdxs` arrays. + flags : unsigned long long + Flags reserved for future use. Must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + cudaError_t + + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + prefetchLocs = [] if prefetchLocs is None else prefetchLocs + if not all(isinstance(_x, (cudaMemLocation,)) for _x in prefetchLocs): + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cyruntime.cudaMemLocation,] or List[cyruntime.cudaMemLocation,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + dptrs = [] if dptrs is None else dptrs + pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr + cdef vector[size_t] cysizes = sizes + if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cyruntime.cudaMemLocation* cyprefetchLocs = NULL + if len(prefetchLocs) > 1: + cyprefetchLocs = calloc(len(prefetchLocs), sizeof(cyruntime.cudaMemLocation)) + if cyprefetchLocs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(prefetchLocs)) + 'x' + str(sizeof(cyruntime.cudaMemLocation))) + for idx in range(len(prefetchLocs)): + string.memcpy(&cyprefetchLocs[idx], (prefetchLocs[idx])._pvt_ptr, sizeof(cyruntime.cudaMemLocation)) + elif len(prefetchLocs) == 1: + cyprefetchLocs = (prefetchLocs[0])._pvt_ptr + cdef vector[size_t] cyprefetchLocIdxs = prefetchLocIdxs + if numPrefetchLocs > len(prefetchLocs): raise RuntimeError("List is too small: " + str(len(prefetchLocs)) + " < " + str(numPrefetchLocs)) + if numPrefetchLocs > len(prefetchLocIdxs): raise RuntimeError("List is too small: " + str(len(prefetchLocIdxs)) + " < " + str(numPrefetchLocs)) + with nogil: + err = cyruntime.cudaMemDiscardAndPrefetchBatchAsync(cydptrs_ptr, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cystream) + if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: + free(cyprefetchLocs) + return (_dict_cudaError_t[err],) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +@cython.embedsignature(True) +def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, location not None : cudaMemLocation): """ Advise about the usage of a given memory range. Advise the Unified Memory subsystem about the usage pattern for the @@ -27408,9 +27150,9 @@ def cudaMemAdvise_v2(devPtr, size_t count, advice not None : cudaMemoryAdvise, l read accesses from any processor to this region will create a read- only copy of at least the accessed pages in that processor's memory. Additionally, if :py:obj:`~.cudaMemPrefetchAsync` or - :py:obj:`~.cudaMemPrefetchAsync_v2` is called on this region, it will + :py:obj:`~.cudaMemPrefetchAsync` is called on this region, it will create a read-only copy of the data on the destination processor. If - the target location for :py:obj:`~.cudaMemPrefetchAsync_v2` is a host + the target location for :py:obj:`~.cudaMemPrefetchAsync` is a host NUMA node and a read-only copy already exists on another host NUMA node, that copy will be migrated to the targeted host NUMA node. If any processor writes to this region, all copies of the corresponding @@ -27570,13 +27312,13 @@ def cudaMemAdvise_v2(devPtr, size_t count, advice not None : cudaMemoryAdvise, l See Also -------- - :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemAdvise_v2` + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise` """ cydevPtr = utils.HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr cdef cyruntime.cudaMemoryAdvise cyadvice = advice.value with nogil: - err = cyruntime.cudaMemAdvise_v2(cydevPtr_ptr, count, cyadvice, location._pvt_ptr[0]) + err = cyruntime.cudaMemAdvise(cydevPtr_ptr, count, cyadvice, location._pvt_ptr[0]) return (_dict_cudaError_t[err],) {{endif}} @@ -28569,20 +28311,28 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): `poolProps` determines the properties of the pool such as the backing device and IPC capabilities. - To create a memory pool targeting a specific host NUMA node, - applications must set + To create a memory pool for host memory not targeting a specific NUMA + node, applications must set set + :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::type to + :py:obj:`~.cudaMemLocationTypeHost`. + :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::id is ignored for such + pools. Pools created with the type :py:obj:`~.cudaMemLocationTypeHost` + are not IPC capable and :py:obj:`~.cudaMemPoolProps.handleTypes` must + be 0, any other values will result in + :py:obj:`~.cudaErrorInvalidValue`. To create a memory pool targeting a + specific host NUMA node, applications must set :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::type to :py:obj:`~.cudaMemLocationTypeHostNuma` and :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::id must specify the NUMA ID of the host memory node. Specifying - :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` or - :py:obj:`~.cudaMemLocationTypeHost` as the + :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` as the :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::type will result in :py:obj:`~.cudaErrorInvalidValue`. By default, the pool's memory will be accessible from the device it is allocated on. In the case of pools - created with :py:obj:`~.cudaMemLocationTypeHostNuma`, their default - accessibility will be from the host CPU. Applications can control the - maximum size of the pool by specifying a non-zero value for + created with :py:obj:`~.cudaMemLocationTypeHostNuma` or + :py:obj:`~.cudaMemLocationTypeHost`, their default accessibility will + be from the host CPU. Applications can control the maximum size of the + pool by specifying a non-zero value for :py:obj:`~.cudaMemPoolProps.maxSize`. If set to 0, the maximum size of the pool will default to a system dependent value. @@ -28681,6 +28431,172 @@ def cudaMemPoolDestroy(memPool): return (_dict_cudaError_t[err],) {{endif}} +{{if 'cudaMemGetDefaultMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaMemGetDefaultMemPool(location : Optional[cudaMemLocation], typename not None : cudaMemAllocationType): + """ Returns the default memory pool for a given location and allocation type. + + The memory location can be of one of + :py:obj:`~.cudaMemLocationTypeDevice`, + :py:obj:`~.cudaMemLocationTypeHost` or + :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one + of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is + :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be + :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location + for the managed memory pool. In all other cases, the call return + :py:obj:`~.cudaErrorInvalidValue` + + Parameters + ---------- + location : :py:obj:`~.cudaMemLocation` + None + typename : :py:obj:`~.cudaMemAllocationType` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported`, + memPool : :py:obj:`~.cudaMemPool_t` + None + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cuMemPoolSetAttribute`, cuMemPoolSetAccess, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemAllocationType cytypename = typename.value + with nogil: + err = cyruntime.cudaMemGetDefaultMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], memPool) +{{endif}} + +{{if 'cudaMemGetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : cudaMemAllocationType): + """ Gets the current memory pool for a given memory location and allocation type. + + The memory location can be of one of + :py:obj:`~.cudaMemLocationTypeDevice`, + :py:obj:`~.cudaMemLocationTypeHost` or + :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one + of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is + :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be + :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location + for the managed memory pool. In all other cases, the call return + :py:obj:`~.cudaErrorInvalidValue` + + Returns the last pool provided to :py:obj:`~.cudaMemSetMemPool` or + :py:obj:`~.cudaDeviceSetMemPool` for this location and allocation type + or the location's default memory pool if :py:obj:`~.cudaMemSetMemPool` + or :py:obj:`~.cudaDeviceSetMemPool` for that allocType and location has + never been called. By default the current mempool of a location is the + default mempool for a device that can be obtained via + cudaMemGetDefaultMemPool Otherwise the returned pool must have been set + with :py:obj:`~.cudaDeviceSetMemPool`. + + Parameters + ---------- + location : :py:obj:`~.cudaMemLocation` + None + typename : :py:obj:`~.cudaMemAllocationType` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + memPool : :py:obj:`~.cudaMemPool_t` + None + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuMemSetMemPool` + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemAllocationType cytypename = typename.value + with nogil: + err = cyruntime.cudaMemGetMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], memPool) +{{endif}} + +{{if 'cudaMemSetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : cudaMemAllocationType, memPool): + """ Sets the current memory pool for a memory location and allocation type. + + The memory location can be of one of + :py:obj:`~.cudaMemLocationTypeDevice`, + :py:obj:`~.cudaMemLocationTypeHost` or + :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one + of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is + :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be + :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location + for the managed memory pool. In all other cases, the call return + :py:obj:`~.cudaErrorInvalidValue` + + When a memory pool is set as the current memory pool, the location + parameter should be the same as the location of the pool. If the + location type or index don't match, the call returns + :py:obj:`~.cudaErrorInvalidValue`. The type of memory pool should also + match the parameter allocType. Else the call returns + :py:obj:`~.cudaErrorInvalidValue`. By default, a memory location's + current memory pool is its default memory pool. If the location type is + :py:obj:`~.cudaMemLocationTypeDevice` and the allocation type is + :py:obj:`~.cudaMemAllocationTypePinned`, then this API is the + equivalent of calling :py:obj:`~.cudaDeviceSetMemPool` with the + location id as the device. For further details on the implications, + please refer to the documentation for :py:obj:`~.cudaDeviceSetMemPool`. + + Parameters + ---------- + location : :py:obj:`~.cudaMemLocation` + None + typename : :py:obj:`~.cudaMemAllocationType` + None + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolDestroy`, :py:obj:`~.cuMemAllocFromPoolAsync` + + Notes + ----- + Use :py:obj:`~.cudaMallocFromPoolAsync` to specify asynchronous allocations from a device different than the one the stream runs on. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemAllocationType cytypename = typename.value + with nogil: + err = cyruntime.cudaMemSetMemPool(cylocation_ptr, cytypename, cymemPool) + return (_dict_cudaError_t[err],) +{{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} @cython.embedsignature(True) @@ -29630,8 +29546,8 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op :py:obj:`~.cudaResourceDesc`::res::linear::sizeInBytes specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed - :py:obj:`~.cudaDeviceProp.maxTexture1DLinear`. The number of elements - is computed as (sizeInBytes / sizeof(desc)). + :py:obj:`~.cudaDeviceGetTexture1DLinearMaxWidth()`. The number of + elements is computed as (sizeInBytes / sizeof(desc)). If :py:obj:`~.cudaResourceDesc.resType` is set to :py:obj:`~.cudaResourceTypePitch2D`, @@ -30167,6 +30083,203 @@ def cudaRuntimeGetVersion(): return (_dict_cudaError_t[err], runtimeVersion) {{endif}} +{{if 'cudaLogsRegisterCallback' in found_functions}} + +@cython.embedsignature(True) +def cudaLogsRegisterCallback(callbackFunc, userData): + """ Register a callback function to receive error log messages. + + Parameters + ---------- + callbackFunc : :py:obj:`~.cudaLogsCallback_t` + The function to register as a callback + userData : Any + A generic pointer to user data. This is passed into the callback + function. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + callback_out : :py:obj:`~.cudaLogsCallbackHandle` + Optional location to store the callback handle after it is + registered + """ + cdef cyruntime.cudaLogsCallback_t cycallbackFunc + if callbackFunc is None: + pcallbackFunc = 0 + elif isinstance(callbackFunc, (cudaLogsCallback_t,)): + pcallbackFunc = int(callbackFunc) + else: + pcallbackFunc = int(cudaLogsCallback_t(callbackFunc)) + cycallbackFunc = pcallbackFunc + cyuserData = utils.HelperInputVoidPtr(userData) + cdef void* cyuserData_ptr = cyuserData.cptr + cdef cudaLogsCallbackHandle callback_out = cudaLogsCallbackHandle() + with nogil: + err = cyruntime.cudaLogsRegisterCallback(cycallbackFunc, cyuserData_ptr, callback_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], callback_out) +{{endif}} + +{{if 'cudaLogsUnregisterCallback' in found_functions}} + +@cython.embedsignature(True) +def cudaLogsUnregisterCallback(callback): + """ Unregister a log message callback. + + Parameters + ---------- + callback : :py:obj:`~.cudaLogsCallbackHandle` + The callback instance to unregister from receiving log messages + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + """ + cdef cyruntime.cudaLogsCallbackHandle cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (cudaLogsCallbackHandle,)): + pcallback = int(callback) + else: + pcallback = int(cudaLogsCallbackHandle(callback)) + cycallback = pcallback + with nogil: + err = cyruntime.cudaLogsUnregisterCallback(cycallback) + return (_dict_cudaError_t[err],) +{{endif}} + +{{if 'cudaLogsCurrent' in found_functions}} + +@cython.embedsignature(True) +def cudaLogsCurrent(unsigned int flags): + """ Sets log iterator to point to the end of log buffer, where the next message would be written. + + Parameters + ---------- + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + iterator_out : :py:obj:`~.cudaLogIterator` + Location to store an iterator to the current tail of the logs + """ + cdef cudaLogIterator iterator_out = cudaLogIterator() + with nogil: + err = cyruntime.cudaLogsCurrent(iterator_out._pvt_ptr, flags) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], iterator_out) +{{endif}} + +{{if 'cudaLogsDumpToFile' in found_functions}} + +@cython.embedsignature(True) +def cudaLogsDumpToFile(iterator : Optional[cudaLogIterator], char* pathToFile, unsigned int flags): + """ Dump accumulated driver logs into a file. + + Logs generated by the driver are stored in an internal buffer and can + be copied out using this API. This API dumps all driver logs starting + from `iterator` into `pathToFile` provided. + + Parameters + ---------- + iterator : :py:obj:`~.cudaLogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + pathToFile : bytes + Path to output file for dumping logs + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + iterator : :py:obj:`~.cudaLogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + + Notes + ----- + `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log. + + The driver reserves limited memory for storing logs. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. + """ + cdef cyruntime.cudaLogIterator* cyiterator = NULL + if iterator is not None: + cyiterator = iterator._pvt_ptr + with nogil: + err = cyruntime.cudaLogsDumpToFile(cyiterator, pathToFile, flags) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None) + return (_dict_cudaError_t[err], iterator) +{{endif}} + +{{if 'cudaLogsDumpToMemory' in found_functions}} + +@cython.embedsignature(True) +def cudaLogsDumpToMemory(iterator : Optional[cudaLogIterator], char* buffer, size_t size, unsigned int flags): + """ Dump accumulated driver logs into a buffer. + + Logs generated by the driver are stored in an internal buffer and can + be copied out using this API. This API dumps driver logs from + `iterator` into `buffer` up to the size specified in `*size`. The + driver will always null terminate the buffer but there will not be a + null character between log entries, only a newline \n. The driver will + then return the actual number of bytes written in `*size`, excluding + the null terminator. If there are no messages to dump, `*size` will be + set to 0 and the function will return :py:obj:`~.CUDA_SUCCESS`. If the + provided `buffer` is not large enough to hold any messages, `*size` + will be set to 0 and the function will return + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Parameters + ---------- + iterator : :py:obj:`~.cudaLogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + buffer : bytes + Pointer to dump logs + size : int + See description + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + iterator : :py:obj:`~.cudaLogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + size : int + See description + + Notes + ----- + `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log. + + The driver reserves limited memory for storing logs. The maximum size of the buffer is 25600 bytes. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. + + If the provided value in `*size` is not large enough to hold all buffered messages, a message will be added at the head of the buffer indicating this. The driver then computes the number of messages it is able to store in `buffer` and writes it out. The final message in `buffer` will always be the most recent log message as of when the API is called. + """ + cdef cyruntime.cudaLogIterator* cyiterator = NULL + if iterator is not None: + cyiterator = iterator._pvt_ptr + with nogil: + err = cyruntime.cudaLogsDumpToMemory(cyiterator, buffer, &size, flags) + if err != cyruntime.cudaSuccess: + return (_dict_cudaError_t[err], None, None) + return (_dict_cudaError_t[err], iterator, size) +{{endif}} + {{if 'cudaGraphCreate' in found_functions}} @cython.embedsignature(True) @@ -30411,17 +30524,17 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} @cython.embedsignature(True) -def cudaGraphKernelNodeCopyAttributes(hSrc, hDst): +def cudaGraphKernelNodeCopyAttributes(hDst, hSrc): """ Copies attributes from source node to destination node. - Copies attributes from source node `src` to destination node `dst`. + Copies attributes from source node `hSrc` to destination node `hDst`. Both node must have the same context. Parameters ---------- - dst : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + hDst : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` Destination node - src : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + hSrc : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` Source node For list of attributes see :py:obj:`~.cudaKernelNodeAttrID` @@ -30434,14 +30547,6 @@ def cudaGraphKernelNodeCopyAttributes(hSrc, hDst): -------- :py:obj:`~.cudaAccessPolicyWindow` """ - cdef cyruntime.cudaGraphNode_t cyhDst - if hDst is None: - phDst = 0 - elif isinstance(hDst, (cudaGraphNode_t,driver.CUgraphNode)): - phDst = int(hDst) - else: - phDst = int(cudaGraphNode_t(hDst)) - cyhDst = phDst cdef cyruntime.cudaGraphNode_t cyhSrc if hSrc is None: phSrc = 0 @@ -30450,8 +30555,16 @@ def cudaGraphKernelNodeCopyAttributes(hSrc, hDst): else: phSrc = int(cudaGraphNode_t(hSrc)) cyhSrc = phSrc + cdef cyruntime.cudaGraphNode_t cyhDst + if hDst is None: + phDst = 0 + elif isinstance(hDst, (cudaGraphNode_t,driver.CUgraphNode)): + phDst = int(hDst) + else: + phDst = int(cudaGraphNode_t(hDst)) + cyhDst = phDst with nogil: - err = cyruntime.cudaGraphKernelNodeCopyAttributes(cyhSrc, cyhDst) + err = cyruntime.cudaGraphKernelNodeCopyAttributes(cyhDst, cyhSrc) return (_dict_cudaError_t[err],) {{endif}} @@ -32671,79 +32784,6 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): def cudaGraphGetEdges(graph, size_t numEdges = 0): """ Returns a graph's dependency edges. - Returns a list of `graph's` dependency edges. Edges are returned via - corresponding indices in `from` and `to`; that is, the node in `to`[i] - has a dependency on the node in `from`[i]. `from` and `to` may both be - NULL, in which case this function only returns the number of edges in - `numEdges`. Otherwise, `numEdges` entries will be filled in. If - `numEdges` is higher than the actual number of edges, the remaining - entries in `from` and `to` will be set to NULL, and the number of edges - actually returned will be written to `numEdges`. - - Parameters - ---------- - graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to get the edges from - numEdges : int - See description - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - from : List[:py:obj:`~.cudaGraphNode_t`] - Location to return edge endpoints - to : List[:py:obj:`~.cudaGraphNode_t`] - Location to return edge endpoints - numEdges : int - See description - - See Also - -------- - :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` - """ - cdef size_t _graph_length = numEdges - cdef cyruntime.cudaGraph_t cygraph - if graph is None: - pgraph = 0 - elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): - pgraph = int(graph) - else: - pgraph = int(cudaGraph_t(graph)) - cygraph = pgraph - cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL - pyfrom_ = [] - if _graph_length != 0: - cyfrom_ = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - cdef cyruntime.cudaGraphNode_t* cyto = NULL - pyto = [] - if _graph_length != 0: - cyto = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - with nogil: - err = cyruntime.cudaGraphGetEdges(cygraph, cyfrom_, cyto, &numEdges) - if cudaError_t(err) == cudaError_t(0): - pyfrom_ = [cudaGraphNode_t(init_value=cyfrom_[idx]) for idx in range(_graph_length)] - if cyfrom_ is not NULL: - free(cyfrom_) - if cudaError_t(err) == cudaError_t(0): - pyto = [cudaGraphNode_t(init_value=cyto[idx]) for idx in range(_graph_length)] - if cyto is not NULL: - free(cyto) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None) - return (_dict_cudaError_t[err], pyfrom_, pyto, numEdges) -{{endif}} - -{{if 'cudaGraphGetEdges_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphGetEdges_v2(graph, size_t numEdges = 0): - """ Returns a graph's dependency edges (12.3+) - Returns a list of `graph's` dependency edges. Edges are returned via corresponding indices in `from`, `to` and `edgeData`; that is, the node in `to`[i] has a dependency on the node in `from`[i] with data @@ -32810,7 +32850,7 @@ def cudaGraphGetEdges_v2(graph, size_t numEdges = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) with nogil: - err = cyruntime.cudaGraphGetEdges_v2(cygraph, cyfrom_, cyto, cyedgeData, &numEdges) + err = cyruntime.cudaGraphGetEdges(cygraph, cyfrom_, cyto, cyedgeData, &numEdges) if cudaError_t(err) == cudaError_t(0): pyfrom_ = [cudaGraphNode_t(init_value=cyfrom_[idx]) for idx in range(_graph_length)] if cyfrom_ is not NULL: @@ -32842,66 +32882,6 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): NULL, and the number of nodes actually obtained will be returned in `pNumDependencies`. - Parameters - ---------- - node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` - Node to query - pNumDependencies : int - See description - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] - Pointer to return the dependencies - pNumDependencies : int - See description - - See Also - -------- - :py:obj:`~.cudaGraphNodeGetDependentNodes`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` - """ - cdef size_t _graph_length = pNumDependencies - cdef cyruntime.cudaGraphNode_t cynode - if node is None: - pnode = 0 - elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): - pnode = int(node) - else: - pnode = int(cudaGraphNode_t(node)) - cynode = pnode - cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL - pypDependencies = [] - if _graph_length != 0: - cypDependencies = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) - if cypDependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - with nogil: - err = cyruntime.cudaGraphNodeGetDependencies(cynode, cypDependencies, &pNumDependencies) - if cudaError_t(err) == cudaError_t(0): - pypDependencies = [cudaGraphNode_t(init_value=cypDependencies[idx]) for idx in range(_graph_length)] - if cypDependencies is not NULL: - free(cypDependencies) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pypDependencies, pNumDependencies) -{{endif}} - -{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphNodeGetDependencies_v2(node, size_t pNumDependencies = 0): - """ Returns a node's dependencies (12.3+) - - Returns a list of `node's` dependencies. `pDependencies` may be NULL, - in which case this function will return the number of dependencies in - `pNumDependencies`. Otherwise, `pNumDependencies` entries will be - filled in. If `pNumDependencies` is higher than the actual number of - dependencies, the remaining entries in `pDependencies` will be set to - NULL, and the number of nodes actually obtained will be returned in - `pNumDependencies`. - Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return :py:obj:`~.cudaErrorLossyQuery`. If `edgeData` is non-NULL, then @@ -32951,7 +32931,7 @@ def cudaGraphNodeGetDependencies_v2(node, size_t pNumDependencies = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) with nogil: - err = cyruntime.cudaGraphNodeGetDependencies_v2(cynode, cypDependencies, cyedgeData, &pNumDependencies) + err = cyruntime.cudaGraphNodeGetDependencies(cynode, cypDependencies, cyedgeData, &pNumDependencies) if cudaError_t(err) == cudaError_t(0): pypDependencies = [cudaGraphNode_t(init_value=cypDependencies[idx]) for idx in range(_graph_length)] if cypDependencies is not NULL: @@ -32979,66 +32959,6 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): will be set to NULL, and the number of nodes actually obtained will be returned in `pNumDependentNodes`. - Parameters - ---------- - node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` - Node to query - pNumDependentNodes : int - See description - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pDependentNodes : List[:py:obj:`~.cudaGraphNode_t`] - Pointer to return the dependent nodes - pNumDependentNodes : int - See description - - See Also - -------- - :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` - """ - cdef size_t _graph_length = pNumDependentNodes - cdef cyruntime.cudaGraphNode_t cynode - if node is None: - pnode = 0 - elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): - pnode = int(node) - else: - pnode = int(cudaGraphNode_t(node)) - cynode = pnode - cdef cyruntime.cudaGraphNode_t* cypDependentNodes = NULL - pypDependentNodes = [] - if _graph_length != 0: - cypDependentNodes = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) - if cypDependentNodes is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - with nogil: - err = cyruntime.cudaGraphNodeGetDependentNodes(cynode, cypDependentNodes, &pNumDependentNodes) - if cudaError_t(err) == cudaError_t(0): - pypDependentNodes = [cudaGraphNode_t(init_value=cypDependentNodes[idx]) for idx in range(_graph_length)] - if cypDependentNodes is not NULL: - free(cypDependentNodes) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pypDependentNodes, pNumDependentNodes) -{{endif}} - -{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): - """ Returns a node's dependent nodes (12.3+) - - Returns a list of `node's` dependent nodes. `pDependentNodes` may be - NULL, in which case this function will return the number of dependent - nodes in `pNumDependentNodes`. Otherwise, `pNumDependentNodes` entries - will be filled in. If `pNumDependentNodes` is higher than the actual - number of dependent nodes, the remaining entries in `pDependentNodes` - will be set to NULL, and the number of nodes actually obtained will be - returned in `pNumDependentNodes`. - Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return :py:obj:`~.cudaErrorLossyQuery`. If `edgeData` is non-NULL, then @@ -33088,7 +33008,7 @@ def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): if cyedgeData is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) with nogil: - err = cyruntime.cudaGraphNodeGetDependentNodes_v2(cynode, cypDependentNodes, cyedgeData, &pNumDependentNodes) + err = cyruntime.cudaGraphNodeGetDependentNodes(cynode, cypDependentNodes, cyedgeData, &pNumDependentNodes) if cudaError_t(err) == cudaError_t(0): pypDependentNodes = [cudaGraphNode_t(init_value=cypDependentNodes[idx]) for idx in range(_graph_length)] if cypDependentNodes is not NULL: @@ -33105,7 +33025,7 @@ def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): {{if 'cudaGraphAddDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` @@ -33115,84 +33035,6 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li If `numDependencies` is 0, elements in `pFrom` and `pTo` will be ignored. Specifying an existing dependency will return an error. - Parameters - ---------- - graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to which dependencies are added - from : List[:py:obj:`~.cudaGraphNode_t`] - Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] - Array of dependent nodes - numDependencies : size_t - Number of dependencies to be added - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - - See Also - -------- - :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` - """ - to = [] if to is None else to - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - from_ = [] if from_ is None else from_ - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - cdef cyruntime.cudaGraph_t cygraph - if graph is None: - pgraph = 0 - elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): - pgraph = int(graph) - else: - pgraph = int(cudaGraph_t(graph)) - cygraph = pgraph - cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL - if len(from_) > 1: - cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(from_)): - cyfrom_[idx] = (from_[idx])._pvt_ptr[0] - elif len(from_) == 1: - cyfrom_ = (from_[0])._pvt_ptr - cdef cyruntime.cudaGraphNode_t* cyto = NULL - if len(to) > 1: - cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(to)): - cyto[idx] = (to[idx])._pvt_ptr[0] - elif len(to) == 1: - cyto = (to[0])._pvt_ptr - if numDependencies > len(from_): raise RuntimeError("List is too small: " + str(len(from_)) + " < " + str(numDependencies)) - if numDependencies > len(to): raise RuntimeError("List is too small: " + str(len(to)) + " < " + str(numDependencies)) - with nogil: - err = cyruntime.cudaGraphAddDependencies(cygraph, cyfrom_, cyto, numDependencies) - if len(from_) > 1 and cyfrom_ is not NULL: - free(cyfrom_) - if len(to) > 1 and cyto is not NULL: - free(cyto) - return (_dict_cudaError_t[err],) -{{endif}} - -{{if 'cudaGraphAddDependencies_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): - """ Adds dependency edges to a graph. (12.3+) - - The number of dependencies to be added is defined by `numDependencies` - Elements in `pFrom` and `pTo` at corresponding indices define a - dependency. Each node in `pFrom` and `pTo` must belong to `graph`. - - If `numDependencies` is 0, elements in `pFrom` and `pTo` will be - ignored. Specifying an existing dependency will return an error. - Parameters ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` @@ -33263,7 +33105,7 @@ def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | elif len(edgeData) == 1: cyedgeData = (edgeData[0])._pvt_ptr with nogil: - err = cyruntime.cudaGraphAddDependencies_v2(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) + err = cyruntime.cudaGraphAddDependencies(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) if len(from_) > 1 and cyfrom_ is not NULL: free(cyfrom_) if len(to) > 1 and cyto is not NULL: @@ -33276,7 +33118,7 @@ def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | {{if 'cudaGraphRemoveDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): """ Removes dependency edges from a graph. The number of `pDependencies` to be removed is defined by @@ -33284,85 +33126,6 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | indices define a dependency. Each node in `pFrom` and `pTo` must belong to `graph`. - If `numDependencies` is 0, elements in `pFrom` and `pTo` will be - ignored. Specifying a non-existing dependency will return an error. - - Parameters - ---------- - graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph from which to remove dependencies - from : List[:py:obj:`~.cudaGraphNode_t`] - Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] - Array of dependent nodes - numDependencies : size_t - Number of dependencies to be removed - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - - See Also - -------- - :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` - """ - to = [] if to is None else to - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - from_ = [] if from_ is None else from_ - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - cdef cyruntime.cudaGraph_t cygraph - if graph is None: - pgraph = 0 - elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): - pgraph = int(graph) - else: - pgraph = int(cudaGraph_t(graph)) - cygraph = pgraph - cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL - if len(from_) > 1: - cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) - if cyfrom_ is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(from_)): - cyfrom_[idx] = (from_[idx])._pvt_ptr[0] - elif len(from_) == 1: - cyfrom_ = (from_[0])._pvt_ptr - cdef cyruntime.cudaGraphNode_t* cyto = NULL - if len(to) > 1: - cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) - if cyto is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(to)): - cyto[idx] = (to[idx])._pvt_ptr[0] - elif len(to) == 1: - cyto = (to[0])._pvt_ptr - if numDependencies > len(from_): raise RuntimeError("List is too small: " + str(len(from_)) + " < " + str(numDependencies)) - if numDependencies > len(to): raise RuntimeError("List is too small: " + str(len(to)) + " < " + str(numDependencies)) - with nogil: - err = cyruntime.cudaGraphRemoveDependencies(cygraph, cyfrom_, cyto, numDependencies) - if len(from_) > 1 and cyfrom_ is not NULL: - free(cyfrom_) - if len(to) > 1 and cyto is not NULL: - free(cyto) - return (_dict_cudaError_t[err],) -{{endif}} - -{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): - """ Removes dependency edges from a graph. (12.3+) - - The number of `pDependencies` to be removed is defined by - `numDependencies`. Elements in `pFrom` and `pTo` at corresponding - indices define a dependency. Each node in `pFrom` and `pTo` must belong - to `graph`. - If `numDependencies` is 0, elements in `pFrom` and `pTo` will be ignored. Specifying an edge that does not exist in the graph, with data matching `edgeData`, results in an error. `edgeData` is nullable, which @@ -33438,7 +33201,7 @@ def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t elif len(edgeData) == 1: cyedgeData = (edgeData[0])._pvt_ptr with nogil: - err = cyruntime.cudaGraphRemoveDependencies_v2(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) + err = cyruntime.cudaGraphRemoveDependencies(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) if len(from_) > 1 and cyfrom_ is not NULL: free(cyfrom_) if len(to) > 1 and cyto is not NULL: @@ -35318,7 +35081,7 @@ def cudaGraphReleaseUserObject(graph, object, unsigned int count): {{if 'cudaGraphAddNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): +def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): """ Adds a node of arbitrary type to a graph. Creates a new node in `graph` described by `nodeParams` with @@ -35340,86 +35103,6 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li A handle to the new node will be returned in `phGraphNode`. - Parameters - ---------- - graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` - Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] - Dependencies of the node - numDependencies : size_t - Number of dependencies - nodeParams : :py:obj:`~.cudaGraphNodeParams` - Specification of the node - - Returns - ------- - cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorNotSupported` - pGraphNode : :py:obj:`~.cudaGraphNode_t` - Returns newly created node - - See Also - -------- - :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphExecNodeSetParams` - """ - pDependencies = [] if pDependencies is None else pDependencies - if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") - cdef cyruntime.cudaGraph_t cygraph - if graph is None: - pgraph = 0 - elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): - pgraph = int(graph) - else: - pgraph = int(cudaGraph_t(graph)) - cygraph = pgraph - cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() - cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL - if len(pDependencies) > 1: - cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) - if cypDependencies is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) - else: - for idx in range(len(pDependencies)): - cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] - elif len(pDependencies) == 1: - cypDependencies = (pDependencies[0])._pvt_ptr - if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL - with nogil: - err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) - if len(pDependencies) > 1 and cypDependencies is not NULL: - free(cypDependencies) - if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) -{{endif}} - -{{if 'cudaGraphAddNode_v2' in found_functions}} - -@cython.embedsignature(True) -def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): - """ Adds a node of arbitrary type to a graph (12.3+) - - Creates a new node in `graph` described by `nodeParams` with - `numDependencies` dependencies specified via `pDependencies`. - `numDependencies` may be 0. `pDependencies` may be null if - `numDependencies` is 0. `pDependencies` may not have any duplicate - entries. - - `nodeParams` is a tagged union. The node type should be specified in - the `typename` field, and type-specific parameters in the corresponding - union member. All unused bytes - that is, `reserved0` and all bytes - past the utilized union member - must be set to zero. It is recommended - to use brace initialization or memset to ensure all bytes are - initialized. - - Note that for some node types, `nodeParams` may contain "out - parameters" which are modified during the call, such as - `nodeParams->alloc.dptr`. - - A handle to the new node will be returned in `phGraphNode`. - Parameters ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` @@ -35479,11 +35162,9 @@ def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr - if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL with nogil: - err = cyruntime.cudaGraphAddNode_v2(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) + err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: @@ -35655,6 +35336,8 @@ def cudaGraphConditionalHandleCreate(graph, unsigned int defaultLaunchValue, uns def cudaGetDriverEntryPoint(char* symbol, unsigned long long flags): """ Returns the requested driver API function pointer. + [Deprecated] + Returns in `**funcPtr` the address of the CUDA driver function for the requested flags. @@ -35737,6 +35420,10 @@ def cudaGetDriverEntryPoint(char* symbol, unsigned long long flags): See Also -------- :py:obj:`~.cuGetProcAddress` + + Notes + ----- + This API is deprecated and :py:obj:`~.cudaGetDriverEntryPointByVersion` (with a hardcoded :py:obj:`~.cudaVersion`) should be used instead. """ cdef void_ptr funcPtr = 0 cdef cyruntime.cudaDriverEntryPointQueryResult driverStatus @@ -35760,7 +35447,9 @@ def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, uns 11.2 should be specified as 11020. For a requested driver symbol, if the specified CUDA version is greater than or equal to the CUDA version in which the driver symbol was introduced, this API will return the - function pointer to the corresponding versioned function. + function pointer to the corresponding versioned function. If the + specified CUDA version is greater than the driver version, the API will + return :py:obj:`~.cudaErrorInvalidValue`. The pointer returned by the API should be cast to a function pointer matching the requested driver function's definition in the API header @@ -38150,6 +37839,12 @@ def sizeof(objType): {{if 'cudaAsyncCallback' in found_types}} if objType == cudaAsyncCallback: return sizeof(cyruntime.cudaAsyncCallback){{endif}} + {{if 'cudaLogsCallbackHandle' in found_types}} + if objType == cudaLogsCallbackHandle: + return sizeof(cyruntime.cudaLogsCallbackHandle){{endif}} + {{if 'cudaLogIterator' in found_types}} + if objType == cudaLogIterator: + return sizeof(cyruntime.cudaLogIterator){{endif}} {{if 'cudaSurfaceObject_t' in found_types}} if objType == cudaSurfaceObject_t: return sizeof(cyruntime.cudaSurfaceObject_t){{endif}} @@ -38162,6 +37857,9 @@ def sizeof(objType): {{if 'cudaStreamCallback_t' in found_types}} if objType == cudaStreamCallback_t: return sizeof(cyruntime.cudaStreamCallback_t){{endif}} + {{if 'cudaLogsCallback_t' in found_types}} + if objType == cudaLogsCallback_t: + return sizeof(cyruntime.cudaLogsCallback_t){{endif}} {{if True}} if objType == GLenum: return sizeof(cyruntime.GLenum){{endif}} diff --git a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in b/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in index 2d40133db..30718591e 100644 --- a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in +++ b/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated with version 13.0.0. Do not modify it directly. from libc.stdint cimport uintptr_t cimport cython @@ -220,6 +220,10 @@ def get_cuda_native_handle(obj) -> int: def cudaAsyncCallbackHandle_t_getter(runtime.cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) _handle_getters[runtime.cudaAsyncCallbackHandle_t] = cudaAsyncCallbackHandle_t_getter {{endif}} + {{if 'cudaLogsCallbackHandle' in found_types}} + def cudaLogsCallbackHandle_getter(runtime.cudaLogsCallbackHandle x): return (x._pvt_ptr[0]) + _handle_getters[runtime.cudaLogsCallbackHandle] = cudaLogsCallbackHandle_getter + {{endif}} {{if True}} def cudaEglStreamConnection_getter(runtime.cudaEglStreamConnection x): return (x._pvt_ptr[0]) _handle_getters[runtime.cudaEglStreamConnection] = cudaEglStreamConnection_getter diff --git a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py b/cuda_bindings/cuda/bindings/utils/_ptx_utils.py index d303d5980..038492f6a 100644 --- a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py +++ b/cuda_bindings/cuda/bindings/utils/_ptx_utils.py @@ -47,6 +47,7 @@ "8.6": (12, 7), "8.7": (12, 8), "8.8": (12, 9), + "9.0": (13, 0), } diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index 175e304e6..f7e0e3669 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -6,8 +6,8 @@ * Linux (x86-64, arm64) and Windows (x86-64) * Python 3.9 - 3.13 -* Driver: Linux (450.80.02 or later) Windows (456.38 or later) -* Optionally, NVRTC, nvJitLink, and NVVM from CUDA Toolkit 12.x +* Driver: Linux (580.65.06 or later) Windows (580.88 or later) +* Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x ```{note} The optional CUDA Toolkit components can be installed via PyPI, Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). @@ -29,9 +29,10 @@ pip install -U cuda-python[all] Where the optional dependencies are: -* nvidia-cuda-nvrtc-cu12 (Provides NVRTC shared library) -* nvidia-nvjitlink-cu12>=12.3 (Provides nvJitLink shared library) -* nvidia-cuda-nvcc-cu12 (Provides NVVM shared library) +* nvidia-cuda-nvrtc (Provides NVRTC shared library) +* nvidia-nvjitlink (Provides nvJitLink shared library) +* nvidia-cuda-nvcc (Provides NVVM shared library) +* nvidia-cufile (Provides cuFile shared library) ## Installing from Conda diff --git a/cuda_bindings/docs/source/module/driver.rst b/cuda_bindings/docs/source/module/driver.rst index f0abf24a7..04e0390d1 100644 --- a/cuda_bindings/docs/source/module/driver.rst +++ b/cuda_bindings/docs/source/module/driver.rst @@ -85,7 +85,7 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUgraphNodeParams_st .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs_st -.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs_st +.. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair_st .. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs_st .. autoclass:: cuda.bindings.driver.CUeglFrame_st .. autoclass:: cuda.bindings.driver.CUipcMem_flags @@ -1340,7 +1340,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED - Link between the device and the host supports native atomic operations + Link between the device and the host supports all native atomic operations .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO @@ -1691,6 +1691,30 @@ Data types used by CUDA driver Device supports HOST_NUMA location IPC between nodes in a multi-node system. + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED + + + Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + + + Device supports HOST location with the virtual memory management APIs like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED + + + Device supports page-locked host memory buffer sharing with dma_buf mechanism. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED + + + Link between the device and the host supports only some native atomic operations + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX .. autoclass:: cuda.bindings.driver.CUpointer_attribute @@ -1873,7 +1897,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES - The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. The default value of this attribute is :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`, except when :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` is greater than :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`, then the default value of this attribute is 0. The value can be increased to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT @@ -2489,6 +2513,14 @@ Data types used by CUDA driver Applies to: compiler only + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_SPLIT_COMPILE + + + This option specifies the maximum number of concurrent threads to use when running compiler optimizations. If the specified value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying machine. Otherwise, if the option is N, then up to N threads will be used. Option type: unsigned int + + Applies to: compiler only + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_NUM_OPTIONS .. autoclass:: cuda.bindings.driver.CUjit_target @@ -2607,10 +2639,10 @@ Data types used by CUDA driver Compute device class 10.0. - .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101 + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_110 - Compute device class 10.1. + Compute device class 11.0. .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103 @@ -2640,10 +2672,10 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_100A - Compute device class 10.1 with accelerated features. + Compute device class 11.0 with accelerated features. - .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101A + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_110A Compute device class 10.3. with accelerated features. @@ -2670,10 +2702,10 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_100F - Compute device class 10.1 with family features. + Compute device class 11.0 with family features. - .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101F + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_110F Compute device class 10.3. with family features. @@ -3046,7 +3078,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP - Batch MemOp Node + Batch MemOp Node See :py:obj:`~.cuStreamBatchMemOp` and :py:obj:`~.CUstreamBatchMemOpType` for what these nodes can do. .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL @@ -3286,6 +3318,20 @@ Data types used by CUDA driver Valid for launches. On devices where the L1 cache and shared memory use the same hardware resources, setting :py:obj:`~.CUlaunchAttributeValue.sharedMemCarveout` to a percentage between 0-100 signals the CUDA driver to set the shared memory carveout preference, in percent of the total shared memory for that kernel launch. This attribute takes precedence over :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is only a hint, and the CUDA driver can choose a different configuration if required for the launch. + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING + + + Valid for streams, graph nodes, launches. This attribute is a hint to the CUDA runtime that the launch should attempt to make the kernel maximize its NVLINK utilization. + + + + When possible to honor this hint, CUDA will assume each block in the grid launch will carry out an even amount of NVLINK traffic, and make a best-effort attempt to adjust the kernel launch based on that assumption. + + This attribute is a hint only. CUDA makes no functional or performance guarantee. Its applicability can be affected by many different factors, including driver version (i.e. CUDA doesn't guarantee the performance characteristics will be maintained between driver versions or a driver update could alter or regress previously observed perf characteristics.) It also doesn't guarantee a successful result, i.e. applying the attribute may not improve the performance of either the targeted kernel or the encapsulating application. + + Valid values for :py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are 0 (disabled) and 1 (enabled). + .. autoclass:: cuda.bindings.driver.CUstreamCaptureStatus .. autoattribute:: cuda.bindings.driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_NONE @@ -3448,6 +3494,12 @@ Data types used by CUDA driver This indicates that the CUDA driver that the application has loaded is a stub library. Applications that run with the stub rather than a real driver loaded will result in CUDA API returning this error. + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER + + + This indicates that the API call requires a newer CUDA driver than the one currently installed. Users should install an updated NVIDIA CUDA driver to allow the API call to succeed. + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_DEVICE_UNAVAILABLE @@ -4004,7 +4056,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED - Atomic operation over the link supported + All CUDA-valid atomic operation over the link are supported .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED @@ -4018,6 +4070,77 @@ Data types used by CUDA driver Accessing CUDA arrays over the link supported + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED + + + Only some CUDA-valid atomic operations over the link are supported. + +.. autoclass:: cuda.bindings.driver.CUatomicOperation + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_INTEGER_ADD + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_INTEGER_MIN + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_INTEGER_MAX + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_INTEGER_INCREMENT + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_INTEGER_DECREMENT + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_AND + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_OR + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_XOR + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_EXCHANGE + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_CAS + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_FLOAT_ADD + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_FLOAT_MIN + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_FLOAT_MAX + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperation.CU_ATOMIC_OPERATION_MAX + +.. autoclass:: cuda.bindings.driver.CUatomicOperationCapability + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_SIGNED + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_UNSIGNED + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_REDUCTION + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_SCALAR_32 + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_SCALAR_64 + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_SCALAR_128 + + + .. autoattribute:: cuda.bindings.driver.CUatomicOperationCapability.CU_ATOMIC_CAPABILITY_VECTOR_32x4 + .. autoclass:: cuda.bindings.driver.CUresourceViewFormat .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_NONE @@ -4405,6 +4528,12 @@ Data types used by CUDA driver Handle is an NvSciBuf object + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD + + + Handle is a dma_buf file descriptor + .. autoclass:: cuda.bindings.driver.CUexternalSemaphoreHandleType .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD @@ -4527,6 +4656,12 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_INVALID + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_NONE + + + Location is unspecified. This is used when creating a managed memory pool to indicate no preferred location for the pool + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE @@ -4564,6 +4699,12 @@ Data types used by CUDA driver This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it + .. autoattribute:: cuda.bindings.driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MANAGED + + + This allocation type is managed memory + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MAX .. autoclass:: cuda.bindings.driver.CUmemAllocationGranularity_flags @@ -5960,7 +6101,7 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUgraphNodeParams .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs -.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs +.. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair .. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs .. autoclass:: cuda.bindings.driver.CUeglFrame_v1 .. autoclass:: cuda.bindings.driver.CUeglFrame @@ -6255,11 +6396,11 @@ This section describes the device management functions of the low-level CUDA dri .. autofunction:: cuda.bindings.driver.cuDeviceGetCount .. autofunction:: cuda.bindings.driver.cuDeviceGetName .. autofunction:: cuda.bindings.driver.cuDeviceGetUuid -.. autofunction:: cuda.bindings.driver.cuDeviceGetUuid_v2 .. autofunction:: cuda.bindings.driver.cuDeviceGetLuid .. autofunction:: cuda.bindings.driver.cuDeviceTotalMem .. autofunction:: cuda.bindings.driver.cuDeviceGetTexture1DLinearMaxWidth .. autofunction:: cuda.bindings.driver.cuDeviceGetAttribute +.. autofunction:: cuda.bindings.driver.cuDeviceGetHostAtomicCapabilities .. autofunction:: cuda.bindings.driver.cuDeviceGetNvSciSyncAttributes .. autofunction:: cuda.bindings.driver.cuDeviceSetMemPool .. autofunction:: cuda.bindings.driver.cuDeviceGetMemPool @@ -6292,18 +6433,18 @@ This section describes the context management functions of the low-level CUDA dr Please note that some functions are described in Primary Context Management section. .. autofunction:: cuda.bindings.driver.cuCtxCreate -.. autofunction:: cuda.bindings.driver.cuCtxCreate_v3 -.. autofunction:: cuda.bindings.driver.cuCtxCreate_v4 .. autofunction:: cuda.bindings.driver.cuCtxDestroy .. autofunction:: cuda.bindings.driver.cuCtxPushCurrent .. autofunction:: cuda.bindings.driver.cuCtxPopCurrent .. autofunction:: cuda.bindings.driver.cuCtxSetCurrent .. autofunction:: cuda.bindings.driver.cuCtxGetCurrent .. autofunction:: cuda.bindings.driver.cuCtxGetDevice +.. autofunction:: cuda.bindings.driver.cuCtxGetDevice_v2 .. autofunction:: cuda.bindings.driver.cuCtxGetFlags .. autofunction:: cuda.bindings.driver.cuCtxSetFlags .. autofunction:: cuda.bindings.driver.cuCtxGetId .. autofunction:: cuda.bindings.driver.cuCtxSynchronize +.. autofunction:: cuda.bindings.driver.cuCtxSynchronize_v2 .. autofunction:: cuda.bindings.driver.cuCtxSetLimit .. autofunction:: cuda.bindings.driver.cuCtxGetLimit .. autofunction:: cuda.bindings.driver.cuCtxGetCacheConfig @@ -6536,6 +6677,9 @@ Whether or not a device supports the integrated stream ordered memory allocator .. autofunction:: cuda.bindings.driver.cuMemPoolGetAccess .. autofunction:: cuda.bindings.driver.cuMemPoolCreate .. autofunction:: cuda.bindings.driver.cuMemPoolDestroy +.. autofunction:: cuda.bindings.driver.cuMemGetDefaultMemPool +.. autofunction:: cuda.bindings.driver.cuMemGetMemPool +.. autofunction:: cuda.bindings.driver.cuMemSetMemPool .. autofunction:: cuda.bindings.driver.cuMemAllocFromPoolAsync .. autofunction:: cuda.bindings.driver.cuMemPoolExportToShareableHandle .. autofunction:: cuda.bindings.driver.cuMemPoolImportFromShareableHandle @@ -6651,9 +6795,10 @@ This device address may be queried using cuMemHostGetDevicePointer() when a cont .. autofunction:: cuda.bindings.driver.cuPointerGetAttribute .. autofunction:: cuda.bindings.driver.cuMemPrefetchAsync -.. autofunction:: cuda.bindings.driver.cuMemPrefetchAsync_v2 .. autofunction:: cuda.bindings.driver.cuMemAdvise -.. autofunction:: cuda.bindings.driver.cuMemAdvise_v2 +.. autofunction:: cuda.bindings.driver.cuMemPrefetchBatchAsync +.. autofunction:: cuda.bindings.driver.cuMemDiscardBatchAsync +.. autofunction:: cuda.bindings.driver.cuMemDiscardAndPrefetchBatchAsync .. autofunction:: cuda.bindings.driver.cuMemRangeGetAttribute .. autofunction:: cuda.bindings.driver.cuMemRangeGetAttributes .. autofunction:: cuda.bindings.driver.cuPointerSetAttribute @@ -6680,9 +6825,7 @@ This section describes the stream management functions of the low-level CUDA dri .. autofunction:: cuda.bindings.driver.cuStreamEndCapture .. autofunction:: cuda.bindings.driver.cuStreamIsCapturing .. autofunction:: cuda.bindings.driver.cuStreamGetCaptureInfo -.. autofunction:: cuda.bindings.driver.cuStreamGetCaptureInfo_v3 .. autofunction:: cuda.bindings.driver.cuStreamUpdateCaptureDependencies -.. autofunction:: cuda.bindings.driver.cuStreamUpdateCaptureDependencies_v2 .. autofunction:: cuda.bindings.driver.cuStreamAttachMemAsync .. autofunction:: cuda.bindings.driver.cuStreamQuery .. autofunction:: cuda.bindings.driver.cuStreamSynchronize @@ -6703,7 +6846,6 @@ This section describes the event management functions of the low-level CUDA driv .. autofunction:: cuda.bindings.driver.cuEventSynchronize .. autofunction:: cuda.bindings.driver.cuEventDestroy .. autofunction:: cuda.bindings.driver.cuEventElapsedTime -.. autofunction:: cuda.bindings.driver.cuEventElapsedTime_v2 External Resource Interoperability ---------------------------------- @@ -6833,15 +6975,10 @@ This section describes the graph management functions of the low-level CUDA driv .. autofunction:: cuda.bindings.driver.cuGraphGetNodes .. autofunction:: cuda.bindings.driver.cuGraphGetRootNodes .. autofunction:: cuda.bindings.driver.cuGraphGetEdges -.. autofunction:: cuda.bindings.driver.cuGraphGetEdges_v2 .. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependencies -.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependencies_v2 .. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependentNodes -.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependentNodes_v2 .. autofunction:: cuda.bindings.driver.cuGraphAddDependencies -.. autofunction:: cuda.bindings.driver.cuGraphAddDependencies_v2 .. autofunction:: cuda.bindings.driver.cuGraphRemoveDependencies -.. autofunction:: cuda.bindings.driver.cuGraphRemoveDependencies_v2 .. autofunction:: cuda.bindings.driver.cuGraphDestroyNode .. autofunction:: cuda.bindings.driver.cuGraphInstantiate .. autofunction:: cuda.bindings.driver.cuGraphInstantiateWithParams @@ -6872,7 +7009,6 @@ This section describes the graph management functions of the low-level CUDA driv .. autofunction:: cuda.bindings.driver.cuGraphRetainUserObject .. autofunction:: cuda.bindings.driver.cuGraphReleaseUserObject .. autofunction:: cuda.bindings.driver.cuGraphAddNode -.. autofunction:: cuda.bindings.driver.cuGraphAddNode_v2 .. autofunction:: cuda.bindings.driver.cuGraphNodeSetParams .. autofunction:: cuda.bindings.driver.cuGraphExecNodeSetParams .. autofunction:: cuda.bindings.driver.cuGraphConditionalHandleCreate @@ -6929,6 +7065,7 @@ This section describes the direct peer context memory access functions of the lo .. autofunction:: cuda.bindings.driver.cuCtxEnablePeerAccess .. autofunction:: cuda.bindings.driver.cuCtxDisablePeerAccess .. autofunction:: cuda.bindings.driver.cuDeviceGetP2PAttribute +.. autofunction:: cuda.bindings.driver.cuDeviceGetP2PAtomicCapabilities Graphics Interoperability ------------------------- @@ -7055,9 +7192,13 @@ There are 4 main steps to using these new set of APIs. -For ``CU_DEV_RESOURCE_TYPE_SM``\ , the partitions created have minimum SM count requirements, often rounding up and aligning the minCount provided to cuDevSmResourceSplitByCount. The following is a guideline for each architecture and may be subject to change: +For ``CU_DEV_RESOURCE_TYPE_SM``\ , the partitions created have minimum SM count requirements, often rounding up and aligning the minCount provided to cuDevSmResourceSplitByCount. These requirements can be queried with cuDeviceGetDevResource from step (1) above to determine the minimum partition size (``sm.minSmPartitionSize``\ ) and alignment granularity (``sm.smCoscheduledAlignment``\ ). + + + +While it's recommended to use cuDeviceGetDevResource for accurate information, here is a guideline for each compute architecture: -- On Compute Architecture 6.X: The minimum count is 1 SM. +- On Compute Architecture 6.X: The minimum count is 2 SMs and must be a multiple of 2. @@ -7152,6 +7293,7 @@ Even if the green contexts have disjoint SM partitions, it is not guaranteed tha .. autofunction:: cuda.bindings.driver.cuGreenCtxWaitEvent .. autofunction:: cuda.bindings.driver.cuStreamGetGreenCtx .. autofunction:: cuda.bindings.driver.cuGreenCtxStreamCreate +.. autofunction:: cuda.bindings.driver.cuGreenCtxGetId .. autoattribute:: cuda.bindings.driver.RESOURCE_ABI_VERSION .. autoattribute:: cuda.bindings.driver.RESOURCE_ABI_EXTERNAL_BYTES .. autoattribute:: cuda.bindings.driver._CONCAT_INNER @@ -7203,7 +7345,6 @@ Checkpoint and restore capabilities are currently restricted to Linux. .. autofunction:: cuda.bindings.driver.cuCheckpointProcessGetState .. autofunction:: cuda.bindings.driver.cuCheckpointProcessLock .. autofunction:: cuda.bindings.driver.cuCheckpointProcessCheckpoint -.. autofunction:: cuda.bindings.driver.cuCheckpointProcessRestore .. autofunction:: cuda.bindings.driver.cuCheckpointProcessUnlock EGL Interoperability diff --git a/cuda_bindings/docs/source/module/nvrtc.rst b/cuda_bindings/docs/source/module/nvrtc.rst index 324db4f05..079cd39aa 100644 --- a/cuda_bindings/docs/source/module/nvrtc.rst +++ b/cuda_bindings/docs/source/module/nvrtc.rst @@ -62,6 +62,9 @@ NVRTC defines the following enumeration type and function for API call error han .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_CANCELLED + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED + .. autofunction:: cuda.bindings.nvrtc.nvrtcGetErrorString General Information Query @@ -86,8 +89,6 @@ NVRTC defines the following type and functions for actual compilation. .. autofunction:: cuda.bindings.nvrtc.nvrtcGetPTX .. autofunction:: cuda.bindings.nvrtc.nvrtcGetCUBINSize .. autofunction:: cuda.bindings.nvrtc.nvrtcGetCUBIN -.. autofunction:: cuda.bindings.nvrtc.nvrtcGetNVVMSize -.. autofunction:: cuda.bindings.nvrtc.nvrtcGetNVVM .. autofunction:: cuda.bindings.nvrtc.nvrtcGetLTOIRSize .. autofunction:: cuda.bindings.nvrtc.nvrtcGetLTOIR .. autofunction:: cuda.bindings.nvrtc.nvrtcGetOptiXIRSize @@ -111,7 +112,7 @@ NVRTC defines the following function related to PCH. Also see PCH related flags Supported Compile Options ------------------------- -NVRTC supports the compile options below. Option names with two preceding dashs (``--``\ ) are long option names and option names with one preceding dash (``-``\ ) are short option names. Short option names can be used instead of long option names. When a compile option takes an argument, an assignment operator (``=``\ ) is used to separate the compile option argument from the compile option name, e.g., ``"--gpu-architecture=compute_60"``\ . Alternatively, the compile option name and the argument can be specified in separate strings without an assignment operator, .e.g, ``"--gpu-architecture"``\ ``"compute_60"``\ . Single-character short option names, such as ``-D``\ , ``-U``\ , and ``-I``\ , do not require an assignment operator, and the compile option name and the argument can be present in the same string with or without spaces between them. For instance, ``"-D="``\ , ``"-D"``\ , and ``"-D "``\ are all supported. +NVRTC supports the compile options below. Option names with two preceding dashs (``--``\ ) are long option names and option names with one preceding dash (``-``\ ) are short option names. Short option names can be used instead of long option names. When a compile option takes an argument, an assignment operator (``=``\ ) is used to separate the compile option argument from the compile option name, e.g., ``"--gpu-architecture=compute_100"``\ . Alternatively, the compile option name and the argument can be specified in separate strings without an assignment operator, .e.g, ``"--gpu-architecture"``\ ``"compute_100"``\ . Single-character short option names, such as ``-D``\ , ``-U``\ , and ``-I``\ , do not require an assignment operator, and the compile option name and the argument can be present in the same string with or without spaces between them. For instance, ``"-D="``\ , ``"-D"``\ , and ``"-D "``\ are all supported. @@ -421,7 +422,7 @@ Disable the use of cache for both ptx and cubin code generation. - ``--frandom-seed``\ (``-frandom-seed``\ ) -The user specified random seed will be used to replace random numbers used in generating symbol names and variable names. The option can be used to generate deterministicly identical ptx and object files. If the input value is a valid number (decimal, octal, or hex), it will be used directly as the random seed. Otherwise, the CRC value of the passed string will be used instead. +The user specified random seed will be used to replace random numbers used in generating symbol names and variable names. The option can be used to generate deterministically identical ptx and object files. If the input value is a valid number (decimal, octal, or hex), it will be used directly as the random seed. Otherwise, the CRC value of the passed string will be used instead. diff --git a/cuda_bindings/docs/source/module/runtime.rst b/cuda_bindings/docs/source/module/runtime.rst index 5795c5249..d155f85eb 100644 --- a/cuda_bindings/docs/source/module/runtime.rst +++ b/cuda_bindings/docs/source/module/runtime.rst @@ -47,11 +47,13 @@ This section describes the device management functions of the CUDA runtime appli .. autofunction:: cuda.bindings.runtime.cudaGetDeviceCount .. autofunction:: cuda.bindings.runtime.cudaGetDeviceProperties .. autofunction:: cuda.bindings.runtime.cudaDeviceGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetHostAtomicCapabilities .. autofunction:: cuda.bindings.runtime.cudaDeviceGetDefaultMemPool .. autofunction:: cuda.bindings.runtime.cudaDeviceSetMemPool .. autofunction:: cuda.bindings.runtime.cudaDeviceGetMemPool .. autofunction:: cuda.bindings.runtime.cudaDeviceGetNvSciSyncAttributes .. autofunction:: cuda.bindings.runtime.cudaDeviceGetP2PAttribute +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetP2PAtomicCapabilities .. autofunction:: cuda.bindings.runtime.cudaChooseDevice .. autofunction:: cuda.bindings.runtime.cudaInitDevice .. autofunction:: cuda.bindings.runtime.cudaSetDevice @@ -98,9 +100,7 @@ This section describes the stream management functions of the CUDA runtime appli .. autofunction:: cuda.bindings.runtime.cudaStreamEndCapture .. autofunction:: cuda.bindings.runtime.cudaStreamIsCapturing .. autofunction:: cuda.bindings.runtime.cudaStreamGetCaptureInfo -.. autofunction:: cuda.bindings.runtime.cudaStreamGetCaptureInfo_v3 .. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies -.. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies_v2 Event Management ---------------- @@ -115,7 +115,6 @@ This section describes the event management functions of the CUDA runtime applic .. autofunction:: cuda.bindings.runtime.cudaEventSynchronize .. autofunction:: cuda.bindings.runtime.cudaEventDestroy .. autofunction:: cuda.bindings.runtime.cudaEventElapsedTime -.. autofunction:: cuda.bindings.runtime.cudaEventElapsedTime_v2 External Resource Interoperability ---------------------------------- @@ -220,9 +219,10 @@ Some functions have overloaded C++ API template versions documented separately i .. autofunction:: cuda.bindings.runtime.cudaMemset2DAsync .. autofunction:: cuda.bindings.runtime.cudaMemset3DAsync .. autofunction:: cuda.bindings.runtime.cudaMemPrefetchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchAsync_v2 +.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemDiscardBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemDiscardAndPrefetchBatchAsync .. autofunction:: cuda.bindings.runtime.cudaMemAdvise -.. autofunction:: cuda.bindings.runtime.cudaMemAdvise_v2 .. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttribute .. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttributes .. autofunction:: cuda.bindings.runtime.make_cudaPitchedPtr @@ -259,6 +259,9 @@ Whether or not a device supports the integrated stream ordered memory allocator .. autofunction:: cuda.bindings.runtime.cudaMemPoolGetAccess .. autofunction:: cuda.bindings.runtime.cudaMemPoolCreate .. autofunction:: cuda.bindings.runtime.cudaMemPoolDestroy +.. autofunction:: cuda.bindings.runtime.cudaMemGetDefaultMemPool +.. autofunction:: cuda.bindings.runtime.cudaMemGetMemPool +.. autofunction:: cuda.bindings.runtime.cudaMemSetMemPool .. autofunction:: cuda.bindings.runtime.cudaMallocFromPoolAsync .. autofunction:: cuda.bindings.runtime.cudaMemPoolExportToShareableHandle .. autofunction:: cuda.bindings.runtime.cudaMemPoolImportFromShareableHandle @@ -481,6 +484,18 @@ Version Management .. autofunction:: cuda.bindings.runtime.cudaRuntimeGetVersion .. autofunction:: cuda.bindings.runtime.getLocalRuntimeVersion +Error Log Management Functions +------------------------------ + +This section describes the error log management functions of the CUDA runtime application programming interface. The Error Log Management interface will operate on both the CUDA Driver and CUDA Runtime. + +.. autoclass:: cuda.bindings.runtime.cudaLogsCallback_t +.. autofunction:: cuda.bindings.runtime.cudaLogsRegisterCallback +.. autofunction:: cuda.bindings.runtime.cudaLogsUnregisterCallback +.. autofunction:: cuda.bindings.runtime.cudaLogsCurrent +.. autofunction:: cuda.bindings.runtime.cudaLogsDumpToFile +.. autofunction:: cuda.bindings.runtime.cudaLogsDumpToMemory + Graph Management ---------------- @@ -532,15 +547,10 @@ This section describes the graph management functions of CUDA runtime applicatio .. autofunction:: cuda.bindings.runtime.cudaGraphGetNodes .. autofunction:: cuda.bindings.runtime.cudaGraphGetRootNodes .. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges -.. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphDestroyNode .. autofunction:: cuda.bindings.runtime.cudaGraphInstantiate .. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithFlags @@ -570,7 +580,6 @@ This section describes the graph management functions of CUDA runtime applicatio .. autofunction:: cuda.bindings.runtime.cudaGraphRetainUserObject .. autofunction:: cuda.bindings.runtime.cudaGraphReleaseUserObject .. autofunction:: cuda.bindings.runtime.cudaGraphAddNode -.. autofunction:: cuda.bindings.runtime.cudaGraphAddNode_v2 .. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetParams .. autofunction:: cuda.bindings.runtime.cudaGraphExecNodeSetParams .. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate @@ -2060,7 +2069,7 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchTimeout - This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device property :py:obj:`~.kernelExecTimeoutEnabled` for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. + This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device attribute :py:obj:`~.cudaDevAttrKernelExecTimeout` for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchIncompatibleTexturing @@ -2156,7 +2165,7 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCooperativeLaunchTooLarge - This error indicates that the number of blocks launched per grid for a kernel that was launched via either :py:obj:`~.cudaLaunchCooperativeKernel` or :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` exceeds the maximum number of blocks as allowed by :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` or :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times the number of multiprocessors as specified by the device attribute :py:obj:`~.cudaDevAttrMultiProcessorCount`. + This error indicates that the number of blocks launched per grid for a kernel that was launched via either :py:obj:`~.cudaLaunchCooperativeKernel` exceeds the maximum number of blocks as allowed by :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` or :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times the number of multiprocessors as specified by the device attribute :py:obj:`~.cudaDevAttrMultiProcessorCount`. .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTensorMemoryLeak @@ -3895,10 +3904,7 @@ Data types used by CUDA Runtime Device supports launching cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel` - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch - - - Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved96 .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin @@ -3973,12 +3979,6 @@ Data types used by CUDA Runtime External timeline semaphore interop is supported on the device - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported - - - Deprecated, External timeline semaphore interop is supported on the device - - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported @@ -4117,6 +4117,21 @@ Data types used by CUDA Runtime Device supports HostNuma location IPC between nodes in a multi-node system. + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostMemoryPoolsSupported + + + Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved145 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrOnlyPartialHostNativeAtomicSupported + + + Link between the device and the host supports only some native atomic operations + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax .. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr @@ -4173,6 +4188,12 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvalid + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeNone + + + Location is unspecified. This is used when creating a managed memory pool to indicate no preferred location for the pool + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeDevice @@ -4226,6 +4247,12 @@ Data types used by CUDA Runtime This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeManaged + + + This allocation type is managed memory + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeMax .. autoclass:: cuda.bindings.runtime.cudaMemAllocationHandleType @@ -4363,6 +4390,74 @@ Data types used by CUDA Runtime Accessing CUDA arrays over the link supported + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrOnlyPartialNativeAtomicSupported + + + Only some CUDA-valid atomic operations over the link are supported. + +.. autoclass:: cuda.bindings.runtime.cudaAtomicOperation + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerAdd + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMin + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMax + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerIncrement + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerDecrement + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationAnd + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationOr + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationXOR + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationExchange + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationCAS + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatAdd + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMin + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMax + +.. autoclass:: cuda.bindings.runtime.cudaAtomicOperationCapability + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilitySigned + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityUnsigned + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityReduction + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar32 + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar64 + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar128 + + + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityVector32x4 + .. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleType .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd @@ -4700,10 +4795,10 @@ Data types used by CUDA Runtime Scope represented by a grid_group - .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeMultiGrid + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeReserved - Scope represented by a multi_grid_group + Reserved .. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags @@ -5248,6 +5343,20 @@ Data types used by CUDA Runtime Valid for launches. On devices where the L1 cache and shared memory use the same hardware resources, setting :py:obj:`~.cudaLaunchAttributeValue.sharedMemCarveout` to a percentage between 0-100 signals sets the shared memory carveout preference in percent of the total shared memory for that kernel launch. This attribute takes precedence over :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout`. This is only a hint, and the driver can choose a different configuration if required for the launch. + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling + + + Valid for streams, graph nodes, launches. This attribute is a hint to the CUDA runtime that the launch should attempt to make the kernel maximize its NVLINK utilization. + + + + When possible to honor this hint, CUDA will assume each block in the grid launch will carry out an even amount of NVLINK traffic, and make a best-effort attempt to adjust the kernel launch based on that assumption. + + This attribute is a hint only. CUDA makes no functional or performance guarantee. Its applicability can be affected by many different factors, including driver version (i.e. CUDA doesn't guarantee the performance characteristics will be maintained between driver versions or a driver update could alter or regress previously observed perf characteristics.) It also doesn't guarantee a successful result, i.e. applying the attribute may not improve the performance of either the targeted kernel or the encapsulating application. + + Valid values for :py:obj:`~.cudaLaunchAttributeValue.nvlinkUtilCentricScheduling` are 0 (disabled) and 1 (enabled). + .. autoclass:: cuda.bindings.runtime.cudaDeviceNumaConfig .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNone @@ -5268,6 +5377,13 @@ Data types used by CUDA Runtime Sent when the process has exceeded its device memory budget +.. autoclass:: cuda.bindings.runtime.cudaLogLevel + + .. autoattribute:: cuda.bindings.runtime.cudaLogLevel.cudaLogLevelError + + + .. autoattribute:: cuda.bindings.runtime.cudaLogLevel.cudaLogLevelWarning + .. autoclass:: cuda.bindings.runtime.cudaSurfaceBoundaryMode .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeZero @@ -5388,6 +5504,8 @@ Data types used by CUDA Runtime .. autoclass:: cuda.bindings.runtime.cudaAsyncCallbackHandle_t .. autoclass:: cuda.bindings.runtime.cudaAsyncNotificationInfo_t .. autoclass:: cuda.bindings.runtime.cudaAsyncCallback +.. autoclass:: cuda.bindings.runtime.cudaLogsCallbackHandle +.. autoclass:: cuda.bindings.runtime.cudaLogIterator .. autoclass:: cuda.bindings.runtime.cudaSurfaceObject_t .. autoclass:: cuda.bindings.runtime.cudaTextureObject_t .. autoattribute:: cuda.bindings.runtime.CUDA_EGL_MAX_PLANES @@ -5606,14 +5724,6 @@ Data types used by CUDA Runtime Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice call -.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPreSync - - If set, each kernel launched as part of :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution. - -.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPostSync - - If set, any subsequent work pushed in a stream that participated in a call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution. - .. autoattribute:: cuda.bindings.runtime.cudaArraySparsePropertiesSingleMipTail Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers @@ -5680,6 +5790,7 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeMemSyncDomain .. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributePreferredSharedMemoryCarveout .. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeDeviceUpdatableKernelNode +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeNvlinkUtilCentricScheduling .. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttrValue .. autoattribute:: cuda.bindings.runtime.cudaSurfaceType1D .. autoattribute:: cuda.bindings.runtime.cudaSurfaceType2D diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst index 23e1eca80..057a1c666 100644 --- a/cuda_bindings/docs/source/release.rst +++ b/cuda_bindings/docs/source/release.rst @@ -7,7 +7,8 @@ Release Notes .. toctree:: :maxdepth: 3 - 12.X.Y + 13.0.0 + 12.9.1 12.9.0 12.8.0 12.6.2 diff --git a/cuda_bindings/docs/source/release/12.X.Y-notes.rst b/cuda_bindings/docs/source/release/12.9.1-notes.rst similarity index 82% rename from cuda_bindings/docs/source/release/12.X.Y-notes.rst rename to cuda_bindings/docs/source/release/12.9.1-notes.rst index 80cd40530..881d49d32 100644 --- a/cuda_bindings/docs/source/release/12.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.1-notes.rst @@ -3,10 +3,10 @@ .. module:: cuda.bindings -``cuda-bindings`` 12.X.Y Release notes +``cuda-bindings`` 12.9.1 Release notes ====================================== -Released on MM DD, 2025 +Released on Aug 6, 2025 Highlights @@ -31,12 +31,17 @@ Highlights Bug fixes --------- +* Fix a library loading bug that preferred shared libraries without a SOVERSION. + Miscellaneous ------------- +* All Python bindings now have the GIL released when calling into the underlying C APIs. * Added PTX utilities including :func:`~utils.get_minimal_required_cuda_ver_from_ptx_ver` and :func:`~utils.get_ptx_ver`. * Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. +* Add a binding to ``nvvmGetErrorString()``. +* Build the bindings with Cython profile hooks disabled. Known issues diff --git a/cuda_bindings/docs/source/release/13.0.0-notes.rst b/cuda_bindings/docs/source/release/13.0.0-notes.rst new file mode 100644 index 000000000..3df3ca48a --- /dev/null +++ b/cuda_bindings/docs/source/release/13.0.0-notes.rst @@ -0,0 +1,52 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +.. module:: cuda.bindings + +``cuda-bindings`` 13.0.0 Release notes +====================================== + +Released on Aug 6, 2025 + + +Highlights +---------- + +* Support CUDA 13.0. + +* A utility module :mod:`cuda.bindings.utils` is added + + * Using ``int(cuda_obj)`` to retrieve the underlying address of a CUDA object is deprecated and + subject to future removal. Please switch to use :func:`~cuda.bindings.utils.get_cuda_native_handle` + instead. + +* The ``cuda.bindings.cufile`` Python module was added, wrapping the + `cuFile C APIs `_. + Supported on Linux only. + + * Currently using this module requires NumPy to be present. Any recent NumPy 1.x or 2.x should work. + +* Python bindings in every module, including ``driver``, ``runtime``, and ``nvrtc``, now have the GIL + released before calling the underlying C APIs. + + +Bug fixes +--------- + +* Fix a library loading bug that preferred shared libraries without a SOVERSION. + + +Miscellaneous +------------- + +* All Python bindings now have the GIL released when calling into the underlying C APIs. +* Added PTX utilities including :func:`~utils.get_minimal_required_cuda_ver_from_ptx_ver` and :func:`~utils.get_ptx_ver`. +* Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. +* Add a binding to ``nvvmGetErrorString()``. +* Build the bindings with Cython profile hooks disabled. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/docs/versions.json b/cuda_bindings/docs/versions.json index cc1299896..c174c4eee 100644 --- a/cuda_bindings/docs/versions.json +++ b/cuda_bindings/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", + "13.0.0" : "13.0.0", "12.9.0" : "12.9.0", "12.8.0" : "12.8.0", "12.6.2" : "12.6.2", diff --git a/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py b/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py index 2fa3ff0f6..4d3e557a3 100644 --- a/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py +++ b/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py @@ -1,17 +1,13 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import platform import numpy as np from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda import cuda +from cuda.bindings import driver as cuda clock_nvrtc = """\ extern "C" __global__ void timedReduction(const float *hinput, float *output, clock_t *timer) diff --git a/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py b/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py index c3cf369a1..fae5cb6ad 100644 --- a/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import sys import time @@ -13,7 +9,8 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart simpleCubemapTexture = """\ extern "C" diff --git a/cuda_bindings/examples/0_Introduction/simpleP2P_test.py b/cuda_bindings/examples/0_Introduction/simpleP2P_test.py index 5689db610..0f8337028 100644 --- a/cuda_bindings/examples/0_Introduction/simpleP2P_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleP2P_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import platform import sys @@ -13,7 +9,8 @@ from common import common from common.helper_cuda import checkCudaErrors -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart simplep2p = """\ extern "C" diff --git a/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py b/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py index 4db002029..db045be67 100644 --- a/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py +++ b/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import platform @@ -16,7 +12,8 @@ from common.helper_cuda import checkCudaErrors from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart simpleZeroCopy = """\ extern "C" diff --git a/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py b/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py index 64ae4d390..8ce984826 100644 --- a/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py +++ b/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import os import sys @@ -13,7 +9,8 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart systemWideAtomics = """\ #define LOOP_NUM 50 @@ -182,7 +179,8 @@ def main(): print("Unified Memory not supported on this device") return - if device_prop.computeMode == cudart.cudaComputeMode.cudaComputeModeProhibited: + computeMode = checkCudaErrors(cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeMode, dev_id)) + if computeMode == cudart.cudaComputeMode.cudaComputeModeProhibited: # This sample requires being run with a default or process exclusive mode print("This sample requires a device in either default or process exclusive mode") return diff --git a/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py b/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py index 81f589f0e..05e580999 100644 --- a/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py +++ b/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import sys @@ -13,7 +9,7 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV -from cuda import cuda +from cuda.bindings import driver as cuda vectorAddDrv = """\ /* Vector addition: C = A + B. @@ -44,7 +40,7 @@ def main(): checkCudaErrors(cuda.cuInit(0)) cuDevice = findCudaDeviceDRV() # Create context - cuContext = checkCudaErrors(cuda.cuCtxCreate(0, cuDevice)) + cuContext = checkCudaErrors(cuda.cuCtxCreate(None, 0, cuDevice)) uvaSupported = checkCudaErrors( cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice) diff --git a/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py b/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py index 3230b5071..4679dde38 100644 --- a/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py +++ b/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import platform @@ -14,7 +10,7 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV -from cuda import cuda +from cuda.bindings import driver as cuda vectorAddMMAP = """\ /* Vector addition: C = A + B. @@ -239,7 +235,7 @@ def main(): backingDevices = getBackingDevices(cuDevice) # Create context - cuContext = checkCudaErrors(cuda.cuCtxCreate(0, cuDevice)) + cuContext = checkCudaErrors(cuda.cuCtxCreate(None, 0, cuDevice)) kernelHelper = common.KernelHelper(vectorAddMMAP, int(cuDevice)) _VecAdd_kernel = kernelHelper.getFunction(b"VecAdd_kernel") diff --git a/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py b/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py index 4cba3ab07..7eb7a0b97 100644 --- a/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py +++ b/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import platform @@ -16,7 +12,8 @@ from common.helper_cuda import checkCudaErrors, findCudaDevice from common.helper_string import checkCmdLineFlag -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart streamOrderedAllocation = """\ /* Add two vectors on the GPU */ diff --git a/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py b/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py index b973d0181..8c94feb4a 100644 --- a/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import platform @@ -12,12 +8,12 @@ from enum import Enum import numpy as np -import pytest from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart blockSize = 16 @@ -1118,28 +1114,10 @@ def MatrixMultiply(dimsA, dimsB, kernel_number): return -1 -def checkKernelCompiles(): - kernel_headers = """\ - #line __LINE__ - #if __CUDA_ARCH__ >= 700 - #include - #endif - #include - #include - #include - """ - try: - common.KernelHelper(kernel_headers, findCudaDevice()) - except: - # Filters out test from automation for two reasons - # 1. Headers are not found - # 2. Incompatible device - return False - return True - - -@pytest.mark.skipif(not checkKernelCompiles(), reason="Automation filter against incompatible kernel") def main(): + common.pytest_skipif_cuda_include_not_found() + common.pytest_skipif_compute_capability_too_low(findCudaDevice(), (7, 0)) + print("[globalToShmemAsyncCopy] - Starting...") if platform.machine() == "qnx": diff --git a/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py b/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py index ee8343632..ecb8e84e6 100644 --- a/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import random as rnd @@ -13,7 +9,8 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart THREADS_PER_BLOCK = 512 GRAPH_LAUNCH_ITERATIONS = 3 diff --git a/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py b/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py index 4a6fafb76..8c2a0bc34 100644 --- a/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py +++ b/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import math import platform @@ -15,7 +11,8 @@ from common import common from common.helper_cuda import checkCudaErrors, findCudaDevice -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart conjugateGradientMultiBlockCG = """\ #line __LINE__ diff --git a/cuda_bindings/examples/common/common.py b/cuda_bindings/examples/common/common.py index ec55c1ac5..635493e88 100644 --- a/cuda_bindings/examples/common/common.py +++ b/cuda_bindings/examples/common/common.py @@ -1,27 +1,60 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import os import numpy as np from common.helper_cuda import checkCudaErrors -from cuda import cuda, cudart, nvrtc +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc +from cuda.bindings import runtime as cudart + + +def get_cuda_home(): + cuda_home = os.getenv("CUDA_HOME") + if cuda_home is None: + cuda_home = os.getenv("CUDA_PATH") + return cuda_home + + +def pytest_skipif_cuda_include_not_found(): + import pytest + + cuda_home = get_cuda_home() + if cuda_home is None: + pytest.skip("CUDA_HOME/CUDA_PATH not set") + cuda_include = os.path.join(cuda_home, "include") + if not os.path.exists(cuda_include): + pytest.skip(f"$CUDA_HOME/include does not exist: '{cuda_include}'") + + +def pytest_skipif_compute_capability_too_low(devID, required_cc_major_minor): + import pytest + + cc_major = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, devID) + ) + cc_minor = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, devID) + ) + have_cc_major_minor = (cc_major, cc_minor) + if have_cc_major_minor < required_cc_major_minor: + pytest.skip(f"cudaDevAttrComputeCapability too low: {have_cc_major_minor=!r}, {required_cc_major_minor=!r}") class KernelHelper: def __init__(self, code, devID): prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(code), b"sourceCode.cu", 0, None, None)) - CUDA_HOME = os.getenv("CUDA_HOME") - if CUDA_HOME is None: - CUDA_HOME = os.getenv("CUDA_PATH") - if CUDA_HOME is None: - raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") - include_dirs = os.path.join(CUDA_HOME, "include") + + cuda_home = get_cuda_home() + assert cuda_home is not None + cuda_include = os.path.join(cuda_home, "include") + assert os.path.isdir(cuda_include) + include_dirs = [cuda_include] + cccl_include = os.path.join(cuda_include, "cccl") + if os.path.isdir(cccl_include): + include_dirs.insert(0, cccl_include) # Initialize CUDA checkCudaErrors(cudart.cudaFree(0)) @@ -37,14 +70,16 @@ def __init__(self, code, devID): prefix = "sm" if use_cubin else "compute" arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii") + opts = [ + b"--fmad=true", + arch_arg, + b"--std=c++17", + b"-default-device", + ] + for inc_dir in include_dirs: + opts.append(f"--include-path={inc_dir}".encode()) + try: - opts = [ - b"--fmad=true", - arch_arg, - f"--include-path={include_dirs}".encode(), - b"--std=c++11", - b"-default-device", - ] checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, len(opts), opts)) except RuntimeError as err: logSize = checkCudaErrors(nvrtc.nvrtcGetProgramLogSize(prog)) diff --git a/cuda_bindings/examples/common/helper_cuda.py b/cuda_bindings/examples/common/helper_cuda.py index 6cc4026dd..d741eb54d 100644 --- a/cuda_bindings/examples/common/helper_cuda.py +++ b/cuda_bindings/examples/common/helper_cuda.py @@ -1,13 +1,11 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt -from cuda import cuda, cudart, nvrtc +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc +from cuda.bindings import runtime as cudart def _cudaGetErrorEnum(error): diff --git a/cuda_bindings/examples/common/helper_string.py b/cuda_bindings/examples/common/helper_string.py index 7677047a3..9f8e70a6c 100644 --- a/cuda_bindings/examples/common/helper_string.py +++ b/cuda_bindings/examples/common/helper_string.py @@ -1,10 +1,6 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import sys diff --git a/cuda_bindings/examples/extra/isoFDModelling_test.py b/cuda_bindings/examples/extra/isoFDModelling_test.py index 01e5f5714..f0b149a32 100644 --- a/cuda_bindings/examples/extra/isoFDModelling_test.py +++ b/cuda_bindings/examples/extra/isoFDModelling_test.py @@ -1,17 +1,14 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import time import numpy as np from common import common from common.helper_cuda import checkCudaErrors -from cuda import cuda, cudart +from cuda.bindings import driver as cuda +from cuda.bindings import runtime as cudart isoPropagator = """\ extern "C" @@ -243,7 +240,7 @@ def __init__(self, params, _dev): checkCudaErrors(cuda.cuInit(0)) self.cuDevice = checkCudaErrors(cuda.cuDeviceGet(_dev)) - self.context = checkCudaErrors(cuda.cuCtxCreate(0, self.cuDevice)) + self.context = checkCudaErrors(cuda.cuCtxCreate(None, 0, self.cuDevice)) self.waveOut = 0 self.waveIn = 0 self.streamCenter = checkCudaErrors(cuda.cuStreamCreate(0)) diff --git a/cuda_bindings/examples/extra/jit_program_test.py b/cuda_bindings/examples/extra/jit_program_test.py index 18835ec9d..eccbd86a6 100644 --- a/cuda_bindings/examples/extra/jit_program_test.py +++ b/cuda_bindings/examples/extra/jit_program_test.py @@ -1,15 +1,12 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + import ctypes import numpy as np -from cuda import cuda, nvrtc +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc def ASSERT_DRV(err): @@ -45,7 +42,7 @@ def main(): ASSERT_DRV(err) # Ctx - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) # Create program diff --git a/cuda_bindings/examples/extra/numba_emm_plugin.py b/cuda_bindings/examples/extra/numba_emm_plugin.py index 45015ada4..dcbf54132 100644 --- a/cuda_bindings/examples/extra/numba_emm_plugin.py +++ b/cuda_bindings/examples/extra/numba_emm_plugin.py @@ -1,10 +1,5 @@ -# Copyright 2021-2024 NVIDIA Corporation. All rights reserved. -# -# Please refer to the NVIDIA end user license agreement (EULA) associated -# with this source code for terms and conditions that govern your use of -# this software. Any use, reproduction, disclosure, or distribution of -# this software and related documentation outside the terms of the EULA -# is strictly prohibited. +# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE """Numba EMM Plugin using the CUDA Python Driver API. @@ -54,7 +49,6 @@ from ctypes import c_size_t -from numba import cuda from numba.cuda import ( GetIpcHandleMixin, HostOnlyCUDAMemoryManager, @@ -62,7 +56,8 @@ MemoryPointer, ) -from cuda import cuda as cuda_driver +from cuda.bindings import driver as cuda +from cuda.bindings import driver as cuda_driver # Python functions for allocation, deallocation, and memory info via the NVIDIA # CUDA Python Driver API diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index f1546e299..bd6471cb1 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -33,10 +33,11 @@ dependencies = [ [project.optional-dependencies] all = [ - "nvidia-cuda-nvcc-cu12", - "nvidia-cuda-nvrtc-cu12", - "nvidia-nvjitlink-cu12>=12.3", - "nvidia-cufile-cu12; sys_platform == 'linux'", + "nvidia-cuda-nvcc~=13.0", + "nvidia-cuda-nvrtc~=13.0", + "nvidia-nvjitlink~=13.0", + "nvidia-nvvm~=13.0", + "nvidia-cufile; sys_platform == 'linux'", ] test = [ diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 128220371..6b71d5ff7 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -382,79 +382,9 @@ def build_extension(self, ext): super().build_extension(ext) -################################################################################ -# Adapted from NVIDIA/numba-cuda -# TODO: Remove this block once we get rid of cuda.__version__ and the .pth files - -REDIRECTOR_PTH = "_cuda_bindings_redirector.pth" -REDIRECTOR_PY = "_cuda_bindings_redirector.py" -SITE_PACKAGES = pathlib.Path("site-packages") - - -class build_py_with_redirector(build_py): # noqa: N801 - """Include the redirector files in the generated wheel.""" - - def copy_redirector_file(self, source, destination="."): - destination = pathlib.Path(self.build_lib) / destination - self.copy_file(str(source), str(destination), preserve_mode=0) - - def run(self): - super().run() - self.copy_redirector_file(SITE_PACKAGES / REDIRECTOR_PTH) - self.copy_redirector_file(SITE_PACKAGES / REDIRECTOR_PY) - - def get_source_files(self): - src = super().get_source_files() - src.extend( - [ - str(SITE_PACKAGES / REDIRECTOR_PTH), - str(SITE_PACKAGES / REDIRECTOR_PY), - ] - ) - return src - - def get_output_mapping(self): - mapping = super().get_output_mapping() - build_lib = pathlib.Path(self.build_lib) - mapping[str(build_lib / REDIRECTOR_PTH)] = REDIRECTOR_PTH - mapping[str(build_lib / REDIRECTOR_PY)] = REDIRECTOR_PY - return mapping - - -class TopLevelFinderWithRedirector(_TopLevelFinder): - """Include the redirector files in the editable wheel.""" - - def get_implementation(self): - for item in super().get_implementation(): # noqa: UP028 - yield item - - with open(SITE_PACKAGES / REDIRECTOR_PTH) as f: - yield (REDIRECTOR_PTH, f.read()) - - with open(SITE_PACKAGES / REDIRECTOR_PY) as f: - yield (REDIRECTOR_PY, f.read()) - - -class editable_wheel_with_redirector(editable_wheel): - def _select_strategy(self, name, tag, build_lib): - # The default mode is "lenient" - others are "strict" and "compat". - # "compat" is deprecated. "strict" creates a tree of links to files in - # the repo. It could be implemented, but we only handle the default - # case for now. - if self.mode is not None and self.mode != "lenient": - raise RuntimeError(f"Only lenient mode is supported for editable install. Current mode is {self.mode}") - - return TopLevelFinderWithRedirector(self.distribution, name) - - -################################################################################ - - cmdclass = { "bdist_wheel": WheelsBuildExtensions, "build_ext": ParallelBuildExtensions, - "build_py": build_py_with_redirector, - "editable_wheel": editable_wheel_with_redirector, } # ---------------------------------------------------------------------- diff --git a/cuda_bindings/site-packages/_cuda_bindings_redirector.pth b/cuda_bindings/site-packages/_cuda_bindings_redirector.pth deleted file mode 100644 index 9371fb364..000000000 --- a/cuda_bindings/site-packages/_cuda_bindings_redirector.pth +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import _cuda_bindings_redirector diff --git a/cuda_bindings/site-packages/_cuda_bindings_redirector.py b/cuda_bindings/site-packages/_cuda_bindings_redirector.py deleted file mode 100644 index 13b3c04cf..000000000 --- a/cuda_bindings/site-packages/_cuda_bindings_redirector.py +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import sys -from types import ModuleType - - -# Make sure 'cuda' is importable as a namespace package -import cuda - - -class LazyCudaModule(ModuleType): - - def __getattr__(self, name): - if name == '__version__': - import warnings - warnings.warn( - "accessing cuda.__version__ is deprecated, " "please switch to use cuda.bindings.__version__ instead", - FutureWarning, - stacklevel=2, - ) - from cuda.bindings import __version__ - - return __version__ - - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") - - -# Patch in LazyCudaModule for `cuda` -sys.modules['cuda'].__class__ = LazyCudaModule diff --git a/cuda_bindings/tests/cython/test_ccuda.pyx b/cuda_bindings/tests/cython/test_ccuda.pyx index edeb5e12a..2d47bed4d 100644 --- a/cuda_bindings/tests/cython/test_ccuda.pyx +++ b/cuda_bindings/tests/cython/test_ccuda.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # distutils: language=c++ @@ -6,9 +6,7 @@ from libc.string cimport ( memset, memcmp ) -# TODO: update to new module once the old ones are removed, we use the -# tests to cover backward compatibility. -cimport cuda.ccuda as ccuda +cimport cuda.bindings.cydriver as ccuda def test_ccuda_memcpy(): # Init CUDA @@ -22,7 +20,7 @@ def test_ccuda_memcpy(): # Construct context cdef ccuda.CUcontext ctx - err = ccuda.cuCtxCreate(&ctx, 0, device) + err = ccuda.cuCtxCreate(&ctx, NULL, 0, device) assert(err == 0) # Allocate dev memory diff --git a/cuda_bindings/tests/cython/test_ccudart.pyx b/cuda_bindings/tests/cython/test_ccudart.pyx index 76d8578fa..7f80c8f56 100644 --- a/cuda_bindings/tests/cython/test_ccudart.pyx +++ b/cuda_bindings/tests/cython/test_ccudart.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # distutils: language=c++ @@ -6,9 +6,7 @@ from libc.string cimport ( memset, memcmp ) -# TODO: update to new module once the old ones are removed, we use the -# tests to cover backward compatibility. -cimport cuda.ccudart as ccudart +cimport cuda.bindings.cyruntime as ccudart def test_ccudart_memcpy(): # Allocate dev memory @@ -38,9 +36,9 @@ def test_ccudart_memcpy(): err = ccudart.cudaFree(dptr) assert(err == ccudart.cudaSuccess) -from cuda.ccudart cimport dim3 -from cuda.ccudart cimport cudaMemAllocationHandleType -from cuda.ccudart cimport CUuuid, cudaUUID_t +from cuda.bindings.cyruntime cimport dim3 +from cuda.bindings.cyruntime cimport cudaMemAllocationHandleType +from cuda.bindings.cyruntime cimport CUuuid, cudaUUID_t cdef extern from *: """ diff --git a/cuda_bindings/tests/cython/test_interoperability_cython.pyx b/cuda_bindings/tests/cython/test_interoperability_cython.pyx index 289f9c3c4..0531ae587 100644 --- a/cuda_bindings/tests/cython/test_interoperability_cython.pyx +++ b/cuda_bindings/tests/cython/test_interoperability_cython.pyx @@ -1,17 +1,15 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # distutils: language=c++ from libc.stdlib cimport calloc, free -import cuda.cuda as cuda -import cuda.cudart as cudart +import cuda.bindings.driver as cuda +import cuda.bindings.runtime as cudart import numpy as np import pytest -# TODO: update to new module once the old ones are removed, we use the -# tests to cover backward compatibility. -cimport cuda.ccuda as ccuda -cimport cuda.ccudart as ccudart +cimport cuda.bindings.cydriver as ccuda +cimport cuda.bindings.cyruntime as ccudart def supportsMemoryPool(): @@ -24,7 +22,7 @@ def test_interop_stream(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) # DRV to RT @@ -52,7 +50,7 @@ def test_interop_event(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) # DRV to RT @@ -80,7 +78,7 @@ def test_interop_graph(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) # DRV to RT @@ -108,7 +106,7 @@ def test_interop_graphNode(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) # DRV to RT @@ -146,7 +144,7 @@ def test_interop_memPool(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) # DRV to RT @@ -175,7 +173,7 @@ def test_interop_graphExec(): assert(err_dr == cuda.CUresult.CUDA_SUCCESS) err_dr, device = cuda.cuDeviceGet(0) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert(err_dr == cuda.CUresult.CUDA_SUCCESS) cdef ccuda.CUgraph* graph_dr = calloc(1, sizeof(ccuda.CUgraph)) diff --git a/cuda_bindings/tests/test_cuda.py b/cuda_bindings/tests/test_cuda.py index da3c6dec6..8479c2dc0 100644 --- a/cuda_bindings/tests/test_cuda.py +++ b/cuda_bindings/tests/test_cuda.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import platform @@ -8,8 +8,8 @@ import numpy as np import pytest -import cuda.cuda as cuda -import cuda.cudart as cudart +import cuda.bindings.driver as cuda +import cuda.bindings.runtime as cudart from cuda.bindings import driver @@ -49,7 +49,7 @@ def test_cuda_memcpy(): assert err == cuda.CUresult.CUDA_SUCCESS # Construct context - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS # Allocate dev memory @@ -91,7 +91,7 @@ def test_cuda_array(): err, arr = cuda.cuArrayCreate(desc) assert err == cuda.CUresult.CUDA_ERROR_INVALID_CONTEXT or err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS # Desciption not filled @@ -120,7 +120,7 @@ def test_cuda_repr_primitive(): assert str(device) == "" assert int(device) == 0 - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS assert str(ctx).startswith(" 0 @@ -186,7 +186,7 @@ def test_cuda_repr_pointer(): assert err == cuda.CUresult.CUDA_SUCCESS # Test 1: Classes representing pointers - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS assert str(ctx).startswith(" 0 @@ -213,7 +213,7 @@ def test_cuda_uuid_list_access(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, uuid = cuda.cuDeviceGetUuid(device) @@ -236,9 +236,9 @@ def test_cuda_uuid_list_access(): def test_cuda_cuModuleLoadDataEx(): (err,) = cuda.cuInit(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, dev = cuda.cuDeviceGet(0) + err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, dev) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS option_keys = [ @@ -328,7 +328,7 @@ def test_cuda_memPool_attr(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS poolProps = cuda.CUmemPoolProps() @@ -399,7 +399,7 @@ def test_cuda_pointer_attr(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, ptr = cuda.cuMemAllocManaged(0x1000, cuda.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL.value) assert err == cuda.CUresult.CUDA_SUCCESS @@ -456,23 +456,31 @@ def test_cuda_mem_range_attr(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS + size = 0x1000 + location_device = cuda.CUmemLocation() + location_device.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + location_device.id = int(device) + location_cpu = cuda.CUmemLocation() + location_cpu.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + location_cpu.id = int(cuda.CU_DEVICE_CPU) + err, ptr = cuda.cuMemAllocManaged(size, cuda.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL.value) assert err == cuda.CUresult.CUDA_SUCCESS - (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY, device) + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY, location_device) assert err == cuda.CUresult.CUDA_SUCCESS - (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_PREFERRED_LOCATION, cuda.CU_DEVICE_CPU) + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_PREFERRED_LOCATION, location_cpu) assert err == cuda.CUresult.CUDA_SUCCESS - (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, cuda.CU_DEVICE_CPU) + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, location_cpu) assert err == cuda.CUresult.CUDA_SUCCESS err, concurrentSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, device ) assert err == cuda.CUresult.CUDA_SUCCESS if concurrentSupported: - (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, device) + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, location_device) assert err == cuda.CUresult.CUDA_SUCCESS expected_values_list = ([1, -1, [0, -1, -2], -2],) else: @@ -520,7 +528,7 @@ def test_cuda_graphMem_attr(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, stream = cuda.cuStreamCreate(0) @@ -585,7 +593,7 @@ def test_cuda_coredump_attr(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS attr_list = [None] * 6 @@ -625,7 +633,7 @@ def test_get_error_name_and_string(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) @@ -652,7 +660,7 @@ def test_device_get_name(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS p = subprocess.check_output( @@ -685,7 +693,7 @@ def test_profiler(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS (err,) = cuda.cuProfilerStart() assert err == cuda.CUresult.CUDA_SUCCESS @@ -774,7 +782,7 @@ def test_graph_poly(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, stream = cuda.cuStreamCreate(0) assert err == cuda.CUresult.CUDA_SUCCESS @@ -808,7 +816,7 @@ def test_graph_poly(): memsetParams.memset.height = 1 memsetParams.memset.dst = device memsetParams.memset.value = 1 - err, node = cuda.cuGraphAddNode(graph, None, 0, memsetParams) + err, node = cuda.cuGraphAddNode(graph, None, None, 0, memsetParams) assert err == cuda.CUresult.CUDA_SUCCESS nodes += [node] @@ -823,7 +831,7 @@ def test_graph_poly(): memcpyParams.memcpy.copyParams.WidthInBytes = size memcpyParams.memcpy.copyParams.Height = 1 memcpyParams.memcpy.copyParams.Depth = 1 - err, node = cuda.cuGraphAddNode(graph, None, 0, memcpyParams) + err, node = cuda.cuGraphAddNode(graph, None, None, 0, memcpyParams) assert err == cuda.CUresult.CUDA_SUCCESS nodes += [node] @@ -892,7 +900,7 @@ def test_cuDeviceGetDevResource(): err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS err, resource_in = cuda.cuDeviceGetDevResource(device, cuda.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM) - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, res, count, rem = cuda.cuDevSmResourceSplitByCount(0, resource_in, 0, 2) @@ -920,7 +928,7 @@ def test_conditional(): assert err == cuda.CUresult.CUDA_SUCCESS err, device = cuda.cuDeviceGet(0) assert err == cuda.CUresult.CUDA_SUCCESS - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS err, graph = cuda.cuGraphCreate(0) @@ -937,7 +945,7 @@ def test_conditional(): assert len(params.conditional.phGraph_out) == 1 assert int(params.conditional.phGraph_out[0]) == 0 - err, node = cuda.cuGraphAddNode(graph, None, 0, params) + err, node = cuda.cuGraphAddNode(graph, None, None, 0, params) assert err == cuda.CUresult.CUDA_SUCCESS assert len(params.conditional.phGraph_out) == 1 diff --git a/cuda_bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py index 70803c077..21e902733 100644 --- a/cuda_bindings/tests/test_cudart.py +++ b/cuda_bindings/tests/test_cudart.py @@ -7,8 +7,8 @@ import numpy as np import pytest -import cuda.cuda as cuda -import cuda.cudart as cudart +import cuda.bindings.driver as cuda +import cuda.bindings.runtime as cudart from cuda.bindings import runtime @@ -292,86 +292,98 @@ def test_cudart_cudaGetDeviceProperties(): err, prop = cudart.cudaGetDeviceProperties(0) assertSuccess(err) attrs = [ - "accessPolicyMaxWindowSize", - "asyncEngineCount", - "canMapHostMemory", - "canUseHostPointerForRegisteredMem", - "clockRate", - "computeMode", - "computePreemptionSupported", - "concurrentKernels", - "concurrentManagedAccess", - "cooperativeLaunch", - "cooperativeMultiDeviceLaunch", - "deviceOverlap", - "directManagedMemAccessFromHost", - "getPtr", - "globalL1CacheSupported", - "hostNativeAtomicSupported", - "integrated", - "isMultiGpuBoard", - "kernelExecTimeoutEnabled", - "l2CacheSize", - "localL1CacheSupported", + "name", + "uuid", "luid", "luidDeviceNodeMask", - "major", - "managedMemory", - "maxBlocksPerMultiProcessor", + "totalGlobalMem", + "sharedMemPerBlock", + "regsPerBlock", + "warpSize", + "memPitch", + "maxThreadsPerBlock", + "maxThreadsDim", "maxGridSize", - "maxSurface1D", - "maxSurface1DLayered", - "maxSurface2D", - "maxSurface2DLayered", - "maxSurface3D", - "maxSurfaceCubemap", - "maxSurfaceCubemapLayered", + "totalConstMem", + "major", + "minor", + "textureAlignment", + "texturePitchAlignment", + "multiProcessorCount", + "integrated", + "canMapHostMemory", "maxTexture1D", - "maxTexture1DLayered", - "maxTexture1DLinear", "maxTexture1DMipmap", "maxTexture2D", - "maxTexture2DGather", - "maxTexture2DLayered", - "maxTexture2DLinear", "maxTexture2DMipmap", + "maxTexture2DLinear", + "maxTexture2DGather", "maxTexture3D", "maxTexture3DAlt", "maxTextureCubemap", + "maxTexture1DLayered", + "maxTexture2DLayered", "maxTextureCubemapLayered", - "maxThreadsDim", - "maxThreadsPerBlock", - "maxThreadsPerMultiProcessor", - "memPitch", - "memoryBusWidth", - "memoryClockRate", - "minor", - "multiGpuBoardGroupID", - "multiProcessorCount", - "name", - "pageableMemoryAccess", - "pageableMemoryAccessUsesHostPageTables", + "maxSurface1D", + "maxSurface2D", + "maxSurface3D", + "maxSurface1DLayered", + "maxSurface2DLayered", + "maxSurfaceCubemap", + "maxSurfaceCubemapLayered", + "surfaceAlignment", + "concurrentKernels", + "ECCEnabled", "pciBusID", "pciDeviceID", "pciDomainID", + "tccDriver", + "asyncEngineCount", + "unifiedAddressing", + "memoryBusWidth", + "l2CacheSize", "persistingL2CacheMaxSize", - "regsPerBlock", + "maxThreadsPerMultiProcessor", + "streamPrioritiesSupported", + "globalL1CacheSupported", + "localL1CacheSupported", + "sharedMemPerMultiprocessor", "regsPerMultiprocessor", - "reservedSharedMemPerBlock", - "sharedMemPerBlock", + "managedMemory", + "isMultiGpuBoard", + "multiGpuBoardGroupID", + "hostNativeAtomicSupported", + "pageableMemoryAccess", + "concurrentManagedAccess", + "computePreemptionSupported", + "canUseHostPointerForRegisteredMem", + "cooperativeLaunch", "sharedMemPerBlockOptin", - "sharedMemPerMultiprocessor", - "singleToDoublePrecisionPerfRatio", - "streamPrioritiesSupported", - "surfaceAlignment", - "tccDriver", - "textureAlignment", - "texturePitchAlignment", - "totalConstMem", - "totalGlobalMem", - "unifiedAddressing", - "uuid", - "warpSize", + "pageableMemoryAccessUsesHostPageTables", + "directManagedMemAccessFromHost", + "maxBlocksPerMultiProcessor", + "accessPolicyMaxWindowSize", + "reservedSharedMemPerBlock", + "hostRegisterSupported", + "sparseCudaArraySupported", + "hostRegisterReadOnlySupported", + "timelineSemaphoreInteropSupported", + "memoryPoolsSupported", + "gpuDirectRDMASupported", + "gpuDirectRDMAFlushWritesOptions", + "gpuDirectRDMAWritesOrdering", + "memoryPoolSupportedHandleTypes", + "deferredMappingCudaArraySupported", + "ipcEventSupported", + "clusterLaunch", + "unifiedFunctionPointers", + "deviceNumaConfig", + "deviceNumaId", + "mpsEnabled", + "hostNumaId", + "gpuPciDeviceID", + "gpuPciSubsystemID", + "hostNumaMultinodeIpcSupported", ] for attr in attrs: assert hasattr(prop, attr) @@ -1362,7 +1374,7 @@ def test_cudart_conditional(): assert len(params.conditional.phGraph_out) == 1 assert int(params.conditional.phGraph_out[0]) == 0 - err, node = cudart.cudaGraphAddNode(graph, None, 0, params) + err, node = cudart.cudaGraphAddNode(graph, None, None, 0, params) assertSuccess(err) assert len(params.conditional.phGraph_out) == 1 diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 02053a2a2..6d5ef5699 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -45,17 +45,14 @@ def cufile_env_json(): """Set CUFILE_ENV_PATH_JSON environment variable for async tests.""" original_value = os.environ.get("CUFILE_ENV_PATH_JSON") - # Use /etc/cufile.json if it exists, otherwise fallback to cufile.json in tests directory - if os.path.exists("/etc/cufile.json"): - config_path = "/etc/cufile.json" - else: - # Get absolute path to cufile.json in the same directory as this test file - test_dir = os.path.dirname(os.path.abspath(__file__)) - config_path = os.path.join(test_dir, "cufile.json") - + # Get absolute path to cufile.json in the same directory as this test file + test_dir = os.path.dirname(os.path.abspath(__file__)) + config_path = os.path.join(test_dir, "cufile.json") logging.info(f"Using cuFile config: {config_path}") + assert os.path.isfile(config_path) os.environ["CUFILE_ENV_PATH_JSON"] = config_path yield + # Restore original value or remove if it wasn't set if original_value is not None: os.environ["CUFILE_ENV_PATH_JSON"] = original_value diff --git a/cuda_bindings/tests/test_interoperability.py b/cuda_bindings/tests/test_interoperability.py index cbebe7b56..db8fd4d56 100644 --- a/cuda_bindings/tests/test_interoperability.py +++ b/cuda_bindings/tests/test_interoperability.py @@ -1,11 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import numpy as np import pytest -import cuda.cuda as cuda -import cuda.cudart as cudart +import cuda.bindings.driver as cuda +import cuda.bindings.runtime as cudart def supportsMemoryPool(): @@ -18,7 +18,7 @@ def test_interop_stream(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # DRV to RT @@ -42,7 +42,7 @@ def test_interop_event(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # DRV to RT @@ -66,7 +66,7 @@ def test_interop_graph(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # DRV to RT @@ -90,7 +90,7 @@ def test_interop_graphNode(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, graph = cuda.cuGraphCreate(0) @@ -119,7 +119,7 @@ def test_interop_userObject(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # cudaUserObject_t @@ -134,7 +134,7 @@ def test_interop_function(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # cudaFunction_t @@ -150,7 +150,7 @@ def test_interop_memPool(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS # DRV to RT @@ -174,7 +174,7 @@ def test_interop_graphExec(): assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, device = cuda.cuDeviceGet(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS - err_dr, ctx = cuda.cuCtxCreate(0, device) + err_dr, ctx = cuda.cuCtxCreate(None, 0, device) assert err_dr == cuda.CUresult.CUDA_SUCCESS err_dr, graph = cuda.cuGraphCreate(0) assert err_dr == cuda.CUresult.CUDA_SUCCESS @@ -209,7 +209,7 @@ def test_interop_deviceptr(): assert err == cuda.CUresult.CUDA_SUCCESS # Construct context - err, ctx = cuda.cuCtxCreate(0, device) + err, ctx = cuda.cuCtxCreate(None, 0, device) assert err == cuda.CUresult.CUDA_SUCCESS # Allocate dev memory diff --git a/cuda_bindings/tests/test_kernelParams.py b/cuda_bindings/tests/test_kernelParams.py index 94edc71ac..c55b6fb90 100644 --- a/cuda_bindings/tests/test_kernelParams.py +++ b/cuda_bindings/tests/test_kernelParams.py @@ -1,11 +1,13 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import ctypes import numpy as np -from cuda import cuda, cudart, nvrtc +import cuda.bindings.driver as cuda +import cuda.bindings.nvrtc as nvrtc +import cuda.bindings.runtime as cudart def ASSERT_DRV(err): @@ -72,7 +74,7 @@ def test_kernelParams_empty(): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) kernelString = """\ @@ -147,7 +149,7 @@ def kernelParams_basic(use_ctypes_as_values): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) if use_ctypes_as_values: @@ -437,7 +439,7 @@ def test_kernelParams_types_cuda(): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice @@ -567,7 +569,7 @@ def test_kernelParams_struct_custom(): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice @@ -646,7 +648,7 @@ def kernelParams_buffer_protocol_ctypes_common(pass_by_address): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice @@ -758,7 +760,7 @@ def test_kernelParams_buffer_protocol_numpy(): ASSERT_DRV(err) err, cuDevice = cuda.cuDeviceGet(0) ASSERT_DRV(err) - err, context = cuda.cuCtxCreate(0, cuDevice) + err, context = cuda.cuCtxCreate(None, 0, cuDevice) ASSERT_DRV(err) err, uvaSupported = cuda.cuDeviceGetAttribute( cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice diff --git a/cuda_bindings/tests/test_nvjitlink.py b/cuda_bindings/tests/test_nvjitlink.py index e2ff43e5b..42b93c3dd 100644 --- a/cuda_bindings/tests/test_nvjitlink.py +++ b/cuda_bindings/tests/test_nvjitlink.py @@ -6,8 +6,8 @@ from cuda.bindings import nvjitlink, nvrtc # Establish a handful of compatible architectures and PTX versions to test with -ARCHITECTURES = ["sm_60", "sm_75", "sm_80", "sm_90"] -PTX_VERSIONS = ["5.0", "6.4", "7.0", "8.5"] +ARCHITECTURES = ["sm_75", "sm_80", "sm_90", "sm_100"] +PTX_VERSIONS = ["6.4", "7.0", "8.5", "8.8"] PTX_HEADER = """\ diff --git a/cuda_bindings/tests/test_nvrtc.py b/cuda_bindings/tests/test_nvrtc.py index e24655f33..51202e64d 100644 --- a/cuda_bindings/tests/test_nvrtc.py +++ b/cuda_bindings/tests/test_nvrtc.py @@ -1,9 +1,9 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import pytest -from cuda import nvrtc +from cuda.bindings import nvrtc def ASSERT_DRV(err): diff --git a/cuda_core/cuda/core/experimental/_device.py b/cuda_core/cuda/core/experimental/_device.py index f7c760f5d..0f7b551cc 100644 --- a/cuda_core/cuda/core/experimental/_device.py +++ b/cuda_core/cuda/core/experimental/_device.py @@ -1067,7 +1067,7 @@ def uuid(self) -> str: """ driver_ver = handle_return(driver.cuDriverGetVersion()) - if driver_ver >= 11040: + if 11040 <= driver_ver < 13000: uuid = handle_return(driver.cuDeviceGetUuid_v2(self._id)) else: uuid = handle_return(driver.cuDeviceGetUuid(self._id)) diff --git a/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py b/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py index b77e1d2cf..c961e82ac 100644 --- a/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py +++ b/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py @@ -1,291 +1,313 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# To regenerate the dictionary below, navigate to: -# https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES -# (Chrome was used before, but probably it works with other browsers, too.) -# Search for: -# enum CUresult -# With the mouse, select the entire region with the enum definitions: -# CUDA_SUCCESS = 0 -# ... -# CUDA_ERROR_UNKNOWN = 999 -# This indicates that an unknown internal error has occurred. -# Paste into a file, e.g. raw.txt -# python ../../../../../toolshed/reformat_cuda_enums_from_web_as_py.py raw.txt > raw.py -# ruff format raw.py -# Copy raw.py into this file (discarding the `DATA = {`, `}` lines). +# To regenerate the dictionary below run: +# ../../../../../toolshed/reformat_cuda_enums_as_py.py /usr/local/cuda/include/cuda.h +# Replace the dictionary below with the output. # Also update the CUDA Toolkit version number below. -# Done. -# CUDA Toolkit v12.9.0 +# ruff: noqa: E501 +# CUDA Toolkit v13.0.0 DRIVER_CU_RESULT_EXPLANATIONS = { 0: ( - "The API call returned with no errors. In the case of query calls, this also means that the operation" - " being queried is complete (see cuEventQuery() and cuStreamQuery())." + "The API call returned with no errors. In the case of query calls, this" + " also means that the operation being queried is complete (see" + " ::cuEventQuery() and ::cuStreamQuery())." ), 1: ( - "This indicates that one or more of the parameters passed to the API call is not within an acceptable" - " range of values." + "This indicates that one or more of the parameters passed to the API call" + " is not within an acceptable range of values." ), 2: ( - "The API call failed because it was unable to allocate enough memory or other resources to perform " - "the requested operation." + "The API call failed because it was unable to allocate enough memory or" + " other resources to perform the requested operation." ), 3: ( - "This indicates that the CUDA driver has not been initialized with cuInit() or that initialization has failed." + "This indicates that the CUDA driver has not been initialized with" + " ::cuInit() or that initialization has failed." ), 4: "This indicates that the CUDA driver is in the process of shutting down.", 5: ( - "This indicates profiler is not initialized for this run. This can happen when the application is " - "running with external profiling tools like visual profiler." + "This indicates profiler is not initialized for this run. This can" + " happen when the application is running with external profiling tools" + " like visual profiler." ), 6: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to " - "enable/disable the profiling via cuProfilerStart or cuProfilerStop without initialization." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to attempt to enable/disable the profiling via ::cuProfilerStart or" + " ::cuProfilerStop without initialization." ), 7: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStart() " - "when profiling is already enabled." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to call cuProfilerStart() when profiling is already enabled." ), 8: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStop() " - "when profiling is already disabled." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to call cuProfilerStop() when profiling is already disabled." ), 34: ( - "This indicates that the CUDA driver that the application has loaded is a stub library. Applications " - "that run with the stub rather than a real driver loaded will result in CUDA API returning this " - "error." + "This indicates that the CUDA driver that the application has loaded is a" + " stub library. Applications that run with the stub rather than a real" + " driver loaded will result in CUDA API returning this error." + ), + 36: ( + "This indicates that the API call requires a newer CUDA driver than the one" + " currently installed. Users should install an updated NVIDIA CUDA driver" + " to allow the API call to succeed." ), 46: ( - "This indicates that requested CUDA device is unavailable at the current time. Devices are often " - "unavailable due to use of CU_COMPUTEMODE_EXCLUSIVE_PROCESS or CU_COMPUTEMODE_PROHIBITED." + "This indicates that requested CUDA device is unavailable at the current" + " time. Devices are often unavailable due to use of" + " ::CU_COMPUTEMODE_EXCLUSIVE_PROCESS or ::CU_COMPUTEMODE_PROHIBITED." ), - 100: "This indicates that no CUDA-capable devices were detected by the installed CUDA driver.", + 100: ("This indicates that no CUDA-capable devices were detected by the installed CUDA driver."), 101: ( - "This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA " - "device or that the action requested is invalid for the specified device." + "This indicates that the device ordinal supplied by the user does not" + " correspond to a valid CUDA device or that the action requested is" + " invalid for the specified device." ), 102: "This error indicates that the Grid license is not applied.", 200: ("This indicates that the device kernel image is invalid. This can also indicate an invalid CUDA module."), 201: ( - "This most frequently indicates that there is no context bound to the current thread. This can also " - "be returned if the context passed to an API call is not a valid handle (such as a context that has " - "had cuCtxDestroy() invoked on it). This can also be returned if a user mixes different API versions " - "(i.e. 3010 context with 3020 API calls). See cuCtxGetApiVersion() for more details. This can also be" - " returned if the green context passed to an API call was not converted to a CUcontext using " - "cuCtxFromGreenCtx API." + "This most frequently indicates that there is no context bound to the" + " current thread. This can also be returned if the context passed to an" + " API call is not a valid handle (such as a context that has had" + " ::cuCtxDestroy() invoked on it). This can also be returned if a user" + " mixes different API versions (i.e. 3010 context with 3020 API calls)." + " See ::cuCtxGetApiVersion() for more details." + " This can also be returned if the green context passed to an API call" + " was not converted to a ::CUcontext using ::cuCtxFromGreenCtx API." ), 202: ( - "This error return is deprecated as of CUDA 3.2. It is no longer an error to attempt to push the " - "active context via cuCtxPushCurrent(). This indicated that the context being supplied as a parameter" - " to the API call was already the active context." + "This indicated that the context being supplied as a parameter to the" + " API call was already the active context." + " This error return is deprecated as of CUDA 3.2. It is no longer an" + " error to attempt to push the active context via ::cuCtxPushCurrent()." ), 205: "This indicates that a map or register operation has failed.", 206: "This indicates that an unmap or unregister operation has failed.", - 207: "This indicates that the specified array is currently mapped and thus cannot be destroyed.", + 207: ("This indicates that the specified array is currently mapped and thus cannot be destroyed."), 208: "This indicates that the resource is already mapped.", 209: ( - "This indicates that there is no kernel image available that is suitable for the device. This can " - "occur when a user specifies code generation options for a particular CUDA source file that do not " - "include the corresponding device configuration." + "This indicates that there is no kernel image available that is suitable" + " for the device. This can occur when a user specifies code generation" + " options for a particular CUDA source file that do not include the" + " corresponding device configuration." ), 210: "This indicates that a resource has already been acquired.", 211: "This indicates that a resource is not mapped.", - 212: "This indicates that a mapped resource is not available for access as an array.", - 213: "This indicates that a mapped resource is not available for access as a pointer.", - 214: "This indicates that an uncorrectable ECC error was detected during execution.", - 215: "This indicates that the CUlimit passed to the API call is not supported by the active device.", + 212: ("This indicates that a mapped resource is not available for access as an array."), + 213: ("This indicates that a mapped resource is not available for access as a pointer."), + 214: ("This indicates that an uncorrectable ECC error was detected during execution."), + 215: ("This indicates that the ::CUlimit passed to the API call is not supported by the active device."), 216: ( - "This indicates that the CUcontext passed to the API call can only be bound to a single CPU thread at" - " a time but is already bound to a CPU thread." + "This indicates that the ::CUcontext passed to the API call can" + " only be bound to a single CPU thread at a time but is already" + " bound to a CPU thread." ), - 217: "This indicates that peer access is not supported across the given devices.", + 217: ("This indicates that peer access is not supported across the given devices."), 218: "This indicates that a PTX JIT compilation failed.", 219: "This indicates an error with OpenGL or DirectX context.", - 220: "This indicates that an uncorrectable NVLink error was detected during the execution.", + 220: ("This indicates that an uncorrectable NVLink error was detected during the execution."), 221: "This indicates that the PTX JIT compiler library was not found.", 222: "This indicates that the provided PTX was compiled with an unsupported toolchain.", 223: "This indicates that the PTX JIT compilation was disabled.", - 224: ("This indicates that the CUexecAffinityType passed to the API call is not supported by the active device."), + 224: ("This indicates that the ::CUexecAffinityType passed to the API call is not supported by the active device."), 225: ( "This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize." ), 226: ( - "This indicates that an exception occurred on the device that is now contained by the GPU's error " - "containment capability. Common causes are - a. Certain types of invalid accesses of peer GPU memory " - "over nvlink b. Certain classes of hardware errors This leaves the process in an inconsistent state " - "and any further CUDA work will return the same error. To continue using CUDA, the process must be " - "terminated and relaunched." + "This indicates that an exception occurred on the device that is now" + " contained by the GPU's error containment capability. Common causes are -" + " a. Certain types of invalid accesses of peer GPU memory over nvlink" + " b. Certain classes of hardware errors" + " This leaves the process in an inconsistent state and any further CUDA" + " work will return the same error. To continue using CUDA, the process must" + " be terminated and relaunched." ), 300: ( - "This indicates that the device kernel source is invalid. This includes compilation/linker errors " - "encountered in device code or user error." + "This indicates that the device kernel source is invalid. This includes" + " compilation/linker errors encountered in device code or user error." ), 301: "This indicates that the file specified was not found.", 302: "This indicates that a link to a shared object failed to resolve.", 303: "This indicates that initialization of a shared object failed.", 304: "This indicates that an OS call failed.", 400: ( - "This indicates that a resource handle passed to the API call was not valid. Resource handles are " - "opaque types like CUstream and CUevent." + "This indicates that a resource handle passed to the API call was not" + " valid. Resource handles are opaque types like ::CUstream and ::CUevent." ), 401: ( - "This indicates that a resource required by the API call is not in a valid state to perform the " - "requested operation." + "This indicates that a resource required by the API call is not in a" + " valid state to perform the requested operation." ), 402: ( - "This indicates an attempt was made to introspect an object in a way that would discard semantically " - "important information. This is either due to the object using funtionality newer than the API " - "version used to introspect it or omission of optional return arguments." + "This indicates an attempt was made to introspect an object in a way that" + " would discard semantically important information. This is either due to" + " the object using funtionality newer than the API version used to" + " introspect it or omission of optional return arguments." ), 500: ( - "This indicates that a named symbol was not found. Examples of symbols are global/constant variable " - "names, driver function names, texture names, and surface names." + "This indicates that a named symbol was not found. Examples of symbols" + " are global/constant variable names, driver function names, texture names," + " and surface names." ), 600: ( - "This indicates that asynchronous operations issued previously have not completed yet. This result is" - " not actually an error, but must be indicated differently than CUDA_SUCCESS (which indicates " - "completion). Calls that may return this value include cuEventQuery() and cuStreamQuery()." + "This indicates that asynchronous operations issued previously have not" + " completed yet. This result is not actually an error, but must be indicated" + " differently than ::CUDA_SUCCESS (which indicates completion). Calls that" + " may return this value include ::cuEventQuery() and ::cuStreamQuery()." ), 700: ( - "While executing a kernel, the device encountered a load or store instruction on an invalid memory " - "address. This leaves the process in an inconsistent state and any further CUDA work will return the " - "same error. To continue using CUDA, the process must be terminated and relaunched." + "While executing a kernel, the device encountered a" + " load or store instruction on an invalid memory address." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 701: ( - "This indicates that a launch did not occur because it did not have appropriate resources. This error" - " usually indicates that the user has attempted to pass too many arguments to the device kernel, or " - "the kernel launch specifies too many threads for the kernel's register count. Passing arguments of " - "the wrong size (i.e. a 64-bit pointer when a 32-bit int is expected) is equivalent to passing too " - "many arguments and can also result in this error." + "This indicates that a launch did not occur because it did not have" + " appropriate resources. This error usually indicates that the user has" + " attempted to pass too many arguments to the device kernel, or the" + " kernel launch specifies too many threads for the kernel's register" + " count. Passing arguments of the wrong size (i.e. a 64-bit pointer" + " when a 32-bit int is expected) is equivalent to passing too many" + " arguments and can also result in this error." ), 702: ( - "This indicates that the device kernel took too long to execute. This can only occur if timeouts are " - "enabled - see the device attribute CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information. " - "This leaves the process in an inconsistent state and any further CUDA work will return the same " - "error. To continue using CUDA, the process must be terminated and relaunched." + "This indicates that the device kernel took too long to execute. This can" + " only occur if timeouts are enabled - see the device attribute" + " ::CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), - 703: "This error indicates a kernel launch that uses an incompatible texturing mode.", + 703: ("This error indicates a kernel launch that uses an incompatible texturing mode."), 704: ( - "This error indicates that a call to cuCtxEnablePeerAccess() is trying to re-enable peer access to a " - "context which has already had peer access to it enabled." + "This error indicates that a call to ::cuCtxEnablePeerAccess() is" + " trying to re-enable peer access to a context which has already" + " had peer access to it enabled." ), 705: ( - "This error indicates that cuCtxDisablePeerAccess() is trying to disable peer access which has not " - "been enabled yet via cuCtxEnablePeerAccess()." + "This error indicates that ::cuCtxDisablePeerAccess() is" + " trying to disable peer access which has not been enabled yet" + " via ::cuCtxEnablePeerAccess()." ), - 708: "This error indicates that the primary context for the specified device has already been initialized.", + 708: ("This error indicates that the primary context for the specified device has already been initialized."), 709: ( - "This error indicates that the context current to the calling thread has been destroyed using " - "cuCtxDestroy, or is a primary context which has not yet been initialized." + "This error indicates that the context current to the calling thread" + " has been destroyed using ::cuCtxDestroy, or is a primary context which" + " has not yet been initialized." ), 710: ( - "A device-side assert triggered during kernel execution. The context cannot be used anymore, and must" - " be destroyed. All existing device memory allocations from this context are invalid and must be " - "reconstructed if the program is to continue using CUDA." + "A device-side assert triggered during kernel execution. The context" + " cannot be used anymore, and must be destroyed. All existing device" + " memory allocations from this context are invalid and must be" + " reconstructed if the program is to continue using CUDA." ), 711: ( - "This error indicates that the hardware resources required to enable peer access have been exhausted " - "for one or more of the devices passed to cuCtxEnablePeerAccess()." + "This error indicates that the hardware resources required to enable" + " peer access have been exhausted for one or more of the devices" + " passed to ::cuCtxEnablePeerAccess()." ), - 712: ("This error indicates that the memory range passed to cuMemHostRegister() has already been registered."), + 712: ("This error indicates that the memory range passed to ::cuMemHostRegister() has already been registered."), 713: ( - "This error indicates that the pointer passed to cuMemHostUnregister() does not correspond to any " - "currently registered memory region." + "This error indicates that the pointer passed to ::cuMemHostUnregister()" + " does not correspond to any currently registered memory region." ), 714: ( - "While executing a kernel, the device encountered a stack error. This can be due to stack corruption " - "or exceeding the stack size limit. This leaves the process in an inconsistent state and any further " - "CUDA work will return the same error. To continue using CUDA, the process must be terminated and " - "relaunched." + "While executing a kernel, the device encountered a stack error." + " This can be due to stack corruption or exceeding the stack size limit." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 715: ( - "While executing a kernel, the device encountered an illegal instruction. This leaves the process in " - "an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, " - "the process must be terminated and relaunched." + "While executing a kernel, the device encountered an illegal instruction." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 716: ( - "While executing a kernel, the device encountered a load or store instruction on a memory address " - "which is not aligned. This leaves the process in an inconsistent state and any further CUDA work " - "will return the same error. To continue using CUDA, the process must be terminated and relaunched." + "While executing a kernel, the device encountered a load or store instruction" + " on a memory address which is not aligned." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 717: ( - "While executing a kernel, the device encountered an instruction which can only operate on memory " - "locations in certain address spaces (global, shared, or local), but was supplied a memory address " - "not belonging to an allowed address space. This leaves the process in an inconsistent state and any " - "further CUDA work will return the same error. To continue using CUDA, the process must be terminated" + "While executing a kernel, the device encountered an instruction" + " which can only operate on memory locations in certain address spaces" + " (global, shared, or local), but was supplied a memory address not" + " belonging to an allowed address space." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" " and relaunched." ), 718: ( - "While executing a kernel, the device program counter wrapped its address space. This leaves the " - "process in an inconsistent state and any further CUDA work will return the same error. To continue " - "using CUDA, the process must be terminated and relaunched." + "While executing a kernel, the device program counter wrapped its address space." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 719: ( - "An exception occurred on the device while executing a kernel. Common causes include dereferencing an" - " invalid device pointer and accessing out of bounds shared memory. Less common cases can be system " - "specific - more information about these cases can be found in the system specific user guide. This " - "leaves the process in an inconsistent state and any further CUDA work will return the same error. To" - " continue using CUDA, the process must be terminated and relaunched." + "An exception occurred on the device while executing a kernel. Common" + " causes include dereferencing an invalid device pointer and accessing" + " out of bounds shared memory. Less common cases can be system specific - more" + " information about these cases can be found in the system specific user guide." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 720: ( - "This error indicates that the number of blocks launched per grid for a kernel that was launched via " - "either cuLaunchCooperativeKernel or cuLaunchCooperativeKernelMultiDevice exceeds the maximum number " - "of blocks as allowed by cuOccupancyMaxActiveBlocksPerMultiprocessor or " - "cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors as " - "specified by the device attribute CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT." + "This error indicates that the number of blocks launched per grid for a kernel that was" + " launched via either ::cuLaunchCooperativeKernel or ::cuLaunchCooperativeKernelMultiDevice" + " exceeds the maximum number of blocks as allowed by ::cuOccupancyMaxActiveBlocksPerMultiprocessor" + " or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors" + " as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT." ), 721: ( - "An exception occurred on the device while exiting a kernel using tensor memory: the tensor memory " - "was not completely deallocated. This leaves the process in an inconsistent state and any further " - "CUDA work will return the same error. To continue using CUDA, the process must be terminated and " - "relaunched." + "An exception occurred on the device while exiting a kernel using tensor memory: the" + " tensor memory was not completely deallocated. This leaves the process in an inconsistent" + " state and any further CUDA work will return the same error. To continue using CUDA, the" + " process must be terminated and relaunched." ), 800: "This error indicates that the attempted operation is not permitted.", - 801: "This error indicates that the attempted operation is not supported on the current system or device.", + 801: ("This error indicates that the attempted operation is not supported on the current system or device."), 802: ( - "This error indicates that the system is not yet ready to start any CUDA work. To continue using " - "CUDA, verify the system configuration is in a valid state and all required driver daemons are " - "actively running. More information about this error can be found in the system specific user guide." + "This error indicates that the system is not yet ready to start any CUDA" + " work. To continue using CUDA, verify the system configuration is in a" + " valid state and all required driver daemons are actively running." + " More information about this error can be found in the system specific" + " user guide." ), 803: ( - "This error indicates that there is a mismatch between the versions of the display driver and the " - "CUDA driver. Refer to the compatibility documentation for supported versions." + "This error indicates that there is a mismatch between the versions of" + " the display driver and the CUDA driver. Refer to the compatibility documentation" + " for supported versions." ), 804: ( - "This error indicates that the system was upgraded to run with forward compatibility but the visible " - "hardware detected by CUDA does not support this configuration. Refer to the compatibility " - "documentation for the supported hardware matrix or ensure that only supported hardware is visible " - "during initialization via the CUDA_VISIBLE_DEVICES environment variable." - ), - 805: ("This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server."), - 806: ("This error indicates that the remote procedural call between the MPS server and the MPS client failed."), + "This error indicates that the system was upgraded to run with forward compatibility" + " but the visible hardware detected by CUDA does not support this configuration." + " Refer to the compatibility documentation for the supported hardware matrix or ensure" + " that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES" + " environment variable." + ), + 805: "This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server.", + 806: "This error indicates that the remote procedural call between the MPS server and the MPS client failed.", 807: ( - "This error indicates that the MPS server is not ready to accept new MPS client requests. This error " - "can be returned when the MPS server is in the process of recovering from a fatal failure." + "This error indicates that the MPS server is not ready to accept new MPS client requests." + " This error can be returned when the MPS server is in the process of recovering from a fatal failure." ), 808: "This error indicates that the hardware resources required to create MPS client have been exhausted.", - 809: ( - "This error indicates the the hardware resources required to support device connections have been exhausted." - ), - 810: ( - "This error indicates that the MPS client has been terminated by the server. To continue using CUDA, " - "the process must be terminated and relaunched." - ), - 811: ( - "This error indicates that the module is using CUDA Dynamic Parallelism, but the current " - "configuration, like MPS, does not support it." - ), - 812: ( - "This error indicates that a module contains an unsupported interaction between different versions of" - " CUDA Dynamic Parallelism." - ), - 900: "This error indicates that the operation is not permitted when the stream is capturing.", + 809: "This error indicates the the hardware resources required to support device connections have been exhausted.", + 810: "This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated and relaunched.", + 811: "This error indicates that the module is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it.", + 812: "This error indicates that a module contains an unsupported interaction between different versions of CUDA Dynamic Parallelism.", + 900: ("This error indicates that the operation is not permitted when the stream is capturing."), 901: ( - "This error indicates that the current capture sequence on the stream has been invalidated due to a " - "previous error." + "This error indicates that the current capture sequence on the stream" + " has been invalidated due to a previous error." ), 902: ( "This error indicates that the operation would have resulted in a merge of two independent capture sequences." @@ -293,34 +315,37 @@ 903: "This error indicates that the capture was not initiated in this stream.", 904: ("This error indicates that the capture sequence contains a fork that was not joined to the primary stream."), 905: ( - "This error indicates that a dependency would have been created which crosses the capture sequence " - "boundary. Only implicit in-stream ordering dependencies are allowed to cross the boundary." + "This error indicates that a dependency would have been created which" + " crosses the capture sequence boundary. Only implicit in-stream ordering" + " dependencies are allowed to cross the boundary." ), 906: ("This error indicates a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy."), 907: ( - "This error indicates that the operation is not permitted on an event which was last recorded in a " - "capturing stream." + "This error indicates that the operation is not permitted on an event which" + " was last recorded in a capturing stream." ), 908: ( - "A stream capture sequence not initiated with the CU_STREAM_CAPTURE_MODE_RELAXED argument to " - "cuStreamBeginCapture was passed to cuStreamEndCapture in a different thread." + "A stream capture sequence not initiated with the ::CU_STREAM_CAPTURE_MODE_RELAXED" + " argument to ::cuStreamBeginCapture was passed to ::cuStreamEndCapture in a" + " different thread." ), 909: "This error indicates that the timeout specified for the wait operation has lapsed.", 910: ( - "This error indicates that the graph update was not performed because it included changes which " - "violated constraints specific to instantiated graph update." + "This error indicates that the graph update was not performed because it included" + " changes which violated constraints specific to instantiated graph update." ), 911: ( - "This indicates that an async error has occurred in a device outside of CUDA. If CUDA was waiting for" - " an external device's signal before consuming shared data, the external device signaled an error " - "indicating that the data is not valid for consumption. This leaves the process in an inconsistent " - "state and any further CUDA work will return the same error. To continue using CUDA, the process must" - " be terminated and relaunched." + "This indicates that an async error has occurred in a device outside of CUDA." + " If CUDA was waiting for an external device's signal before consuming shared data," + " the external device signaled an error indicating that the data is not valid for" + " consumption. This leaves the process in an inconsistent state and any further CUDA" + " work will return the same error. To continue using CUDA, the process must be" + " terminated and relaunched." ), 912: "Indicates a kernel launch error due to cluster misconfiguration.", - 913: "Indiciates a function handle is not loaded when calling an API that requires a loaded function.", - 914: "This error indicates one or more resources passed in are not valid resource types for the operation.", - 915: "This error indicates one or more resources are insufficient or non-applicable for the operation.", - 916: "This error indicates that an error happened during the key rotation sequence.", + 913: ("Indiciates a function handle is not loaded when calling an API that requires a loaded function."), + 914: ("This error indicates one or more resources passed in are not valid resource types for the operation."), + 915: ("This error indicates one or more resources are insufficient or non-applicable for the operation."), + 916: ("This error indicates that an error happened during the key rotation sequence."), 999: "This indicates that an unknown internal error has occurred.", } diff --git a/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py b/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py index afebacefb..126897f2b 100644 --- a/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py +++ b/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py @@ -1,290 +1,313 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# To regenerate the dictionary below, navigate to: -# https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES -# (Chrome was used before, but probably it works with other browsers, too.) -# Search for: -# enum cudaError -# With the mouse, select the entire region with the enum definitions: -# cudaSuccess = 0 -# ... -# cudaErrorApiFailureBase = 10000 -# Paste into a file, e.g. raw.txt -# python ../../../../../toolshed/reformat_cuda_enums_from_web_as_py.py raw.txt > raw.py -# ruff format raw.py -# Copy raw.py into this file (discarding the `DATA = {`, `}` lines). -# Apply this manual fix: -# - 10000: "MISSING EXPLANATION", -# + 10000: "Pseudo code.", +# To regenerate the dictionary below run: +# ../../../../../toolshed/reformat_cuda_enums_as_py.py /usr/local/cuda/include/driver_types.h +# Replace the dictionary below with the output. # Also update the CUDA Toolkit version number below. -# Done. -# CUDA Toolkit v12.9.0 +# ruff: noqa: E501 +# CUDA Toolkit v13.0.0 RUNTIME_CUDA_ERROR_EXPLANATIONS = { 0: ( - "The API call returned with no errors. In the case of query calls, this also means that the operation" - " being queried is complete (see cudaEventQuery() and cudaStreamQuery())." + "The API call returned with no errors. In the case of query calls, this" + " also means that the operation being queried is complete (see" + " ::cudaEventQuery() and ::cudaStreamQuery())." ), 1: ( - "This indicates that one or more of the parameters passed to the API call is not within an acceptable" - " range of values." + "This indicates that one or more of the parameters passed to the API call" + " is not within an acceptable range of values." ), 2: ( - "The API call failed because it was unable to allocate enough memory or other resources to perform " - "the requested operation." + "The API call failed because it was unable to allocate enough memory or" + " other resources to perform the requested operation." ), - 3: "The API call failed because the CUDA driver and runtime could not be initialized.", + 3: ("The API call failed because the CUDA driver and runtime could not be initialized."), 4: ( - "This indicates that a CUDA Runtime API call cannot be executed because it is being called during " - "process shut down, at a point in time after CUDA driver has been unloaded." + "This indicates that a CUDA Runtime API call cannot be executed because" + " it is being called during process shut down, at a point in time after" + " CUDA driver has been unloaded." ), 5: ( - "This indicates profiler is not initialized for this run. This can happen when the application is " - "running with external profiling tools like visual profiler." + "This indicates profiler is not initialized for this run. This can" + " happen when the application is running with external profiling tools" + " like visual profiler." ), 6: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to " - "enable/disable the profiling via cudaProfilerStart or cudaProfilerStop without initialization." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to attempt to enable/disable the profiling via ::cudaProfilerStart or" + " ::cudaProfilerStop without initialization." ), 7: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to call cudaProfilerStart()" - " when profiling is already enabled." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to call cudaProfilerStart() when profiling is already enabled." ), 8: ( - "This error return is deprecated as of CUDA 5.0. It is no longer an error to call cudaProfilerStop() " - "when profiling is already disabled." + "This error return is deprecated as of CUDA 5.0. It is no longer an error" + " to call cudaProfilerStop() when profiling is already disabled." ), 9: ( - "This indicates that a kernel launch is requesting resources that can never be satisfied by the " - "current device. Requesting more shared memory per block than the device supports will trigger this " - "error, as will requesting too many threads or blocks. See cudaDeviceProp for more device " - "limitations." + "This indicates that a kernel launch is requesting resources that can" + " never be satisfied by the current device. Requesting more shared memory" + " per block than the device supports will trigger this error, as will" + " requesting too many threads or blocks. See ::cudaDeviceProp for more" + " device limitations." ), 12: ( - "This indicates that one or more of the pitch-related parameters passed to the API call is not within" - " the acceptable range for pitch." + "This indicates that one or more of the pitch-related parameters passed" + " to the API call is not within the acceptable range for pitch." ), 13: ("This indicates that the symbol name/identifier passed to the API call is not a valid name or identifier."), 16: ( - "This error return is deprecated as of CUDA 10.1. This indicates that at least one host pointer " - "passed to the API call is not a valid host pointer." + "This indicates that at least one host pointer passed to the API call is" + " not a valid host pointer." + " This error return is deprecated as of CUDA 10.1." ), 17: ( - "This error return is deprecated as of CUDA 10.1. This indicates that at least one device pointer " - "passed to the API call is not a valid device pointer." + "This indicates that at least one device pointer passed to the API call is" + " not a valid device pointer." + " This error return is deprecated as of CUDA 10.1." ), - 18: "This indicates that the texture passed to the API call is not a valid texture.", + 18: ("This indicates that the texture passed to the API call is not a valid texture."), 19: ( - "This indicates that the texture binding is not valid. This occurs if you call " - "cudaGetTextureAlignmentOffset() with an unbound texture." + "This indicates that the texture binding is not valid. This occurs if you" + " call ::cudaGetTextureAlignmentOffset() with an unbound texture." ), 20: ( - "This indicates that the channel descriptor passed to the API call is not valid. This occurs if the " - "format is not one of the formats specified by cudaChannelFormatKind, or if one of the dimensions is " - "invalid." + "This indicates that the channel descriptor passed to the API call is not" + " valid. This occurs if the format is not one of the formats specified by" + " ::cudaChannelFormatKind, or if one of the dimensions is invalid." ), 21: ( - "This indicates that the direction of the memcpy passed to the API call is not one of the types " - "specified by cudaMemcpyKind." + "This indicates that the direction of the memcpy passed to the API call is" + " not one of the types specified by ::cudaMemcpyKind." ), 22: ( - "This error return is deprecated as of CUDA 3.1. Variables in constant memory may now have their " - "address taken by the runtime via cudaGetSymbolAddress(). This indicated that the user has taken the " - "address of a constant variable, which was forbidden up until the CUDA 3.1 release." + "This indicated that the user has taken the address of a constant variable," + " which was forbidden up until the CUDA 3.1 release." + " This error return is deprecated as of CUDA 3.1. Variables in constant" + " memory may now have their address taken by the runtime via" + " ::cudaGetSymbolAddress()." ), 23: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. This indicated that a texture fetch was not able to be performed. This was previously used " - "for device emulation of texture operations." + "This indicated that a texture fetch was not able to be performed." + " This was previously used for device emulation of texture operations." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 24: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. This indicated that a texture was not bound for access. This was previously used for device" - " emulation of texture operations." + "This indicated that a texture was not bound for access." + " This was previously used for device emulation of texture operations." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 25: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. This indicated that a synchronization operation had failed. This was previously used for " - "some device emulation functions." + "This indicated that a synchronization operation had failed." + " This was previously used for some device emulation functions." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 26: ( - "This indicates that a non-float texture was being accessed with linear filtering. This is not " - "supported by CUDA." + "This indicates that a non-float texture was being accessed with linear" + " filtering. This is not supported by CUDA." ), 27: ( - "This indicates that an attempt was made to read an unsupported data type as a normalized float. This" - " is not supported by CUDA." + "This indicates that an attempt was made to read an unsupported data type as a" + " normalized float. This is not supported by CUDA." ), 28: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. Mixing of device and device emulation code was not allowed." + "Mixing of device and device emulation code was not allowed." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 31: ( - "This error return is deprecated as of CUDA 4.1. This indicates that the API call is not yet " - "implemented. Production releases of CUDA will never return this error." + "This indicates that the API call is not yet implemented. Production" + " releases of CUDA will never return this error." + " This error return is deprecated as of CUDA 4.1." ), 32: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. This indicated that an emulated device pointer exceeded the 32-bit address range." + "This indicated that an emulated device pointer exceeded the 32-bit address" + " range." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 34: ( - "This indicates that the CUDA driver that the application has loaded is a stub library. Applications " - "that run with the stub rather than a real driver loaded will result in CUDA API returning this " - "error." + "This indicates that the CUDA driver that the application has loaded is a" + " stub library. Applications that run with the stub rather than a real" + " driver loaded will result in CUDA API returning this error." ), 35: ( - "This indicates that the installed NVIDIA CUDA driver is older than the CUDA runtime library. This is" - " not a supported configuration. Users should install an updated NVIDIA display driver to allow the " - "application to run." + "This indicates that the installed NVIDIA CUDA driver is older than the" + " CUDA runtime library. This is not a supported configuration. Users should" + " install an updated NVIDIA display driver to allow the application to run." ), 36: ( - "This indicates that the API call requires a newer CUDA driver than the one currently installed. " - "Users should install an updated NVIDIA CUDA driver to allow the API call to succeed." + "This indicates that the API call requires a newer CUDA driver than the one" + " currently installed. Users should install an updated NVIDIA CUDA driver" + " to allow the API call to succeed." ), - 37: "This indicates that the surface passed to the API call is not a valid surface.", + 37: ("This indicates that the surface passed to the API call is not a valid surface."), 43: ( - "This indicates that multiple global or constant variables (across separate CUDA source files in the " - "application) share the same string name." + "This indicates that multiple global or constant variables (across separate" + " CUDA source files in the application) share the same string name." ), 44: ( - "This indicates that multiple textures (across separate CUDA source files in the application) share " - "the same string name." + "This indicates that multiple textures (across separate CUDA source" + " files in the application) share the same string name." ), 45: ( - "This indicates that multiple surfaces (across separate CUDA source files in the application) share " - "the same string name." + "This indicates that multiple surfaces (across separate CUDA source" + " files in the application) share the same string name." ), 46: ( - "This indicates that all CUDA devices are busy or unavailable at the current time. Devices are often " - "busy/unavailable due to use of cudaComputeModeProhibited, cudaComputeModeExclusiveProcess, or when " - "long running CUDA kernels have filled up the GPU and are blocking new work from starting. They can " - "also be unavailable due to memory constraints on a device that already has active CUDA work being " - "performed." + "This indicates that all CUDA devices are busy or unavailable at the current" + " time. Devices are often busy/unavailable due to use of" + " ::cudaComputeModeProhibited, ::cudaComputeModeExclusiveProcess, or when long" + " running CUDA kernels have filled up the GPU and are blocking new work" + " from starting. They can also be unavailable due to memory constraints" + " on a device that already has active CUDA work being performed." ), 49: ( - "This indicates that the current context is not compatible with this the CUDA Runtime. This can only " - "occur if you are using CUDA Runtime/Driver interoperability and have created an existing Driver " - "context using the driver API. The Driver context may be incompatible either because the Driver " - "context was created using an older version of the API, because the Runtime API call expects a " - "primary driver context and the Driver context is not primary, or because the Driver context has been" - ' destroyed. Please see Interactions with the CUDA Driver API" for more information.' + "This indicates that the current context is not compatible with this" + " the CUDA Runtime. This can only occur if you are using CUDA" + " Runtime/Driver interoperability and have created an existing Driver" + " context using the driver API. The Driver context may be incompatible" + " either because the Driver context was created using an older version" + " of the API, because the Runtime API call expects a primary driver" + " context and the Driver context is not primary, or because the Driver" + ' context has been destroyed. Please see CUDART_DRIVER "Interactions' + ' with the CUDA Driver API" for more information.' ), 52: ( - "The device function being invoked (usually via cudaLaunchKernel()) was not previously configured via" - " the cudaConfigureCall() function." + "The device function being invoked (usually via ::cudaLaunchKernel()) was not" + " previously configured via the ::cudaConfigureCall() function." ), 53: ( - "This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 " - "release. This indicated that a previous kernel launch failed. This was previously used for device " - "emulation of kernel launches." + "This indicated that a previous kernel launch failed. This was previously" + " used for device emulation of kernel launches." + " This error return is deprecated as of CUDA 3.1. Device emulation mode was" + " removed with the CUDA 3.1 release." ), 65: ( - "This error indicates that a device runtime grid launch did not occur because the depth of the child " - "grid would exceed the maximum supported number of nested grid launches." + "This error indicates that a device runtime grid launch did not occur" + " because the depth of the child grid would exceed the maximum supported" + " number of nested grid launches." ), 66: ( - "This error indicates that a grid launch did not occur because the kernel uses file-scoped textures " - "which are unsupported by the device runtime. Kernels launched via the device runtime only support " - "textures created with the Texture Object API's." + "This error indicates that a grid launch did not occur because the kernel" + " uses file-scoped textures which are unsupported by the device runtime." + " Kernels launched via the device runtime only support textures created with" + " the Texture Object API's." ), 67: ( - "This error indicates that a grid launch did not occur because the kernel uses file-scoped surfaces " - "which are unsupported by the device runtime. Kernels launched via the device runtime only support " - "surfaces created with the Surface Object API's." + "This error indicates that a grid launch did not occur because the kernel" + " uses file-scoped surfaces which are unsupported by the device runtime." + " Kernels launched via the device runtime only support surfaces created with" + " the Surface Object API's." ), 68: ( - "This error indicates that a call to cudaDeviceSynchronize made from the device runtime failed " - "because the call was made at grid depth greater than than either the default (2 levels of grids) or " - "user specified device limit cudaLimitDevRuntimeSyncDepth. To be able to synchronize on launched " - "grids at a greater depth successfully, the maximum nested depth at which cudaDeviceSynchronize will " - "be called must be specified with the cudaLimitDevRuntimeSyncDepth limit to the cudaDeviceSetLimit " - "api before the host-side launch of a kernel using the device runtime. Keep in mind that additional " - "levels of sync depth require the runtime to reserve large amounts of device memory that cannot be " - "used for user allocations. Note that cudaDeviceSynchronize made from device runtime is only " - "supported on devices of compute capability < 9.0." + "This error indicates that a call to ::cudaDeviceSynchronize made from" + " the device runtime failed because the call was made at grid depth greater" + " than than either the default (2 levels of grids) or user specified device" + " limit ::cudaLimitDevRuntimeSyncDepth. To be able to synchronize on" + " launched grids at a greater depth successfully, the maximum nested" + " depth at which ::cudaDeviceSynchronize will be called must be specified" + " with the ::cudaLimitDevRuntimeSyncDepth limit to the ::cudaDeviceSetLimit" + " api before the host-side launch of a kernel using the device runtime." + " Keep in mind that additional levels of sync depth require the runtime" + " to reserve large amounts of device memory that cannot be used for" + " user allocations. Note that ::cudaDeviceSynchronize made from device" + " runtime is only supported on devices of compute capability < 9.0." ), 69: ( - "This error indicates that a device runtime grid launch failed because the launch would exceed the " - "limit cudaLimitDevRuntimePendingLaunchCount. For this launch to proceed successfully, " - "cudaDeviceSetLimit must be called to set the cudaLimitDevRuntimePendingLaunchCount to be higher than" - " the upper bound of outstanding launches that can be issued to the device runtime. Keep in mind that" - " raising the limit of pending device runtime launches will require the runtime to reserve device " - "memory that cannot be used for user allocations." - ), - 98: "The requested device function does not exist or is not compiled for the proper device architecture.", - 100: "This indicates that no CUDA-capable devices were detected by the installed CUDA driver.", + "This error indicates that a device runtime grid launch failed because" + " the launch would exceed the limit ::cudaLimitDevRuntimePendingLaunchCount." + " For this launch to proceed successfully, ::cudaDeviceSetLimit must be" + " called to set the ::cudaLimitDevRuntimePendingLaunchCount to be higher" + " than the upper bound of outstanding launches that can be issued to the" + " device runtime. Keep in mind that raising the limit of pending device" + " runtime launches will require the runtime to reserve device memory that" + " cannot be used for user allocations." + ), + 98: ("The requested device function does not exist or is not compiled for the proper device architecture."), + 100: ("This indicates that no CUDA-capable devices were detected by the installed CUDA driver."), 101: ( - "This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA " - "device or that the action requested is invalid for the specified device." + "This indicates that the device ordinal supplied by the user does not" + " correspond to a valid CUDA device or that the action requested is" + " invalid for the specified device." ), 102: "This indicates that the device doesn't have a valid Grid License.", 103: ( - "By default, the CUDA runtime may perform a minimal set of self-tests, as well as CUDA driver tests, " - "to establish the validity of both. Introduced in CUDA 11.2, this error return indicates that at " - "least one of these tests has failed and the validity of either the runtime or the driver could not " - "be established." + "By default, the CUDA runtime may perform a minimal set of self-tests," + " as well as CUDA driver tests, to establish the validity of both." + " Introduced in CUDA 11.2, this error return indicates that at least one" + " of these tests has failed and the validity of either the runtime" + " or the driver could not be established." ), 127: "This indicates an internal startup failure in the CUDA runtime.", 200: "This indicates that the device kernel image is invalid.", 201: ( - "This most frequently indicates that there is no context bound to the current thread. This can also " - "be returned if the context passed to an API call is not a valid handle (such as a context that has " - "had cuCtxDestroy() invoked on it). This can also be returned if a user mixes different API versions " - "(i.e. 3010 context with 3020 API calls). See cuCtxGetApiVersion() for more details." + "This most frequently indicates that there is no context bound to the" + " current thread. This can also be returned if the context passed to an" + " API call is not a valid handle (such as a context that has had" + " ::cuCtxDestroy() invoked on it). This can also be returned if a user" + " mixes different API versions (i.e. 3010 context with 3020 API calls)." + " See ::cuCtxGetApiVersion() for more details." ), 205: "This indicates that the buffer object could not be mapped.", 206: "This indicates that the buffer object could not be unmapped.", - 207: "This indicates that the specified array is currently mapped and thus cannot be destroyed.", + 207: ("This indicates that the specified array is currently mapped and thus cannot be destroyed."), 208: "This indicates that the resource is already mapped.", 209: ( - "This indicates that there is no kernel image available that is suitable for the device. This can " - "occur when a user specifies code generation options for a particular CUDA source file that do not " - "include the corresponding device configuration." + "This indicates that there is no kernel image available that is suitable" + " for the device. This can occur when a user specifies code generation" + " options for a particular CUDA source file that do not include the" + " corresponding device configuration." ), 210: "This indicates that a resource has already been acquired.", 211: "This indicates that a resource is not mapped.", - 212: "This indicates that a mapped resource is not available for access as an array.", - 213: "This indicates that a mapped resource is not available for access as a pointer.", - 214: "This indicates that an uncorrectable ECC error was detected during execution.", - 215: "This indicates that the cudaLimit passed to the API call is not supported by the active device.", + 212: ("This indicates that a mapped resource is not available for access as an array."), + 213: ("This indicates that a mapped resource is not available for access as a pointer."), + 214: ("This indicates that an uncorrectable ECC error was detected during execution."), + 215: ("This indicates that the ::cudaLimit passed to the API call is not supported by the active device."), 216: ( - "This indicates that a call tried to access an exclusive-thread device that is already in use by a " - "different thread." + "This indicates that a call tried to access an exclusive-thread device that" + " is already in use by a different thread." ), - 217: "This error indicates that P2P access is not supported across the given devices.", + 217: ("This error indicates that P2P access is not supported across the given devices."), 218: ( - "A PTX compilation failed. The runtime may fall back to compiling PTX if an application does not " - "contain a suitable binary for the current device." + "A PTX compilation failed. The runtime may fall back to compiling PTX if" + " an application does not contain a suitable binary for the current device." ), 219: "This indicates an error with the OpenGL or DirectX context.", - 220: "This indicates that an uncorrectable NVLink error was detected during the execution.", + 220: ("This indicates that an uncorrectable NVLink error was detected during the execution."), 221: ( - "This indicates that the PTX JIT compiler library was not found. The JIT Compiler library is used for" - " PTX compilation. The runtime may fall back to compiling PTX if an application does not contain a " - "suitable binary for the current device." + "This indicates that the PTX JIT compiler library was not found. The JIT Compiler" + " library is used for PTX compilation. The runtime may fall back to compiling PTX" + " if an application does not contain a suitable binary for the current device." ), 222: ( - "This indicates that the provided PTX was compiled with an unsupported toolchain. The most common " - "reason for this, is the PTX was generated by a compiler newer than what is supported by the CUDA " - "driver and PTX JIT compiler." + "This indicates that the provided PTX was compiled with an unsupported toolchain." + " The most common reason for this, is the PTX was generated by a compiler newer" + " than what is supported by the CUDA driver and PTX JIT compiler." ), 223: ( - "This indicates that the JIT compilation was disabled. The JIT compilation compiles PTX. The runtime " - "may fall back to compiling PTX if an application does not contain a suitable binary for the current " - "device." + "This indicates that the JIT compilation was disabled. The JIT compilation compiles" + " PTX. The runtime may fall back to compiling PTX if an application does not contain" + " a suitable binary for the current device." ), 224: "This indicates that the provided execution affinity is not supported by the device.", 225: ( "This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize." ), 226: ( - "This indicates that an exception occurred on the device that is now contained by the GPU's error " - "containment capability. Common causes are - a. Certain types of invalid accesses of peer GPU memory " - "over nvlink b. Certain classes of hardware errors This leaves the process in an inconsistent state " - "and any further CUDA work will return the same error. To continue using CUDA, the process must be " - "terminated and relaunched." + "This indicates that an exception occurred on the device that is now" + " contained by the GPU's error containment capability. Common causes are -" + " a. Certain types of invalid accesses of peer GPU memory over nvlink" + " b. Certain classes of hardware errors" + " This leaves the process in an inconsistent state and any further CUDA" + " work will return the same error. To continue using CUDA, the process must" + " be terminated and relaunched." ), 300: "This indicates that the device kernel source is invalid.", 301: "This indicates that the file specified was not found.", @@ -292,198 +315,225 @@ 303: "This indicates that initialization of a shared object failed.", 304: "This error indicates that an OS call failed.", 400: ( - "This indicates that a resource handle passed to the API call was not valid. Resource handles are " - "opaque types like cudaStream_t and cudaEvent_t." + "This indicates that a resource handle passed to the API call was not" + " valid. Resource handles are opaque types like ::cudaStream_t and" + " ::cudaEvent_t." ), 401: ( - "This indicates that a resource required by the API call is not in a valid state to perform the " - "requested operation." + "This indicates that a resource required by the API call is not in a" + " valid state to perform the requested operation." ), 402: ( - "This indicates an attempt was made to introspect an object in a way that would discard semantically " - "important information. This is either due to the object using funtionality newer than the API " - "version used to introspect it or omission of optional return arguments." + "This indicates an attempt was made to introspect an object in a way that" + " would discard semantically important information. This is either due to" + " the object using funtionality newer than the API version used to" + " introspect it or omission of optional return arguments." ), 500: ( - "This indicates that a named symbol was not found. Examples of symbols are global/constant variable " - "names, driver function names, texture names, and surface names." + "This indicates that a named symbol was not found. Examples of symbols" + " are global/constant variable names, driver function names, texture names," + " and surface names." ), 600: ( - "This indicates that asynchronous operations issued previously have not completed yet. This result is" - " not actually an error, but must be indicated differently than cudaSuccess (which indicates " - "completion). Calls that may return this value include cudaEventQuery() and cudaStreamQuery()." + "This indicates that asynchronous operations issued previously have not" + " completed yet. This result is not actually an error, but must be indicated" + " differently than ::cudaSuccess (which indicates completion). Calls that" + " may return this value include ::cudaEventQuery() and ::cudaStreamQuery()." ), 700: ( - "The device encountered a load or store instruction on an invalid memory address. This leaves the " - "process in an inconsistent state and any further CUDA work will return the same error. To continue " - "using CUDA, the process must be terminated and relaunched." + "The device encountered a load or store instruction on an invalid memory address." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 701: ( - "This indicates that a launch did not occur because it did not have appropriate resources. Although " - "this error is similar to cudaErrorInvalidConfiguration, this error usually indicates that the user " - "has attempted to pass too many arguments to the device kernel, or the kernel launch specifies too " - "many threads for the kernel's register count." + "This indicates that a launch did not occur because it did not have" + " appropriate resources. Although this error is similar to" + " ::cudaErrorInvalidConfiguration, this error usually indicates that the" + " user has attempted to pass too many arguments to the device kernel, or the" + " kernel launch specifies too many threads for the kernel's register count." ), 702: ( - "This indicates that the device kernel took too long to execute. This can only occur if timeouts are " - "enabled - see the device property kernelExecTimeoutEnabled for more information. This leaves the " - "process in an inconsistent state and any further CUDA work will return the same error. To continue " - "using CUDA, the process must be terminated and relaunched." + "This indicates that the device kernel took too long to execute. This can" + " only occur if timeouts are enabled - see the device attribute" + ' ::cudaDeviceAttr::cudaDevAttrKernelExecTimeout "cudaDevAttrKernelExecTimeout"' + " for more information." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), - 703: "This error indicates a kernel launch that uses an incompatible texturing mode.", + 703: ("This error indicates a kernel launch that uses an incompatible texturing mode."), 704: ( - "This error indicates that a call to cudaDeviceEnablePeerAccess() is trying to re-enable peer " - "addressing on from a context which has already had peer addressing enabled." + "This error indicates that a call to ::cudaDeviceEnablePeerAccess() is" + " trying to re-enable peer addressing on from a context which has already" + " had peer addressing enabled." ), 705: ( - "This error indicates that cudaDeviceDisablePeerAccess() is trying to disable peer addressing which " - "has not been enabled yet via cudaDeviceEnablePeerAccess()." + "This error indicates that ::cudaDeviceDisablePeerAccess() is trying to" + " disable peer addressing which has not been enabled yet via" + " ::cudaDeviceEnablePeerAccess()." ), 708: ( - "This indicates that the user has called cudaSetValidDevices(), cudaSetDeviceFlags(), " - "cudaD3D9SetDirect3DDevice(), cudaD3D10SetDirect3DDevice, cudaD3D11SetDirect3DDevice(), or " - "cudaVDPAUSetVDPAUDevice() after initializing the CUDA runtime by calling non-device management " - "operations (allocating memory and launching kernels are examples of non-device management " - "operations). This error can also be returned if using runtime/driver interoperability and there is " - "an existing CUcontext active on the host thread." + "This indicates that the user has called ::cudaSetValidDevices()," + " ::cudaSetDeviceFlags(), ::cudaD3D9SetDirect3DDevice()," + " ::cudaD3D10SetDirect3DDevice, ::cudaD3D11SetDirect3DDevice(), or" + " ::cudaVDPAUSetVDPAUDevice() after initializing the CUDA runtime by" + " calling non-device management operations (allocating memory and" + " launching kernels are examples of non-device management operations)." + " This error can also be returned if using runtime/driver" + " interoperability and there is an existing ::CUcontext active on the" + " host thread." ), 709: ( - "This error indicates that the context current to the calling thread has been destroyed using " - "cuCtxDestroy, or is a primary context which has not yet been initialized." + "This error indicates that the context current to the calling thread" + " has been destroyed using ::cuCtxDestroy, or is a primary context which" + " has not yet been initialized." ), 710: ( - "An assert triggered in device code during kernel execution. The device cannot be used again. All " - "existing allocations are invalid. To continue using CUDA, the process must be terminated and " - "relaunched." + "An assert triggered in device code during kernel execution. The device" + " cannot be used again. All existing allocations are invalid. To continue" + " using CUDA, the process must be terminated and relaunched." ), 711: ( - "This error indicates that the hardware resources required to enable peer access have been exhausted " - "for one or more of the devices passed to cudaEnablePeerAccess()." + "This error indicates that the hardware resources required to enable" + " peer access have been exhausted for one or more of the devices" + " passed to ::cudaEnablePeerAccess()." ), - 712: "This error indicates that the memory range passed to cudaHostRegister() has already been registered.", + 712: ("This error indicates that the memory range passed to ::cudaHostRegister() has already been registered."), 713: ( - "This error indicates that the pointer passed to cudaHostUnregister() does not correspond to any " - "currently registered memory region." + "This error indicates that the pointer passed to ::cudaHostUnregister()" + " does not correspond to any currently registered memory region." ), 714: ( - "Device encountered an error in the call stack during kernel execution, possibly due to stack " - "corruption or exceeding the stack size limit. This leaves the process in an inconsistent state and " - "any further CUDA work will return the same error. To continue using CUDA, the process must be " - "terminated and relaunched." + "Device encountered an error in the call stack during kernel execution," + " possibly due to stack corruption or exceeding the stack size limit." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 715: ( - "The device encountered an illegal instruction during kernel execution This leaves the process in an " - "inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the" - " process must be terminated and relaunched." + "The device encountered an illegal instruction during kernel execution" + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 716: ( - "The device encountered a load or store instruction on a memory address which is not aligned. This " - "leaves the process in an inconsistent state and any further CUDA work will return the same error. To" - " continue using CUDA, the process must be terminated and relaunched." + "The device encountered a load or store instruction" + " on a memory address which is not aligned." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 717: ( - "While executing a kernel, the device encountered an instruction which can only operate on memory " - "locations in certain address spaces (global, shared, or local), but was supplied a memory address " - "not belonging to an allowed address space. This leaves the process in an inconsistent state and any " - "further CUDA work will return the same error. To continue using CUDA, the process must be terminated" + "While executing a kernel, the device encountered an instruction" + " which can only operate on memory locations in certain address spaces" + " (global, shared, or local), but was supplied a memory address not" + " belonging to an allowed address space." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" " and relaunched." ), 718: ( - "The device encountered an invalid program counter. This leaves the process in an inconsistent state " - "and any further CUDA work will return the same error. To continue using CUDA, the process must be " - "terminated and relaunched." + "The device encountered an invalid program counter." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 719: ( - "An exception occurred on the device while executing a kernel. Common causes include dereferencing an" - " invalid device pointer and accessing out of bounds shared memory. Less common cases can be system " - "specific - more information about these cases can be found in the system specific user guide. This " - "leaves the process in an inconsistent state and any further CUDA work will return the same error. To" - " continue using CUDA, the process must be terminated and relaunched." + "An exception occurred on the device while executing a kernel. Common" + " causes include dereferencing an invalid device pointer and accessing" + " out of bounds shared memory. Less common cases can be system specific - more" + " information about these cases can be found in the system specific user guide." + " This leaves the process in an inconsistent state and any further CUDA work" + " will return the same error. To continue using CUDA, the process must be terminated" + " and relaunched." ), 720: ( - "This error indicates that the number of blocks launched per grid for a kernel that was launched via " - "either cudaLaunchCooperativeKernel or cudaLaunchCooperativeKernelMultiDevice exceeds the maximum " - "number of blocks as allowed by cudaOccupancyMaxActiveBlocksPerMultiprocessor or " - "cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors as " - "specified by the device attribute cudaDevAttrMultiProcessorCount." + "This error indicates that the number of blocks launched per grid for a kernel that was" + " launched via either ::cudaLaunchCooperativeKernel" + " exceeds the maximum number of blocks as allowed by ::cudaOccupancyMaxActiveBlocksPerMultiprocessor" + " or ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors" + " as specified by the device attribute ::cudaDevAttrMultiProcessorCount." ), 721: ( - "An exception occurred on the device while exiting a kernel using tensor memory: the tensor memory " - "was not completely deallocated. This leaves the process in an inconsistent state and any further " - "CUDA work will return the same error. To continue using CUDA, the process must be terminated and " - "relaunched." + "An exception occurred on the device while exiting a kernel using tensor memory: the" + " tensor memory was not completely deallocated. This leaves the process in an inconsistent" + " state and any further CUDA work will return the same error. To continue using CUDA, the" + " process must be terminated and relaunched." ), 800: "This error indicates the attempted operation is not permitted.", - 801: "This error indicates the attempted operation is not supported on the current system or device.", + 801: ("This error indicates the attempted operation is not supported on the current system or device."), 802: ( - "This error indicates that the system is not yet ready to start any CUDA work. To continue using " - "CUDA, verify the system configuration is in a valid state and all required driver daemons are " - "actively running. More information about this error can be found in the system specific user guide." + "This error indicates that the system is not yet ready to start any CUDA" + " work. To continue using CUDA, verify the system configuration is in a" + " valid state and all required driver daemons are actively running." + " More information about this error can be found in the system specific" + " user guide." ), 803: ( - "This error indicates that there is a mismatch between the versions of the display driver and the " - "CUDA driver. Refer to the compatibility documentation for supported versions." + "This error indicates that there is a mismatch between the versions of" + " the display driver and the CUDA driver. Refer to the compatibility documentation" + " for supported versions." ), 804: ( - "This error indicates that the system was upgraded to run with forward compatibility but the visible " - "hardware detected by CUDA does not support this configuration. Refer to the compatibility " - "documentation for the supported hardware matrix or ensure that only supported hardware is visible " - "during initialization via the CUDA_VISIBLE_DEVICES environment variable." - ), - 805: ("This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server."), - 806: ("This error indicates that the remote procedural call between the MPS server and the MPS client failed."), + "This error indicates that the system was upgraded to run with forward compatibility" + " but the visible hardware detected by CUDA does not support this configuration." + " Refer to the compatibility documentation for the supported hardware matrix or ensure" + " that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES" + " environment variable." + ), + 805: "This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server.", + 806: "This error indicates that the remote procedural call between the MPS server and the MPS client failed.", 807: ( - "This error indicates that the MPS server is not ready to accept new MPS client requests. This error " - "can be returned when the MPS server is in the process of recovering from a fatal failure." + "This error indicates that the MPS server is not ready to accept new MPS client requests." + " This error can be returned when the MPS server is in the process of recovering from a fatal failure." ), 808: "This error indicates that the hardware resources required to create MPS client have been exhausted.", 809: "This error indicates the the hardware resources required to device connections have been exhausted.", - 810: ( - "This error indicates that the MPS client has been terminated by the server. To continue using CUDA, " - "the process must be terminated and relaunched." - ), - 811: ( - "This error indicates, that the program is using CUDA Dynamic Parallelism, but the current " - "configuration, like MPS, does not support it." - ), - 812: ( - "This error indicates, that the program contains an unsupported interaction between different " - "versions of CUDA Dynamic Parallelism." - ), + 810: "This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated and relaunched.", + 811: "This error indicates, that the program is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it.", + 812: "This error indicates, that the program contains an unsupported interaction between different versions of CUDA Dynamic Parallelism.", 900: "The operation is not permitted when the stream is capturing.", - 901: "The current capture sequence on the stream has been invalidated due to a previous error.", - 902: "The operation would have resulted in a merge of two independent capture sequences.", + 901: ("The current capture sequence on the stream has been invalidated due to a previous error."), + 902: ("The operation would have resulted in a merge of two independent capture sequences."), 903: "The capture was not initiated in this stream.", - 904: "The capture sequence contains a fork that was not joined to the primary stream.", + 904: ("The capture sequence contains a fork that was not joined to the primary stream."), 905: ( - "A dependency would have been created which crosses the capture sequence boundary. Only implicit in-" - "stream ordering dependencies are allowed to cross the boundary." + "A dependency would have been created which crosses the capture sequence" + " boundary. Only implicit in-stream ordering dependencies are allowed to" + " cross the boundary." ), 906: ( - "The operation would have resulted in a disallowed implicit dependency on a current capture sequence " - "from cudaStreamLegacy." + "The operation would have resulted in a disallowed implicit dependency on" + " a current capture sequence from cudaStreamLegacy." ), - 907: "The operation is not permitted on an event which was last recorded in a capturing stream.", + 907: ("The operation is not permitted on an event which was last recorded in a capturing stream."), 908: ( - "A stream capture sequence not initiated with the cudaStreamCaptureModeRelaxed argument to " - "cudaStreamBeginCapture was passed to cudaStreamEndCapture in a different thread." + "A stream capture sequence not initiated with the ::cudaStreamCaptureModeRelaxed" + " argument to ::cudaStreamBeginCapture was passed to ::cudaStreamEndCapture in a" + " different thread." ), 909: "This indicates that the wait operation has timed out.", 910: ( - "This error indicates that the graph update was not performed because it included changes which " - "violated constraints specific to instantiated graph update." + "This error indicates that the graph update was not performed because it included" + " changes which violated constraints specific to instantiated graph update." ), 911: ( - "This indicates that an async error has occurred in a device outside of CUDA. If CUDA was waiting for" - " an external device's signal before consuming shared data, the external device signaled an error " - "indicating that the data is not valid for consumption. This leaves the process in an inconsistent " - "state and any further CUDA work will return the same error. To continue using CUDA, the process must" - " be terminated and relaunched." - ), - 912: "This indicates that a kernel launch error has occurred due to cluster misconfiguration.", - 913: "Indiciates a function handle is not loaded when calling an API that requires a loaded function.", - 914: "This error indicates one or more resources passed in are not valid resource types for the operation.", - 915: "This error indicates one or more resources are insufficient or non-applicable for the operation.", + "This indicates that an async error has occurred in a device outside of CUDA." + " If CUDA was waiting for an external device's signal before consuming shared data," + " the external device signaled an error indicating that the data is not valid for" + " consumption. This leaves the process in an inconsistent state and any further CUDA" + " work will return the same error. To continue using CUDA, the process must be" + " terminated and relaunched." + ), + 912: ("This indicates that a kernel launch error has occurred due to cluster misconfiguration."), + 913: ("Indiciates a function handle is not loaded when calling an API that requires a loaded function."), + 914: ("This error indicates one or more resources passed in are not valid resource types for the operation."), + 915: ("This error indicates one or more resources are insufficient or non-applicable for the operation."), 999: "This indicates that an unknown internal error has occurred.", - 10000: "Pseudo code.", + 10000: ( + "Any unhandled CUDA driver error is added to this value and returned via" + " the runtime. Production releases of CUDA should not return such errors." + " This error return is deprecated as of CUDA 4.1." + ), } diff --git a/cuda_core/examples/thread_block_cluster.py b/cuda_core/examples/thread_block_cluster.py index dea9e3568..98bc641ea 100644 --- a/cuda_core/examples/thread_block_cluster.py +++ b/cuda_core/examples/thread_block_cluster.py @@ -19,7 +19,12 @@ if cuda_path is None: print("this demo requires a valid CUDA_PATH environment variable set", file=sys.stderr) sys.exit(0) -cuda_include_path = os.path.join(cuda_path, "include") +cuda_include = os.path.join(cuda_path, "include") +assert os.path.isdir(cuda_include) +include_path = [cuda_include] +cccl_include = os.path.join(cuda_include, "cccl") +if os.path.isdir(cccl_include): + include_path.insert(0, cccl_include) # print cluster info using a kernel code = r""" @@ -54,7 +59,7 @@ prog = Program( code, code_type="c++", - options=ProgramOptions(arch=f"sm_{arch}", std="c++17", include_path=cuda_include_path), + options=ProgramOptions(arch=f"sm_{arch}", std="c++17", include_path=include_path), ) mod = prog.compile(target_type="cubin") ker = mod.get_kernel("check_cluster_info") diff --git a/cuda_core/tests/test_cuda_utils.py b/cuda_core/tests/test_cuda_utils.py index 866582438..b0f467bb8 100644 --- a/cuda_core/tests/test_cuda_utils.py +++ b/cuda_core/tests/test_cuda_utils.py @@ -18,7 +18,7 @@ def test_driver_cu_result_explanations_health(): assert code in expl_dict known_codes.add(code) - if cuda_utils.get_binding_version() >= (12, 0): + if cuda_utils.get_binding_version() >= (13, 0): # Ensure expl_dict has no codes not known as a CUresult enum extra_expl = sorted(set(expl_dict.keys()) - known_codes) assert not extra_expl @@ -34,7 +34,7 @@ def test_runtime_cuda_error_explanations_health(): assert code in expl_dict known_codes.add(code) - if cuda_utils.get_binding_version() >= (12, 0): + if cuda_utils.get_binding_version() >= (13, 0): # Ensure expl_dict has no codes not known as a cudaError_t enum extra_expl = sorted(set(expl_dict.keys()) - known_codes) assert not extra_expl diff --git a/cuda_core/tests/test_device.py b/cuda_core/tests/test_device.py index c498431c9..2a135c49a 100644 --- a/cuda_core/tests/test_device.py +++ b/cuda_core/tests/test_device.py @@ -77,7 +77,7 @@ def test_pci_bus_id(): def test_uuid(): device = Device() driver_ver = handle_return(driver.cuDriverGetVersion()) - if driver_ver >= 11040: + if 11040 <= driver_ver < 13000: uuid = handle_return(driver.cuDeviceGetUuid_v2(device.device_id)) else: uuid = handle_return(driver.cuDeviceGetUuid(device.device_id)) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py index 388c75845..bb6c32b63 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py @@ -12,7 +12,7 @@ IS_WINDOWS, is_suppressed_dll_file, ) -from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs, find_sub_dirs_all_sitepackages def _no_such_file_in_sub_dirs( @@ -28,18 +28,21 @@ def _no_such_file_in_sub_dirs( def _find_so_using_nvidia_lib_dirs( libname: str, so_basename: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - nvidia_sub_dirs = ("nvidia", "*", "nvvm", "lib64") if libname == "nvvm" else ("nvidia", "*", "lib") file_wild = so_basename + "*" - for lib_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - # First look for an exact match - so_name = os.path.join(lib_dir, so_basename) - if os.path.isfile(so_name): - return so_name - # Look for a versioned library - # Using sort here mainly to make the result deterministic. - for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild))): + nvidia_sub_dirs_list: list[tuple[str, ...]] = [("nvidia", "*", "lib")] # works also for CTK 13 nvvm + if libname == "nvvm": + nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "lib64")) # CTK 12 + for nvidia_sub_dirs in nvidia_sub_dirs_list: + for lib_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): + # First look for an exact match + so_name = os.path.join(lib_dir, so_basename) if os.path.isfile(so_name): return so_name + # Look for a versioned library + # Using sort here mainly to make the result deterministic. + for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild))): + if os.path.isfile(so_name): + return so_name _no_such_file_in_sub_dirs(nvidia_sub_dirs, file_wild, error_messages, attachments) return None @@ -56,11 +59,17 @@ def _find_dll_under_dir(dirpath: str, file_wild: str) -> Optional[str]: def _find_dll_using_nvidia_bin_dirs( libname: str, lib_searched_for: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - nvidia_sub_dirs = ("nvidia", "*", "nvvm", "bin") if libname == "nvvm" else ("nvidia", "*", "bin") - for bin_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - dll_name = _find_dll_under_dir(bin_dir, lib_searched_for) - if dll_name is not None: - return dll_name + nvidia_sub_dirs_list: list[tuple[str, ...]] = [ + ("nvidia", "*", "bin"), # CTK 12 + ("nvidia", "*", "bin", "*"), # CTK 13, e.g. site-packages\nvidia\cu13\bin\x86_64\ + ] + if libname == "nvvm": + nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "bin")) # Only for CTK 12 + for nvidia_sub_dirs in nvidia_sub_dirs_list: + for bin_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): + dll_name = _find_dll_under_dir(bin_dir, lib_searched_for) + if dll_name is not None: + return dll_name _no_such_file_in_sub_dirs(nvidia_sub_dirs, lib_searched_for, error_messages, attachments) return None @@ -76,21 +85,29 @@ def _find_lib_dir_using_cuda_home(libname: str) -> Optional[str]: cuda_home = _get_cuda_home() if cuda_home is None: return None - subdirs: tuple[str, ...] + subdirs_list: tuple[tuple[str, ...], ...] if IS_WINDOWS: - subdirs = (os.path.join("nvvm", "bin"),) if libname == "nvvm" else ("bin",) + if libname == "nvvm": # noqa: SIM108 + subdirs_list = ( + ("nvvm", "bin", "*"), # CTK 13 + ("nvvm", "bin"), # CTK 12 + ) + else: + subdirs_list = ( + ("bin", "x64"), # CTK 13 + ("bin",), # CTK 12 + ) else: - subdirs = ( - (os.path.join("nvvm", "lib64"),) - if libname == "nvvm" - else ( - "lib64", # CTK - "lib", # Conda + if libname == "nvvm": # noqa: SIM108 + subdirs_list = (("nvvm", "lib64"),) + else: + subdirs_list = ( + ("lib64",), # CTK + ("lib",), # Conda ) - ) - for subdir in subdirs: - dirname = os.path.join(cuda_home, subdir) - if os.path.isdir(dirname): + for sub_dirs in subdirs_list: + dirname: str # work around bug in mypy + for dirname in find_sub_dirs((cuda_home,), sub_dirs): return dirname return None diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index 251e0593a..29192ec4c 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +import contextlib import ctypes import ctypes.util import os @@ -109,7 +110,26 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: return None -def load_with_abs_path(_libname: str, found_path: str) -> LoadedDL: +def _work_around_known_bugs(libname: str, found_path: str) -> None: + if libname == "nvrtc": + # Work around bug/oversight in + # nvidia_cuda_nvrtc-13.0.48-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl + # Issue: libnvrtc.so.13 RUNPATH is not set. + # This workaround is highly specific + # - for simplicity. + # - to not mask bugs in future nvidia-cuda-nvrtc releases. + # - because a more general workaround is complicated. + dirname, basename = os.path.split(found_path) + if basename == "libnvrtc.so.13": + dep_basename = "libnvrtc-builtins.so.13.0" + dep_path = os.path.join(dirname, dep_basename) + if os.path.isfile(dep_path): + # In case of failure, defer to primary load, which is almost certain to fail, too. + with contextlib.suppress(OSError): + ctypes.CDLL(dep_path, CDLL_MODE) + + +def load_with_abs_path(libname: str, found_path: str) -> LoadedDL: """Load a dynamic library from the given path. Args: @@ -122,6 +142,7 @@ def load_with_abs_path(_libname: str, found_path: str) -> LoadedDL: Raises: RuntimeError: If the library cannot be loaded """ + _work_around_known_bugs(libname, found_path) try: handle = ctypes.CDLL(found_path, CDLL_MODE) except OSError as e: diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index 19d73b23e..14901c3e1 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -101,29 +101,35 @@ # cuda_12.4.1_550.54.15_linux.run # cuda_12.5.1_555.42.06_linux.run # cuda_12.6.2_560.35.03_linux.run -# cuda_12.8.0_570.86.10_linux.run -# cuda_12.9.0_575.51.03_linux.run +# cuda_12.8.1_570.124.06_linux.run +# cuda_12.9.1_575.57.08_linux.run +# cuda_13.0.0_580.65.06_linux.run # Generated with toolshed/build_pathfinder_sonames.py SUPPORTED_LINUX_SONAMES = { "cublas": ( "libcublas.so.11", "libcublas.so.12", + "libcublas.so.13", ), "cublasLt": ( "libcublasLt.so.11", "libcublasLt.so.12", + "libcublasLt.so.13", ), "cudart": ( "libcudart.so.11.0", "libcudart.so.12", + "libcudart.so.13", ), "cufft": ( "libcufft.so.10", "libcufft.so.11", + "libcufft.so.12", ), "cufftw": ( "libcufftw.so.10", "libcufftw.so.11", + "libcufftw.so.12", ), "cufile": ("libcufile.so.0",), # "cufile_rdma": ("libcufile_rdma.so.1",), @@ -131,10 +137,12 @@ "cusolver": ( "libcusolver.so.10", "libcusolver.so.11", + "libcusolver.so.12", ), "cusolverMg": ( "libcusolverMg.so.10", "libcusolverMg.so.11", + "libcusolverMg.so.12", ), "cusparse": ( "libcusparse.so.11", @@ -143,62 +151,82 @@ "nppc": ( "libnppc.so.11", "libnppc.so.12", + "libnppc.so.13", ), "nppial": ( "libnppial.so.11", "libnppial.so.12", + "libnppial.so.13", ), "nppicc": ( "libnppicc.so.11", "libnppicc.so.12", + "libnppicc.so.13", ), "nppidei": ( "libnppidei.so.11", "libnppidei.so.12", + "libnppidei.so.13", ), "nppif": ( "libnppif.so.11", "libnppif.so.12", + "libnppif.so.13", ), "nppig": ( "libnppig.so.11", "libnppig.so.12", + "libnppig.so.13", ), "nppim": ( "libnppim.so.11", "libnppim.so.12", + "libnppim.so.13", ), "nppist": ( "libnppist.so.11", "libnppist.so.12", + "libnppist.so.13", ), "nppisu": ( "libnppisu.so.11", "libnppisu.so.12", + "libnppisu.so.13", ), "nppitc": ( "libnppitc.so.11", "libnppitc.so.12", + "libnppitc.so.13", ), "npps": ( "libnpps.so.11", "libnpps.so.12", + "libnpps.so.13", + ), + "nvJitLink": ( + "libnvJitLink.so.12", + "libnvJitLink.so.13", ), - "nvJitLink": ("libnvJitLink.so.12",), "nvblas": ( "libnvblas.so.11", "libnvblas.so.12", + "libnvblas.so.13", + ), + "nvfatbin": ( + "libnvfatbin.so.12", + "libnvfatbin.so.13", ), - "nvfatbin": ("libnvfatbin.so.12",), "nvjpeg": ( "libnvjpeg.so.11", "libnvjpeg.so.12", + "libnvjpeg.so.13", ), "nvrtc": ( "libnvrtc.so.11.0", "libnvrtc.so.11.1", "libnvrtc.so.11.2", "libnvrtc.so.12", + "libnvrtc.so.13", ), "nvvm": ( "libnvvm.so.3", @@ -224,39 +252,47 @@ # cuda_12.5.1_555.85_windows.exe # cuda_12.6.2_560.94_windows.exe # cuda_12.8.1_572.61_windows.exe -# cuda_12.9.0_576.02_windows.txt -# Generated with toolshed/build_pathfinder_dlls.py (WITH MANUAL EDITS) +# cuda_12.9.1_576.57_windows.exe +# cuda_13.0.0_windows.exe +# Generated with toolshed/build_pathfinder_dlls.py SUPPORTED_WINDOWS_DLLS = { "cublas": ( "cublas64_11.dll", "cublas64_12.dll", + "cublas64_13.dll", ), "cublasLt": ( "cublasLt64_11.dll", "cublasLt64_12.dll", + "cublasLt64_13.dll", ), "cudart": ( "cudart64_101.dll", "cudart64_110.dll", "cudart64_12.dll", + "cudart64_13.dll", "cudart64_65.dll", ), "cufft": ( "cufft64_10.dll", "cufft64_11.dll", + "cufft64_12.dll", ), "cufftw": ( "cufftw64_10.dll", "cufftw64_11.dll", + "cufftw64_12.dll", ), "curand": ("curand64_10.dll",), "cusolver": ( "cusolver64_10.dll", "cusolver64_11.dll", + "cusolver64_12.dll", ), "cusolverMg": ( "cusolverMg64_10.dll", "cusolverMg64_11.dll", + "cusolverMg64_12.dll", ), "cusparse": ( "cusparse64_11.dll", @@ -265,62 +301,82 @@ "nppc": ( "nppc64_11.dll", "nppc64_12.dll", + "nppc64_13.dll", ), "nppial": ( "nppial64_11.dll", "nppial64_12.dll", + "nppial64_13.dll", ), "nppicc": ( "nppicc64_11.dll", "nppicc64_12.dll", + "nppicc64_13.dll", ), "nppidei": ( "nppidei64_11.dll", "nppidei64_12.dll", + "nppidei64_13.dll", ), "nppif": ( "nppif64_11.dll", "nppif64_12.dll", + "nppif64_13.dll", ), "nppig": ( "nppig64_11.dll", "nppig64_12.dll", + "nppig64_13.dll", ), "nppim": ( "nppim64_11.dll", "nppim64_12.dll", + "nppim64_13.dll", ), "nppist": ( "nppist64_11.dll", "nppist64_12.dll", + "nppist64_13.dll", ), "nppisu": ( "nppisu64_11.dll", "nppisu64_12.dll", + "nppisu64_13.dll", ), "nppitc": ( "nppitc64_11.dll", "nppitc64_12.dll", + "nppitc64_13.dll", ), "npps": ( "npps64_11.dll", "npps64_12.dll", + "npps64_13.dll", + ), + "nvJitLink": ( + "nvJitLink_120_0.dll", + "nvJitLink_130_0.dll", ), - "nvJitLink": ("nvJitLink_120_0.dll",), "nvblas": ( "nvblas64_11.dll", "nvblas64_12.dll", + "nvblas64_13.dll", + ), + "nvfatbin": ( + "nvfatbin_120_0.dll", + "nvfatbin_130_0.dll", ), - "nvfatbin": ("nvfatbin_120_0.dll",), "nvjpeg": ( "nvjpeg64_11.dll", "nvjpeg64_12.dll", + "nvjpeg64_13.dll", ), "nvrtc": ( "nvrtc64_110_0.dll", "nvrtc64_111_0.dll", "nvrtc64_112_0.dll", "nvrtc64_120_0.dll", + "nvrtc64_130_0.dll", ), "nvvm": ( "nvvm64.dll", @@ -347,10 +403,10 @@ def is_suppressed_dll_file(path_basename: str) -> bool: return path_basename.startswith(("cudart32_", "nvvm32")) -# Based on nm output for Linux x86_64 /usr/local/cuda (12.8.1) +# Based on `nm -D --defined-only` output for Linux x86_64 distributions. EXPECTED_LIB_SYMBOLS = { "nvJitLink": ( - "__nvJitLinkCreate_12_0", # 12.0 through 12.8 (at least) + "__nvJitLinkCreate_12_0", # 12.0 through 12.9 "nvJitLinkVersion", # 12.3 and up ), "nvrtc": ("nvrtcVersion",), @@ -366,16 +422,16 @@ def is_suppressed_dll_file(path_basename: str) -> bool: "cusolverMg": ("cusolverMgCreate",), "cusparse": ("cusparseGetVersion",), "nppc": ("nppGetLibVersion",), - "nppial": ("nppiAdd_32f_C1R",), - "nppicc": ("nppiColorToGray_8u_C3C1R",), - "nppidei": ("nppiCopy_8u_C1R",), - "nppif": ("nppiFilterSobelHorizBorder_8u_C1R",), - "nppig": ("nppiResize_8u_C1R",), - "nppim": ("nppiErode_8u_C1R",), - "nppist": ("nppiMean_8u_C1R",), + "nppial": ("nppiAdd_32f_C1R_Ctx",), + "nppicc": ("nppiColorToGray_8u_C3C1R_Ctx",), + "nppidei": ("nppiCopy_8u_C1R_Ctx",), + "nppif": ("nppiFilterSobelHorizBorder_8u_C1R_Ctx",), + "nppig": ("nppiResize_8u_C1R_Ctx",), + "nppim": ("nppiErode_8u_C1R_Ctx",), + "nppist": ("nppiMean_8u_C1R_Ctx",), "nppisu": ("nppiFree",), - "nppitc": ("nppiThreshold_8u_C1R",), - "npps": ("nppsAdd_32f",), + "nppitc": ("nppiThreshold_8u_C1R_Ctx",), + "npps": ("nppsAdd_32f_Ctx",), "nvblas": ("dgemm",), "cufile": ("cuFileGetVersion",), # "cufile_rdma": ("rdma_buffer_reg",), diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 161dd6697..ac6724277 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -29,6 +29,22 @@ nvidia_wheels_cu12 = [ "nvidia-nvjitlink-cu12", "nvidia-nvjpeg-cu12", ] +nvidia_wheels_cu13 = [ + "nvidia-cublas", + "nvidia-cuda-nvcc", + "nvidia-cuda-nvrtc", + "nvidia-cuda-runtime", + "nvidia-cufft", + "nvidia-cufile; sys_platform != 'win32'", + "nvidia-curand", + "nvidia-cusolver", + "nvidia-cusparse", + "nvidia-npp", + "nvidia-nvfatbin", + "nvidia-nvjitlink", + "nvidia-nvjpeg", + "nvidia-nvvm", +] [project.urls] Repository = "https://github.com/NVIDIA/cuda-python" diff --git a/cuda_python/DESCRIPTION.rst b/cuda_python/DESCRIPTION.rst index 01da48eac..154c69893 100644 --- a/cuda_python/DESCRIPTION.rst +++ b/cuda_python/DESCRIPTION.rst @@ -47,3 +47,4 @@ The list of available interfaces are: * NVRTC * nvJitLink * NVVM +* cuFile diff --git a/cuda_python/docs/source/release.md b/cuda_python/docs/source/release.md index 467c9c8e6..e7e264bd1 100644 --- a/cuda_python/docs/source/release.md +++ b/cuda_python/docs/source/release.md @@ -5,7 +5,8 @@ maxdepth: 3 --- - 12.X.Y + 13.0.0 + 12.9.1 12.9.0 12.8.0 12.6.2 diff --git a/cuda_python/docs/source/release/12.X.Y-notes.rst b/cuda_python/docs/source/release/12.9.1-notes.rst similarity index 73% rename from cuda_python/docs/source/release/12.X.Y-notes.rst rename to cuda_python/docs/source/release/12.9.1-notes.rst index d75a5aadc..282cd56f7 100644 --- a/cuda_python/docs/source/release/12.X.Y-notes.rst +++ b/cuda_python/docs/source/release/12.9.1-notes.rst @@ -1,19 +1,23 @@ .. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. .. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -CUDA Python 12.X.Y Release notes +CUDA Python 12.9.1 Release notes ================================ -Released on MM DD, 2025. +Released on Aug 6, 2025. Included components ------------------- +* `cuda.bindings 12.9.1 `_ + Highlights ---------- +* Add bindings for cuFile + Known issues ------------ diff --git a/cuda_python/docs/source/release/13.0.0-notes.rst b/cuda_python/docs/source/release/13.0.0-notes.rst new file mode 100644 index 000000000..140c28839 --- /dev/null +++ b/cuda_python/docs/source/release/13.0.0-notes.rst @@ -0,0 +1,25 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 13.0.0 Release notes +================================ + +Released on Aug 6, 2025. + + +Included components +------------------- + +* `cuda.bindings 13.0.0 `_ + + +Highlights +---------- + +* Add bindings for cuFile + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_python/docs/versions.json b/cuda_python/docs/versions.json index cc1299896..c174c4eee 100644 --- a/cuda_python/docs/versions.json +++ b/cuda_python/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", + "13.0.0" : "13.0.0", "12.9.0" : "12.9.0", "12.8.0" : "12.8.0", "12.6.2" : "12.6.2", diff --git a/toolshed/reformat_cuda_enums_as_py.py b/toolshed/reformat_cuda_enums_as_py.py new file mode 100755 index 000000000..c1ab4667c --- /dev/null +++ b/toolshed/reformat_cuda_enums_as_py.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys + + +def extract_enum_block(header_file_lines): + line_iter = iter(header_file_lines) + for line in line_iter: + if line == "typedef enum cudaError_enum {": + closing_line = "} CUresult;" + python_dict_name = "DRIVER_CU_RESULT_EXPLANATIONS" + break + if line == "enum __device_builtin__ cudaError": + line = next(line_iter) + assert line == "{", line + closing_line = "};" + python_dict_name = "RUNTIME_CUDA_ERROR_EXPLANATIONS" + break + else: + raise RuntimeError("Opening line not found.") + block = [] + for line in line_iter: + if line == closing_line: + break + block.append(line) + else: + raise RuntimeError("Closing line not found.") + return python_dict_name, block + + +def parse_enum_doc_and_value_pairs(enum_block): + entries = [] + comment_lines = [] + inside_comment = False + + for line in enum_block: + stripped = line.strip() + if not stripped: + continue + + if stripped.startswith("/**"): + inside_comment = True + comment = stripped[3:].lstrip() + if comment: + comment_lines = [comment] + elif inside_comment: + if stripped.endswith("*/"): + comment = stripped[:-2].strip() + if comment: + comment_lines.append(comment) + inside_comment = False + else: + comment_lines.append(stripped.lstrip("*").strip()) + elif stripped: + assert stripped.count(",") <= 1, line + stripped = stripped.replace(",", "") + flds = stripped.split(" = ") + assert len(flds) == 2, line + try: + val = int(flds[1].strip()) + except Exception as e: + raise RuntimeError(f"Unexpected {line=!r}") from e + entries.append((int(val), comment_lines)) + comment_lines = [] + + return entries + + +def emit_python_dict(python_dict_name, entries): + print(f"{python_dict_name} = {{") + for val, lines in entries: + py_lines = [] + continuation_space = "" + for line in lines: + if line == r"\deprecated": + continue + mod_line = line.replace("\\ref ", "") + assert "\\" not in mod_line, line + mod_line = mod_line.replace('"', '\\"') + py_lines.append(f'"{continuation_space}{mod_line}"') + continuation_space = " " + assert py_lines, lines + if len(py_lines) == 1: + print(f" {val}: {py_lines[0]},") + else: + print(f" {val}: (") + for py_line in py_lines: + print(f" {py_line}") + print(" ),") + print("}") + + +def run(args): + if len(args) != 1: + print( + "Usage: reformat_cuda_enums_as_py.py /path/to/cuda.h|driver_types.h", + file=sys.stderr, + ) + sys.exit(1) + + header_file_text = open(sys.argv[1]).read().splitlines() + python_dict_name, enum_block = extract_enum_block(header_file_text) + entries = parse_enum_doc_and_value_pairs(enum_block) + emit_python_dict(python_dict_name, entries) + + +if __name__ == "__main__": + run(sys.argv[1:]) diff --git a/toolshed/reformat_cuda_enums_from_web_as_py.py b/toolshed/reformat_cuda_enums_from_web_as_py.py deleted file mode 100755 index 3563eb2c3..000000000 --- a/toolshed/reformat_cuda_enums_from_web_as_py.py +++ /dev/null @@ -1,51 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -import sys -import textwrap - - -def run(args): - assert len(args) == 1 - num = None - buffer = [] - - print("DATA = {") - - def flush_buffer(): - txt = " ".join(buffer) - buffer.clear() - parts = textwrap.wrap(txt, width=100, drop_whitespace=False) - assert "".join(parts) == txt - print(f"{num}:") - if len(parts) > 1: - print("(") - for p in parts: - print(repr(p)) - if len(parts) > 1: - print(")") - print(",") - - for line in open(args[0]).read().splitlines(): - line = line.strip() - if not line or line == "Deprecated": - continue - if " = " in line: - if buffer: - assert num is not None - flush_buffer() - kw, num = line.split(" = ", 1) - else: - buffer.append(line) - if num is not None and not buffer: - buffer = ["MISSING EXPLANATION"] - if buffer: - assert num is not None - flush_buffer() - - print("}") # DATA - - -if __name__ == "__main__": - run(args=sys.argv[1:]) From efa91a684345b37c3f5a0e7f3b3e6758615743c6 Mon Sep 17 00:00:00 2001 From: Richard H Boyd Date: Wed, 6 Aug 2025 12:00:07 -0400 Subject: [PATCH 006/113] fix getting started example (#797) --- cuda_core/docs/source/getting-started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cuda_core/docs/source/getting-started.md b/cuda_core/docs/source/getting-started.md index d27edb2c4..6fffa364e 100644 --- a/cuda_core/docs/source/getting-started.md +++ b/cuda_core/docs/source/getting-started.md @@ -49,6 +49,7 @@ and a corresponding {class}`Stream `. Don't forget to use {meth}`Device.set_current() `! ```python +import cupy as cp from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch dev = Device() @@ -76,6 +77,7 @@ ker = mod.get_kernel("vector_add") # Prepare input/output arrays (using CuPy) size = 50000 +rng = cp.random.default_rng() a = rng.random(size, dtype=cp.float32) b = rng.random(size, dtype=cp.float32) c = cp.empty_like(a) From c4f4f401b9b30d537cbe6dddbc678cb8e694e573 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 7 Aug 2025 00:09:59 +0800 Subject: [PATCH 007/113] Remove trampoline modules (#795) * remove trampoline modules * try to also clean up MANIFEST.in * Revert "try to also clean up MANIFEST.in" This reverts commit 0ff9250f51dc0b24756d130cce30af117f7368fc. * add release notes --- cuda_bindings/cuda/ccuda.pxd | 15 ------------- cuda_bindings/cuda/ccuda.pyx | 7 ------ cuda_bindings/cuda/ccudart.pxd | 15 ------------- cuda_bindings/cuda/ccudart.pyx | 7 ------ cuda_bindings/cuda/cnvrtc.pxd | 15 ------------- cuda_bindings/cuda/cnvrtc.pyx | 7 ------ cuda_bindings/cuda/cuda.pyx | 22 ------------------- cuda_bindings/cuda/cudart.pyx | 22 ------------------- cuda_bindings/cuda/nvrtc.pyx | 22 ------------------- .../docs/source/release/13.0.0-notes.rst | 7 ++++++ cuda_bindings/setup.py | 2 -- 11 files changed, 7 insertions(+), 134 deletions(-) delete mode 100644 cuda_bindings/cuda/ccuda.pxd delete mode 100644 cuda_bindings/cuda/ccuda.pyx delete mode 100644 cuda_bindings/cuda/ccudart.pxd delete mode 100644 cuda_bindings/cuda/ccudart.pyx delete mode 100644 cuda_bindings/cuda/cnvrtc.pxd delete mode 100644 cuda_bindings/cuda/cnvrtc.pyx delete mode 100644 cuda_bindings/cuda/cuda.pyx delete mode 100644 cuda_bindings/cuda/cudart.pyx delete mode 100644 cuda_bindings/cuda/nvrtc.pyx diff --git a/cuda_bindings/cuda/ccuda.pxd b/cuda_bindings/cuda/ccuda.pxd deleted file mode 100644 index 33920d37d..000000000 --- a/cuda_bindings/cuda/ccuda.pxd +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cydriver cimport * - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.ccuda module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.cydriver module instead." ) - #else - #warning The cuda.ccuda module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.cydriver module instead. - #endif - """ diff --git a/cuda_bindings/cuda/ccuda.pyx b/cuda_bindings/cuda/ccuda.pyx deleted file mode 100644 index 668c00379..000000000 --- a/cuda_bindings/cuda/ccuda.pyx +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cydriver cimport * -from cuda.bindings import cydriver -__pyx_capi__ = cydriver.__pyx_capi__ -del cydriver diff --git a/cuda_bindings/cuda/ccudart.pxd b/cuda_bindings/cuda/ccudart.pxd deleted file mode 100644 index fa1adaff8..000000000 --- a/cuda_bindings/cuda/ccudart.pxd +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.ccudart module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.cyruntime module instead." ) - #else - #warning The cuda.ccudart module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.cyruntime module instead. - #endif - """ diff --git a/cuda_bindings/cuda/ccudart.pyx b/cuda_bindings/cuda/ccudart.pyx deleted file mode 100644 index 4dc06b250..000000000 --- a/cuda_bindings/cuda/ccudart.pyx +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * -from cuda.bindings import cyruntime -__pyx_capi__ = cyruntime.__pyx_capi__ -del cyruntime diff --git a/cuda_bindings/cuda/cnvrtc.pxd b/cuda_bindings/cuda/cnvrtc.pxd deleted file mode 100644 index 032846b8d..000000000 --- a/cuda_bindings/cuda/cnvrtc.pxd +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cynvrtc cimport * - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.cnvrtc module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.cynvrtc module instead." ) - #else - #warning The cuda.cnvrtc module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.cynvrtc module instead. - #endif - """ diff --git a/cuda_bindings/cuda/cnvrtc.pyx b/cuda_bindings/cuda/cnvrtc.pyx deleted file mode 100644 index 391a1c0bd..000000000 --- a/cuda_bindings/cuda/cnvrtc.pyx +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cynvrtc cimport * -from cuda.bindings import cynvrtc -__pyx_capi__ = cynvrtc.__pyx_capi__ -del cynvrtc diff --git a/cuda_bindings/cuda/cuda.pyx b/cuda_bindings/cuda/cuda.pyx deleted file mode 100644 index 8a1c13ddd..000000000 --- a/cuda_bindings/cuda/cuda.pyx +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import warnings as _warnings - -from cuda.bindings.driver import * - - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.cuda module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.driver module instead." ) - #else - #warning The cuda.cuda module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.driver module instead. - #endif - """ - - -_warnings.warn("The cuda.cuda module is deprecated and will be removed in a future release, " - "please switch to use the cuda.bindings.driver module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings/cuda/cudart.pyx b/cuda_bindings/cuda/cudart.pyx deleted file mode 100644 index e3232975a..000000000 --- a/cuda_bindings/cuda/cudart.pyx +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import warnings as _warnings - -from cuda.bindings.runtime import * - - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.cudart module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.runtime module instead." ) - #else - #warning The cuda.cudart module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.runtime module instead. - #endif - """ - - -_warnings.warn("The cuda.cudart module is deprecated and will be removed in a future release, " - "please switch to use the cuda.bindings.runtime module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings/cuda/nvrtc.pyx b/cuda_bindings/cuda/nvrtc.pyx deleted file mode 100644 index 96b907069..000000000 --- a/cuda_bindings/cuda/nvrtc.pyx +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import warnings as _warnings - -from cuda.bindings.nvrtc import * - - -cdef extern from *: - """ - #ifdef _MSC_VER - #pragma message ( "The cuda.nvrtc module is deprecated and will be removed in a future release, " \ - "please switch to use the cuda.bindings.nvrtc module instead." ) - #else - #warning The cuda.nvrtc module is deprecated and will be removed in a future release, \ - please switch to use the cuda.bindings.nvrtc module instead. - #endif - """ - - -_warnings.warn("The cuda.nvrtc module is deprecated and will be removed in a future release, " - "please switch to use the cuda.bindings.nvrtc module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings/docs/source/release/13.0.0-notes.rst b/cuda_bindings/docs/source/release/13.0.0-notes.rst index 3df3ca48a..b80c5d7bb 100644 --- a/cuda_bindings/docs/source/release/13.0.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.0-notes.rst @@ -30,6 +30,13 @@ Highlights released before calling the underlying C APIs. +Breaking changes +---------------- + +* For breaking changes in the CUDA APIs, please see the `CUDA 13.0 release notes `_. +* The trampoline modules ``cuda.{cuda,cudart,nvrtc}`` are now removed. Users should switch to use ``cuda.bindings.{driver,runtime,nvrtc}`` instead. + + Bug fixes --------- diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 6b71d5ff7..4ba357602 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -346,8 +346,6 @@ def do_cythonize(extensions): (["cuda/bindings/utils/*.pyx"], None), # public *(([f], None) for f in cuda_bindings_files), - # public (deprecated, to be removed) - (["cuda/*.pyx"], None), # internal files used by generated bindings (["cuda/bindings/_internal/utils.pyx"], None), *(([f], None) for f in dst_files if f.endswith(".pyx")), From 382f49b23f6bd917154ca9598477dd2b6e6dee21 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 7 Aug 2025 00:25:03 +0800 Subject: [PATCH 008/113] Bump pathfinder to v1.1.0 (#805) * bump pathfinder to v1.0.1 * add release note * bump to 1.1.0 instead --- cuda_bindings/docs/source/release/12.9.1-notes.rst | 1 + cuda_bindings/docs/source/release/13.0.0-notes.rst | 1 + cuda_bindings/pyproject.toml | 2 +- cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/docs/source/release/12.9.1-notes.rst b/cuda_bindings/docs/source/release/12.9.1-notes.rst index 881d49d32..49531c9de 100644 --- a/cuda_bindings/docs/source/release/12.9.1-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.1-notes.rst @@ -42,6 +42,7 @@ Miscellaneous * Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. * Add a binding to ``nvvmGetErrorString()``. * Build the bindings with Cython profile hooks disabled. +* The internal pathfinder module is now isolated to a standalone package ``cuda-pathfinder`` and made as a required dependency. Known issues diff --git a/cuda_bindings/docs/source/release/13.0.0-notes.rst b/cuda_bindings/docs/source/release/13.0.0-notes.rst index b80c5d7bb..138ff6091 100644 --- a/cuda_bindings/docs/source/release/13.0.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.0-notes.rst @@ -51,6 +51,7 @@ Miscellaneous * Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. * Add a binding to ``nvvmGetErrorString()``. * Build the bindings with Cython profile hooks disabled. +* The internal pathfinder module is now isolated to a standalone package ``cuda-pathfinder`` and made as a required dependency. Known issues diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index bd6471cb1..d78d8f374 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -27,7 +27,7 @@ dynamic = [ "readme", ] dependencies = [ - "cuda-pathfinder ~= 1.0", + "cuda-pathfinder ~=1.1", "pywin32; sys_platform == 'win32'", ] diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 23e58fddb..a41dd93ed 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.0.0" +__version__ = "1.1.0" From fec95b88bb8047881920bd9e8cc96a7b53610bb8 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 7 Aug 2025 01:33:06 +0800 Subject: [PATCH 009/113] Make `Device.set_current()` faster (#781) * cache primary context * avoid increasing stack size * unconditionally set primary context to current --- cuda_core/cuda/core/experimental/_device.py | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_device.py b/cuda_core/cuda/core/experimental/_device.py index 0f7b551cc..384db9195 100644 --- a/cuda_core/cuda/core/experimental/_device.py +++ b/cuda_core/cuda/core/experimental/_device.py @@ -1022,6 +1022,18 @@ def _check_context_initialized(self): f"Device {self._id} is not yet initialized, perhaps you forgot to call .set_current() first?" ) + def _get_primary_context(self) -> driver.CUcontext: + try: + primary_ctxs = _tls.primary_ctxs + except AttributeError: + total = len(_tls.devices) + primary_ctxs = _tls.primary_ctxs = [None] * total + ctx = primary_ctxs[self._id] + if ctx is None: + ctx = handle_return(driver.cuDevicePrimaryCtxRetain(self._id)) + primary_ctxs[self._id] = ctx + return ctx + def _get_current_context(self, check_consistency=False) -> driver.CUcontext: err, ctx = driver.cuCtxGetCurrent() @@ -1186,20 +1198,9 @@ def set_current(self, ctx: Context = None) -> Union[Context, None]: if int(prev_ctx) != 0: return Context._from_ctx(prev_ctx, self._id) else: - ctx = handle_return(driver.cuCtxGetCurrent()) - if int(ctx) == 0: - # use primary ctx - ctx = handle_return(driver.cuDevicePrimaryCtxRetain(self._id)) - handle_return(driver.cuCtxPushCurrent(ctx)) - else: - ctx_id = handle_return(driver.cuCtxGetDevice()) - if ctx_id != self._id: - # use primary ctx - ctx = handle_return(driver.cuDevicePrimaryCtxRetain(self._id)) - handle_return(driver.cuCtxPushCurrent(ctx)) - else: - # no-op, a valid context already exists and is set current - pass + # use primary ctx + ctx = self._get_primary_context() + handle_return(driver.cuCtxSetCurrent(ctx)) self._has_inited = True def create_context(self, options: ContextOptions = None) -> Context: From 15e99e99ae607e023f37cc791a6650c5ae38c076 Mon Sep 17 00:00:00 2001 From: Keith Kraus Date: Wed, 6 Aug 2025 21:50:19 -0400 Subject: [PATCH 010/113] Fix pathfinder imports and handle access (#814) * Remove pathfinder redirect, update usage * fix handle attribute --- .../cuda/bindings/_bindings/cynvrtc.pyx.in | 6 +-- .../cuda/bindings/_internal/cufile_linux.pyx | 4 +- .../bindings/_internal/nvjitlink_linux.pyx | 4 +- .../bindings/_internal/nvjitlink_windows.pyx | 4 +- .../cuda/bindings/_internal/nvvm_linux.pyx | 4 +- .../cuda/bindings/_internal/nvvm_windows.pyx | 4 +- .../cuda/bindings/_path_finder/README.md | 3 -- .../temporary_backward_compatibility.py | 41 ------------------- cuda_bindings/cuda/bindings/path_finder.py | 15 ------- 9 files changed, 13 insertions(+), 72 deletions(-) delete mode 100644 cuda_bindings/cuda/bindings/_path_finder/README.md delete mode 100644 cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py delete mode 100644 cuda_bindings/cuda/bindings/path_finder.py diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index dc73708ef..965c61055 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -9,7 +9,7 @@ import win32api cimport cuda.bindings._lib.dlfcn as dlfcn from libc.stdint cimport uintptr_t {{endif}} -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib from libc.stdint cimport intptr_t cdef bint __cuPythonInit = False @@ -47,10 +47,10 @@ cdef int cuPythonInit() except -1 nogil: # Load library {{if 'Windows' == platform.system()}} with gil: - handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle + handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint {{else}} with gil: - handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle + handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint {{endif}} diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 66cb24ea7..1988e6c7a 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib import cython @@ -71,7 +71,7 @@ cdef void* __cuFileSetParameterString = NULL cdef void* load_library(const int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("cufile").handle + cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint return handle diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 62890c240..be773bdf2 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib ############################################################################### # Extern @@ -53,7 +53,7 @@ cdef void* __nvJitLinkVersion = NULL cdef void* load_library(int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint return handle diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index d08c43fde..88489448b 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib import win32api @@ -61,7 +61,7 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: raise RuntimeError('something went wrong') # Load library - handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle + handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint # Load function global __nvJitLinkCreate diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 38fb45efe..e07e94a5a 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib ############################################################################### # Extern @@ -52,7 +52,7 @@ cdef void* __nvvmGetProgramLog = NULL cdef void* load_library(const int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvvm").handle + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint return handle diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index ec47e11bf..ecf704324 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib import win32api @@ -60,7 +60,7 @@ cdef int _check_or_init_nvvm() except -1 nogil: raise RuntimeError('something went wrong') # Load library - handle = path_finder._load_nvidia_dynamic_library("nvvm").handle + handle = load_nvidia_dynamic_lib("nvvm")._handle_uint # Load function global __nvvmGetErrorString diff --git a/cuda_bindings/cuda/bindings/_path_finder/README.md b/cuda_bindings/cuda/bindings/_path_finder/README.md deleted file mode 100644 index 48b12163e..000000000 --- a/cuda_bindings/cuda/bindings/_path_finder/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# The `cuda.bindings.path_finder` module was moved → `cuda.pathfinder` - -`cuda.bindings.path_finder` is deprecated and slated to be removed in the next `cuda-bindings` major version release. diff --git a/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py b/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py deleted file mode 100644 index 0b7cb4d27..000000000 --- a/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This is for TEMPORARY BACKWARD COMPATIBILITY only. -# cuda.bindings.path_finder is deprecated and slated to be removed in the next cuda-bindings major version release. - -from dataclasses import dataclass -from typing import Optional - -from cuda.pathfinder import load_nvidia_dynamic_lib -from cuda.pathfinder._dynamic_libs import supported_nvidia_libs - -if supported_nvidia_libs.IS_WINDOWS: - import pywintypes - - from cuda.pathfinder._dynamic_libs.load_dl_windows import POINTER_ADDRESS_SPACE - - def _unsigned_int_to_pywintypes_handle(handle_uint: int) -> pywintypes.HANDLE: - handle_int = handle_uint - POINTER_ADDRESS_SPACE if handle_uint >= POINTER_ADDRESS_SPACE // 2 else handle_uint - return pywintypes.HANDLE(handle_int) - - HandleType = pywintypes.HANDLE -else: - HandleType = int - - -# Original implementation, before making handle private as _handle_uint. -@dataclass -class LoadedDL: - handle: HandleType # type: ignore[valid-type] - abs_path: Optional[str] - was_already_loaded_from_elsewhere: bool - - -def load_nvidia_dynamic_library(libname: str) -> LoadedDL: - loaded_dl_uint = load_nvidia_dynamic_lib(libname) - if supported_nvidia_libs.IS_WINDOWS: - handle = _unsigned_int_to_pywintypes_handle(loaded_dl_uint._handle_uint) - else: - handle = loaded_dl_uint._handle_uint - return LoadedDL(handle, loaded_dl_uint.abs_path, loaded_dl_uint.was_already_loaded_from_elsewhere) diff --git a/cuda_bindings/cuda/bindings/path_finder.py b/cuda_bindings/cuda/bindings/path_finder.py deleted file mode 100644 index fc6cade25..000000000 --- a/cuda_bindings/cuda/bindings/path_finder.py +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This file is for TEMPORARY BACKWARD COMPATIBILITY only. -# cuda.bindings.path_finder is deprecated and slated to be removed in the next cuda-bindings major version release. - -from cuda.bindings._path_finder.temporary_backward_compatibility import ( - load_nvidia_dynamic_library as _load_nvidia_dynamic_library, -) -from cuda.pathfinder import SUPPORTED_NVIDIA_LIBNAMES as _SUPPORTED_LIBNAMES - -__all__ = [ - "_load_nvidia_dynamic_library", - "_SUPPORTED_LIBNAMES", -] From e79cf86526ef8f023e12b560f49e4458c1f5418e Mon Sep 17 00:00:00 2001 From: "Marcus D. Hanwell" Date: Wed, 6 Aug 2025 22:09:48 -0400 Subject: [PATCH 011/113] Add run-id and github-token for pathfinder docs download (#815) * Add run-id and github-token for pathfinder * Check for release * Add the case for PRs * Simplify --- .github/workflows/build-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 23102741a..75d22ef4c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -120,6 +120,8 @@ jobs: with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder + run-id: ${{ inputs.run-id }} + github-token: ${{ github.token }} - name: Display structure of downloaded cuda-pathfinder artifacts run: | From b1acdb2fdcf28aa1396df38e8bc4f3037454c9e2 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 7 Aug 2025 11:10:52 +0800 Subject: [PATCH 012/113] Bump cuda.core to 0.3.2 (#817) * bump cuda.core 0.3.2 * update docs --- cuda_core/cuda/core/_version.py | 2 +- cuda_core/docs/source/release/0.3.2-notes.rst | 40 +++++++++++++++++++ cuda_core/docs/versions.json | 1 + cuda_core/pyproject.toml | 2 + 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 cuda_core/docs/source/release/0.3.2-notes.rst diff --git a/cuda_core/cuda/core/_version.py b/cuda_core/cuda/core/_version.py index 3ba92949c..df0a90552 100644 --- a/cuda_core/cuda/core/_version.py +++ b/cuda_core/cuda/core/_version.py @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.3.1" +__version__ = "0.3.2" diff --git a/cuda_core/docs/source/release/0.3.2-notes.rst b/cuda_core/docs/source/release/0.3.2-notes.rst new file mode 100644 index 000000000..8b4763ed3 --- /dev/null +++ b/cuda_core/docs/source/release/0.3.2-notes.rst @@ -0,0 +1,40 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. currentmodule:: cuda.core.experimental + +``cuda.core`` 0.3.2 Release Notes +================================= + +Released on Aug 7, 2025 + + +Highlights +---------- + +- Support CUDA 13. ``pip install cuda-core[cu13]`` also works now. +- This is the last release that officially supports CUDA 11. + + +Breaking Changes +---------------- + +None. + + +New features +------------ + +- :class:`Stream` and :class:`Event` can be subclassed now. + + +New examples +------------ + +None. + + +Fixes and enhancements +---------------------- + +- :meth:`Device.set_current` is made faster. diff --git a/cuda_core/docs/versions.json b/cuda_core/docs/versions.json index c4485906b..f5e2af0a2 100644 --- a/cuda_core/docs/versions.json +++ b/cuda_core/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", + "0.3.2" : "0.3.2", "0.3.1" : "0.3.1", "0.3.0" : "0.3.0", "0.2.0" : "0.2.0", diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index adfa6c568..83cec4d53 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -48,9 +48,11 @@ dependencies = [ [project.optional-dependencies] cu11 = ["cuda-bindings[all]==11.8.*"] cu12 = ["cuda-bindings[all]==12.*"] +cu13 = ["cuda-bindings[all]==13.*"] test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"] test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy +# TODO add test-cu13 once CuPy is ready [project.urls] homepage = "https://nvidia.github.io/cuda-python/" From 23b42f1c590512a2cbfac98ae32753343e5fae8b Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 7 Aug 2025 12:43:58 +0800 Subject: [PATCH 013/113] Add missing release note link (#819) --- cuda_core/docs/source/release.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_core/docs/source/release.rst b/cuda_core/docs/source/release.rst index dec506690..2f69e5872 100644 --- a/cuda_core/docs/source/release.rst +++ b/cuda_core/docs/source/release.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 3 + release/0.3.2-notes release/0.3.1-notes release/0.3.0-notes release/0.2.0-notes From f60c123fb9102744c8d00deb1d2754c53d2a8c34 Mon Sep 17 00:00:00 2001 From: Alexis Girault Date: Thu, 7 Aug 2025 01:04:47 -0400 Subject: [PATCH 014/113] Update URLs for cccl docs (#818) https://nvidia.github.io/cccl/cuda_ -> https://nvidia.github.io/cccl/python/ --- README.md | 4 ++-- cuda_python/DESCRIPTION.rst | 4 ++-- cuda_python/docs/source/conf.py | 4 ++-- cuda_python/docs/source/index.rst | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7cc64fafa..00e853e29 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c * [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities * [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs -* [cuda.cccl.cooperative](https://nvidia.github.io/cccl/cuda_cooperative/): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels -* [cuda.cccl.parallel](https://nvidia.github.io/cccl/cuda_parallel/): A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc. that are callable on the *host* +* [cuda.cccl.cooperative](https://nvidia.github.io/cccl/python/cooperative): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels +* [cuda.cccl.parallel](https://nvidia.github.io/cccl/python/parallel): A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc. that are callable on the *host* * [numba.cuda](https://nvidia.github.io/numba-cuda/): Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. * [nvmath-python](https://docs.nvidia.com/cuda/nvmath-python/latest): Pythonic access to NVIDIA CPU & GPU Math Libraries, with both [*host*](https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#host-apis) and [*device* (nvmath.device)](https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#device-apis) APIs. It also provides low-level Python bindings to host C APIs ([nvmath.bindings](https://docs.nvidia.com/cuda/nvmath-python/latest/bindings/index.html)). diff --git a/cuda_python/DESCRIPTION.rst b/cuda_python/DESCRIPTION.rst index 154c69893..e00114871 100644 --- a/cuda_python/DESCRIPTION.rst +++ b/cuda_python/DESCRIPTION.rst @@ -9,8 +9,8 @@ CUDA Python is the home for accessing NVIDIA's CUDA platform from Python. It con * `cuda.core `_: Pythonic access to CUDA Runtime and other core functionalities * `cuda.bindings `_: Low-level Python bindings to CUDA C APIs -* `cuda.cooperative `_: A Python package providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels -* `cuda.parallel `_: A Python package for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc, that are callable on the *host* +* `cuda.cooperative `_: A Python package providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels +* `cuda.parallel `_: A Python package for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc, that are callable on the *host* * `numba.cuda `_: Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. For access to NVIDIA CPU & GPU Math Libraries, please refer to `nvmath-python `_. diff --git a/cuda_python/docs/source/conf.py b/cuda_python/docs/source/conf.py index ef7f7eab0..aae73eb11 100644 --- a/cuda_python/docs/source/conf.py +++ b/cuda_python/docs/source/conf.py @@ -96,7 +96,7 @@ rst_epilog = f""" .. _cuda.core: {CUDA_PYTHON_DOMAIN}/cuda-core/latest .. _cuda.bindings: {CUDA_PYTHON_DOMAIN}/cuda-bindings/latest -.. _cuda.cccl.cooperative: https://nvidia.github.io/cccl/cuda_cooperative/ -.. _cuda.cccl.parallel: https://nvidia.github.io/cccl/cuda_parallel/ +.. _cuda.cccl.cooperative: https://nvidia.github.io/cccl/python/cooperative +.. _cuda.cccl.parallel: https://nvidia.github.io/cccl/python/parallel .. _numba.cuda: https://nvidia.github.io/numba-cuda/ """ diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index 5b16ac20a..6990df6c4 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -33,7 +33,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio release.md cuda.core cuda.bindings - cuda.cccl.cooperative - cuda.cccl.parallel + cuda.cccl.cooperative + cuda.cccl.parallel numba.cuda nvmath-python From 99406c673ee38a2a9263aec6ba463c666933a9b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:03:40 +0000 Subject: [PATCH 015/113] Bump PyCQA/bandit-action from 1.0.0 to 1.0.1 (#801) Bumps [PyCQA/bandit-action](https://github.com/pycqa/bandit-action) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/pycqa/bandit-action/releases) - [Commits](https://github.com/pycqa/bandit-action/compare/8a1b30610f61f3f792fe7556e888c9d7dffa52de...67a458d90fa11fb1463e91e7f4c8f068b5863c7f) --- updated-dependencies: - dependency-name: PyCQA/bandit-action dependency-version: 1.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bandit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index a83f776a2..c80831095 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -20,4 +20,4 @@ jobs: security-events: write steps: - name: Perform Bandit Analysis - uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de # v1.0.0 + uses: PyCQA/bandit-action@67a458d90fa11fb1463e91e7f4c8f068b5863c7f # v1.0.1 From 3f6f35718ec41873b65b331c3d504941728ae6a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:14:10 +0000 Subject: [PATCH 016/113] Bump pypa/cibuildwheel from 3.1.1 to 3.1.3 (#800) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.1.1 to 3.1.3. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/e6de07ed3921b51089aae6981989889cf1eddd0c...352e01339f0a173aa2a3eb57f01492e341e83865) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-version: 3.1.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 20b71e251..4af5179b2 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -107,7 +107,7 @@ jobs: if-no-files-found: error - name: Build cuda.core wheel - uses: pypa/cibuildwheel@e6de07ed3921b51089aae6981989889cf1eddd0c # v3.1.1 + uses: pypa/cibuildwheel@352e01339f0a173aa2a3eb57f01492e341e83865 # v3.1.3 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" @@ -149,7 +149,7 @@ jobs: cuda-version: ${{ inputs.cuda-version }} - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@e6de07ed3921b51089aae6981989889cf1eddd0c # v3.1.1 + uses: pypa/cibuildwheel@352e01339f0a173aa2a3eb57f01492e341e83865 # v3.1.3 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" From 9be291713081ddd94b766d4b7118681bd0b66c8e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 9 Aug 2025 01:09:22 -0700 Subject: [PATCH 017/113] Bump cuda_pathfinder, cuda_bindings, cuda_core patch versions, with `a0` suffix. (#824) --- cuda_bindings/cuda/bindings/_version.py | 2 +- cuda_core/cuda/core/_version.py | 2 +- cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_version.py b/cuda_bindings/cuda/bindings/_version.py index 288ec3d52..e695b83a8 100644 --- a/cuda_bindings/cuda/bindings/_version.py +++ b/cuda_bindings/cuda/bindings/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -__version__ = "13.0.0" +__version__ = "13.0.1a0" diff --git a/cuda_core/cuda/core/_version.py b/cuda_core/cuda/core/_version.py index df0a90552..8326aa224 100644 --- a/cuda_core/cuda/core/_version.py +++ b/cuda_core/cuda/core/_version.py @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.3.2" +__version__ = "0.3.3a0" diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index a41dd93ed..c2de46d74 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.1.0" +__version__ = "1.1.1a0" From 2400e469b9985b307d03821cc79c3ba92d9d1416 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 03:39:22 +0000 Subject: [PATCH 018/113] Bump github/codeql-action from 3.29.4 to 3.29.5 (#799) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.4 to 3.29.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4e828ff8d448a8a6e532957b1811f387a63867e8...51f77329afa6477de8c49fc9c7046c15b9a4e79d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 737091de2..a896cebf4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,13 +31,13 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8 with: category: "/language:${{matrix.language}}" From 485531dd7290a9f2ba8b36d66d08694f00063f1c Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 11 Aug 2025 20:42:35 -0700 Subject: [PATCH 019/113] Minimal cufile cuda_bindings updates for CTK 13 (#826) * Transfer from codegen, NO manual changes. * Transfer fix from codegen, NO manual changes. --- .../cuda/bindings/_internal/cufile.pxd | 15 +- .../cuda/bindings/_internal/cufile_linux.pyx | 275 +++++++++++++++++- cuda_bindings/cuda/bindings/cufile.pxd | 8 +- cuda_bindings/cuda/bindings/cufile.pyx | 18 +- cuda_bindings/cuda/bindings/cycufile.pxd | 117 +++++++- cuda_bindings/cuda/bindings/cycufile.pyx | 54 +++- 6 files changed, 481 insertions(+), 6 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index 9cccb9fee..9150b394e 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. from ..cycufile cimport * @@ -41,3 +41,16 @@ cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 1988e6c7a..d175b23e7 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t @@ -68,6 +68,19 @@ cdef void* __cuFileGetParameterString = NULL cdef void* __cuFileSetParameterSizeT = NULL cdef void* __cuFileSetParameterBool = NULL cdef void* __cuFileSetParameterString = NULL +cdef void* __cuFileDriverClose = NULL +cdef void* __cuFileGetParameterMinMaxValue = NULL +cdef void* __cuFileSetStatsLevel = NULL +cdef void* __cuFileGetStatsLevel = NULL +cdef void* __cuFileStatsStart = NULL +cdef void* __cuFileStatsStop = NULL +cdef void* __cuFileStatsReset = NULL +cdef void* __cuFileGetStatsL1 = NULL +cdef void* __cuFileGetStatsL2 = NULL +cdef void* __cuFileGetStatsL3 = NULL +cdef void* __cuFileGetBARSizeInKB = NULL +cdef void* __cuFileSetParameterPosixPoolSlabArray = NULL +cdef void* __cuFileGetParameterPosixPoolSlabArray = NULL cdef void* load_library(const int driver_ver) except* with gil: @@ -312,6 +325,97 @@ cdef int _check_or_init_cufile() except -1 nogil: handle = load_library(driver_ver) __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') + global __cuFileDriverClose + __cuFileDriverClose = dlsym(RTLD_DEFAULT, 'cuFileDriverClose') + if __cuFileDriverClose == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverClose = dlsym(handle, 'cuFileDriverClose') + + global __cuFileGetParameterMinMaxValue + __cuFileGetParameterMinMaxValue = dlsym(RTLD_DEFAULT, 'cuFileGetParameterMinMaxValue') + if __cuFileGetParameterMinMaxValue == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterMinMaxValue = dlsym(handle, 'cuFileGetParameterMinMaxValue') + + global __cuFileSetStatsLevel + __cuFileSetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileSetStatsLevel') + if __cuFileSetStatsLevel == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetStatsLevel = dlsym(handle, 'cuFileSetStatsLevel') + + global __cuFileGetStatsLevel + __cuFileGetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileGetStatsLevel') + if __cuFileGetStatsLevel == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsLevel = dlsym(handle, 'cuFileGetStatsLevel') + + global __cuFileStatsStart + __cuFileStatsStart = dlsym(RTLD_DEFAULT, 'cuFileStatsStart') + if __cuFileStatsStart == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsStart = dlsym(handle, 'cuFileStatsStart') + + global __cuFileStatsStop + __cuFileStatsStop = dlsym(RTLD_DEFAULT, 'cuFileStatsStop') + if __cuFileStatsStop == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsStop = dlsym(handle, 'cuFileStatsStop') + + global __cuFileStatsReset + __cuFileStatsReset = dlsym(RTLD_DEFAULT, 'cuFileStatsReset') + if __cuFileStatsReset == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsReset = dlsym(handle, 'cuFileStatsReset') + + global __cuFileGetStatsL1 + __cuFileGetStatsL1 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL1') + if __cuFileGetStatsL1 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL1 = dlsym(handle, 'cuFileGetStatsL1') + + global __cuFileGetStatsL2 + __cuFileGetStatsL2 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL2') + if __cuFileGetStatsL2 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL2 = dlsym(handle, 'cuFileGetStatsL2') + + global __cuFileGetStatsL3 + __cuFileGetStatsL3 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL3') + if __cuFileGetStatsL3 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL3 = dlsym(handle, 'cuFileGetStatsL3') + + global __cuFileGetBARSizeInKB + __cuFileGetBARSizeInKB = dlsym(RTLD_DEFAULT, 'cuFileGetBARSizeInKB') + if __cuFileGetBARSizeInKB == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetBARSizeInKB = dlsym(handle, 'cuFileGetBARSizeInKB') + + global __cuFileSetParameterPosixPoolSlabArray + __cuFileSetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileSetParameterPosixPoolSlabArray') + if __cuFileSetParameterPosixPoolSlabArray == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileSetParameterPosixPoolSlabArray') + + global __cuFileGetParameterPosixPoolSlabArray + __cuFileGetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileGetParameterPosixPoolSlabArray') + if __cuFileGetParameterPosixPoolSlabArray == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileGetParameterPosixPoolSlabArray') + __py_cufile_init = True return 0 @@ -417,6 +521,45 @@ cpdef dict _inspect_function_pointers(): global __cuFileSetParameterString data["__cuFileSetParameterString"] = __cuFileSetParameterString + global __cuFileDriverClose + data["__cuFileDriverClose"] = __cuFileDriverClose + + global __cuFileGetParameterMinMaxValue + data["__cuFileGetParameterMinMaxValue"] = __cuFileGetParameterMinMaxValue + + global __cuFileSetStatsLevel + data["__cuFileSetStatsLevel"] = __cuFileSetStatsLevel + + global __cuFileGetStatsLevel + data["__cuFileGetStatsLevel"] = __cuFileGetStatsLevel + + global __cuFileStatsStart + data["__cuFileStatsStart"] = __cuFileStatsStart + + global __cuFileStatsStop + data["__cuFileStatsStop"] = __cuFileStatsStop + + global __cuFileStatsReset + data["__cuFileStatsReset"] = __cuFileStatsReset + + global __cuFileGetStatsL1 + data["__cuFileGetStatsL1"] = __cuFileGetStatsL1 + + global __cuFileGetStatsL2 + data["__cuFileGetStatsL2"] = __cuFileGetStatsL2 + + global __cuFileGetStatsL3 + data["__cuFileGetStatsL3"] = __cuFileGetStatsL3 + + global __cuFileGetBARSizeInKB + data["__cuFileGetBARSizeInKB"] = __cuFileGetBARSizeInKB + + global __cuFileSetParameterPosixPoolSlabArray + data["__cuFileSetParameterPosixPoolSlabArray"] = __cuFileSetParameterPosixPoolSlabArray + + global __cuFileGetParameterPosixPoolSlabArray + data["__cuFileGetParameterPosixPoolSlabArray"] = __cuFileGetParameterPosixPoolSlabArray + func_ptrs = data return data @@ -732,3 +875,133 @@ cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param raise FunctionNotFoundError("function cuFileSetParameterString is not found") return (__cuFileSetParameterString)( param, desc_str) + + +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverClose + _check_or_init_cufile() + if __cuFileDriverClose == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverClose is not found") + return (__cuFileDriverClose)( + ) + + +cdef CUfileError_t _cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetParameterMinMaxValue + _check_or_init_cufile() + if __cuFileGetParameterMinMaxValue == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetParameterMinMaxValue is not found") + return (__cuFileGetParameterMinMaxValue)( + param, min_value, max_value) + + +cdef CUfileError_t _cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil: + global __cuFileSetStatsLevel + _check_or_init_cufile() + if __cuFileSetStatsLevel == NULL: + with gil: + raise FunctionNotFoundError("function cuFileSetStatsLevel is not found") + return (__cuFileSetStatsLevel)( + level) + + +cdef CUfileError_t _cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetStatsLevel + _check_or_init_cufile() + if __cuFileGetStatsLevel == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetStatsLevel is not found") + return (__cuFileGetStatsLevel)( + level) + + +cdef CUfileError_t _cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil: + global __cuFileStatsStart + _check_or_init_cufile() + if __cuFileStatsStart == NULL: + with gil: + raise FunctionNotFoundError("function cuFileStatsStart is not found") + return (__cuFileStatsStart)( + ) + + +cdef CUfileError_t _cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil: + global __cuFileStatsStop + _check_or_init_cufile() + if __cuFileStatsStop == NULL: + with gil: + raise FunctionNotFoundError("function cuFileStatsStop is not found") + return (__cuFileStatsStop)( + ) + + +cdef CUfileError_t _cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil: + global __cuFileStatsReset + _check_or_init_cufile() + if __cuFileStatsReset == NULL: + with gil: + raise FunctionNotFoundError("function cuFileStatsReset is not found") + return (__cuFileStatsReset)( + ) + + +cdef CUfileError_t _cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetStatsL1 + _check_or_init_cufile() + if __cuFileGetStatsL1 == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetStatsL1 is not found") + return (__cuFileGetStatsL1)( + stats) + + +cdef CUfileError_t _cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetStatsL2 + _check_or_init_cufile() + if __cuFileGetStatsL2 == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetStatsL2 is not found") + return (__cuFileGetStatsL2)( + stats) + + +cdef CUfileError_t _cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetStatsL3 + _check_or_init_cufile() + if __cuFileGetStatsL3 == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetStatsL3 is not found") + return (__cuFileGetStatsL3)( + stats) + + +cdef CUfileError_t _cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetBARSizeInKB + _check_or_init_cufile() + if __cuFileGetBARSizeInKB == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetBARSizeInKB is not found") + return (__cuFileGetBARSizeInKB)( + gpuIndex, barSize) + + +cdef CUfileError_t _cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil: + global __cuFileSetParameterPosixPoolSlabArray + _check_or_init_cufile() + if __cuFileSetParameterPosixPoolSlabArray == NULL: + with gil: + raise FunctionNotFoundError("function cuFileSetParameterPosixPoolSlabArray is not found") + return (__cuFileSetParameterPosixPoolSlabArray)( + size_values, count_values, len) + + +cdef CUfileError_t _cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetParameterPosixPoolSlabArray + _check_or_init_cufile() + if __cuFileGetParameterPosixPoolSlabArray == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetParameterPosixPoolSlabArray is not found") + return (__cuFileGetParameterPosixPoolSlabArray)( + size_values, count_values, len) diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 69fc6fc67..f79a7fdf8 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t @@ -18,7 +18,12 @@ ctypedef CUfileBatchHandle_t BatchHandle ctypedef CUfileError_t Error ctypedef cufileRDMAInfo_t RDMAInfo ctypedef CUfileFSOps_t FSOps +ctypedef CUfileOpCounter_t OpCounter +ctypedef CUfilePerGpuStats_t PerGpuStats ctypedef CUfileDrvProps_t DrvProps +ctypedef CUfileStatsLevel1_t StatsLevel1 +ctypedef CUfileStatsLevel2_t StatsLevel2 +ctypedef CUfileStatsLevel3_t StatsLevel3 ############################################################################### @@ -36,6 +41,7 @@ ctypedef CUfileBatchMode_t _BatchMode ctypedef CUFileSizeTConfigParameter_t _SizeTConfigParameter ctypedef CUFileBoolConfigParameter_t _BoolConfigParameter ctypedef CUFileStringConfigParameter_t _StringConfigParameter +ctypedef CUFileArrayConfigParameter_t _ArrayConfigParameter ############################################################################### diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index 9fe54009e..6a53d145d 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. cimport cython # NOQA from libc cimport errno @@ -859,6 +859,17 @@ class OpError(_IntEnum): GPU_MEMORY_PINNING_FAILED = CU_FILE_GPU_MEMORY_PINNING_FAILED BATCH_FULL = CU_FILE_BATCH_FULL ASYNC_NOT_SUPPORTED = CU_FILE_ASYNC_NOT_SUPPORTED + INTERNAL_BATCH_SETUP_ERROR = CU_FILE_INTERNAL_BATCH_SETUP_ERROR + INTERNAL_BATCH_SUBMIT_ERROR = CU_FILE_INTERNAL_BATCH_SUBMIT_ERROR + INTERNAL_BATCH_GETSTATUS_ERROR = CU_FILE_INTERNAL_BATCH_GETSTATUS_ERROR + INTERNAL_BATCH_CANCEL_ERROR = CU_FILE_INTERNAL_BATCH_CANCEL_ERROR + NOMEM_ERROR = CU_FILE_NOMEM_ERROR + IO_ERROR = CU_FILE_IO_ERROR + INTERNAL_BUF_REGISTER_ERROR = CU_FILE_INTERNAL_BUF_REGISTER_ERROR + HASH_OPR_ERROR = CU_FILE_HASH_OPR_ERROR + INVALID_CONTEXT_ERROR = CU_FILE_INVALID_CONTEXT_ERROR + NVFS_INTERNAL_DRIVER_ERROR = CU_FILE_NVFS_INTERNAL_DRIVER_ERROR + BATCH_NOCOMPAT_ERROR = CU_FILE_BATCH_NOCOMPAT_ERROR IO_MAX_ERROR = CU_FILE_IO_MAX_ERROR class DriverStatusFlags(_IntEnum): @@ -949,6 +960,11 @@ class StringConfigParameter(_IntEnum): ENV_LOGFILE_PATH = CUFILE_PARAM_ENV_LOGFILE_PATH LOG_DIR = CUFILE_PARAM_LOG_DIR +class ArrayConfigParameter(_IntEnum): + """See `CUFileArrayConfigParameter_t`.""" + POSIX_POOL_SLAB_SIZE_KB = CUFILE_PARAM_POSIX_POOL_SLAB_SIZE_KB + POSIX_POOL_SLAB_COUNT = CUFILE_PARAM_POSIX_POOL_SLAB_COUNT + ############################################################################### # Error handling diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index ac19e14e2..a55e43336 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +from libc.stdint cimport uint32_t, uint64_t from libc.time cimport time_t from libcpp cimport bool as cpp_bool from posix.types cimport off_t @@ -69,6 +70,17 @@ cdef extern from '': CU_FILE_GPU_MEMORY_PINNING_FAILED CU_FILE_BATCH_FULL CU_FILE_ASYNC_NOT_SUPPORTED + CU_FILE_INTERNAL_BATCH_SETUP_ERROR + CU_FILE_INTERNAL_BATCH_SUBMIT_ERROR + CU_FILE_INTERNAL_BATCH_GETSTATUS_ERROR + CU_FILE_INTERNAL_BATCH_CANCEL_ERROR + CU_FILE_NOMEM_ERROR + CU_FILE_IO_ERROR + CU_FILE_INTERNAL_BUF_REGISTER_ERROR + CU_FILE_HASH_OPR_ERROR + CU_FILE_INVALID_CONTEXT_ERROR + CU_FILE_NVFS_INTERNAL_DRIVER_ERROR + CU_FILE_BATCH_NOCOMPAT_ERROR CU_FILE_IO_MAX_ERROR ctypedef enum CUfileDriverStatusFlags_t: @@ -149,6 +161,10 @@ cdef extern from '': CUFILE_PARAM_ENV_LOGFILE_PATH CUFILE_PARAM_LOG_DIR + ctypedef enum CUFileArrayConfigParameter_t: + CUFILE_PARAM_POSIX_POOL_SLAB_SIZE_KB + CUFILE_PARAM_POSIX_POOL_SLAB_COUNT + # types ctypedef void* CUfileHandle_t 'CUfileHandle_t' ctypedef void* CUfileBatchHandle_t 'CUfileBatchHandle_t' @@ -184,6 +200,40 @@ cdef extern from '': void* cookie CUfileStatus_t status size_t ret + ctypedef struct CUfileOpCounter_t 'CUfileOpCounter_t': + uint64_t ok + uint64_t err + ctypedef struct CUfilePerGpuStats_t 'CUfilePerGpuStats_t': + char uuid[16] + uint64_t read_bytes + uint64_t read_bw_bytes_per_sec + uint64_t read_utilization + uint64_t read_duration_us + uint64_t n_total_reads + uint64_t n_p2p_reads + uint64_t n_nvfs_reads + uint64_t n_posix_reads + uint64_t n_unaligned_reads + uint64_t n_dr_reads + uint64_t n_sparse_regions + uint64_t n_inline_regions + uint64_t n_reads_err + uint64_t writes_bytes + uint64_t write_bw_bytes_per_sec + uint64_t write_utilization + uint64_t write_duration_us + uint64_t n_total_writes + uint64_t n_p2p_writes + uint64_t n_nvfs_writes + uint64_t n_posix_writes + uint64_t n_unaligned_writes + uint64_t n_dr_writes + uint64_t n_writes_err + uint64_t n_mmap + uint64_t n_mmap_ok + uint64_t n_mmap_err + uint64_t n_mmap_free + uint64_t reg_bytes ctypedef struct CUfileDrvProps_t 'CUfileDrvProps_t': _anon_pod0 nvfs unsigned int fflags @@ -198,12 +248,64 @@ cdef extern from '': CUfileFSOps_t* fs_ops cdef union _anon_pod2 '_anon_pod2': _anon_pod3 batch + ctypedef struct CUfileStatsLevel1_t 'CUfileStatsLevel1_t': + CUfileOpCounter_t read_ops + CUfileOpCounter_t write_ops + CUfileOpCounter_t hdl_register_ops + CUfileOpCounter_t hdl_deregister_ops + CUfileOpCounter_t buf_register_ops + CUfileOpCounter_t buf_deregister_ops + uint64_t read_bytes + uint64_t write_bytes + uint64_t read_bw_bytes_per_sec + uint64_t write_bw_bytes_per_sec + uint64_t read_lat_avg_us + uint64_t write_lat_avg_us + uint64_t read_ops_per_sec + uint64_t write_ops_per_sec + uint64_t read_lat_sum_us + uint64_t write_lat_sum_us + CUfileOpCounter_t batch_submit_ops + CUfileOpCounter_t batch_complete_ops + CUfileOpCounter_t batch_setup_ops + CUfileOpCounter_t batch_cancel_ops + CUfileOpCounter_t batch_destroy_ops + CUfileOpCounter_t batch_enqueued_ops + CUfileOpCounter_t batch_posix_enqueued_ops + CUfileOpCounter_t batch_processed_ops + CUfileOpCounter_t batch_posix_processed_ops + CUfileOpCounter_t batch_nvfs_submit_ops + CUfileOpCounter_t batch_p2p_submit_ops + CUfileOpCounter_t batch_aio_submit_ops + CUfileOpCounter_t batch_iouring_submit_ops + CUfileOpCounter_t batch_mixed_io_submit_ops + CUfileOpCounter_t batch_total_submit_ops + uint64_t batch_read_bytes + uint64_t batch_write_bytes + uint64_t batch_read_bw_bytes + uint64_t batch_write_bw_bytes + uint64_t batch_submit_lat_avg_us + uint64_t batch_completion_lat_avg_us + uint64_t batch_submit_ops_per_sec + uint64_t batch_complete_ops_per_sec + uint64_t batch_submit_lat_sum_us + uint64_t batch_completion_lat_sum_us + uint64_t last_batch_read_bytes + uint64_t last_batch_write_bytes ctypedef struct CUfileIOParams_t 'CUfileIOParams_t': CUfileBatchMode_t mode _anon_pod2 u CUfileHandle_t fh CUfileOpcode_t opcode void* cookie + ctypedef struct CUfileStatsLevel2_t 'CUfileStatsLevel2_t': + CUfileStatsLevel1_t basic + uint64_t read_size_kb_hist[32] + uint64_t write_size_kb_hist[32] + ctypedef struct CUfileStatsLevel3_t 'CUfileStatsLevel3_t': + CUfileStatsLevel2_t detailed + uint32_t num_gpus + CUfilePerGpuStats_t per_gpu_stats[16] cdef extern from *: @@ -254,3 +356,16 @@ cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index 621bd083c..96f0172d0 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. from ._internal cimport cufile as _cufile @@ -132,3 +132,55 @@ cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil: return _cufile._cuFileSetParameterString(param, desc_str) + + +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverClose() + + +cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetParameterMinMaxValue(param, min_value, max_value) + + +cdef CUfileError_t cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileSetStatsLevel(level) + + +cdef CUfileError_t cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetStatsLevel(level) + + +cdef CUfileError_t cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileStatsStart() + + +cdef CUfileError_t cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileStatsStop() + + +cdef CUfileError_t cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileStatsReset() + + +cdef CUfileError_t cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetStatsL1(stats) + + +cdef CUfileError_t cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetStatsL2(stats) + + +cdef CUfileError_t cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetStatsL3(stats) + + +cdef CUfileError_t cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetBARSizeInKB(gpuIndex, barSize) + + +cdef CUfileError_t cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileSetParameterPosixPoolSlabArray(size_values, count_values, len) + + +cdef CUfileError_t cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetParameterPosixPoolSlabArray(size_values, count_values, len) From c6f2c84fbeda33fe06c37611bdad30c215b2a8d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 00:50:21 -0700 Subject: [PATCH 020/113] Bump actions/download-artifact from 4.3.0 to 5.0.0 (#830) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.3.0 to 5.0.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/d3f86a106a0bac45b974a628896c90dbdf5c8093...634f93cb2916e3fdff6788551b99b062d0335ce0) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 12 ++++++------ .github/workflows/test-wheel-linux.yml | 12 ++++++------ .github/workflows/test-wheel-windows.yml | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 75d22ef4c..40c9d58ea 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -103,7 +103,7 @@ jobs: echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV - name: Download cuda-python build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-python-wheel path: . @@ -116,7 +116,7 @@ jobs: ls -lahR . - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder @@ -130,14 +130,14 @@ jobs: - name: Download cuda.bindings build artifacts if: ${{ !inputs.is-release }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - name: Download cuda.bindings build artifacts if: ${{ inputs.is-release }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} merge-multiple: true @@ -152,14 +152,14 @@ jobs: - name: Download cuda.core build artifacts if: ${{ !inputs.is-release }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - name: Download cuda.core build artifacts if: ${{ inputs.is-release }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }} merge-multiple: true diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index f7b1e6064..5e6fab083 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -162,21 +162,21 @@ jobs: run: ./ci/tools/env-vars test - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder - name: Download cuda-python build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-python-wheel path: . - name: Download cuda.bindings build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} @@ -228,7 +228,7 @@ jobs: - name: Download cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} @@ -240,7 +240,7 @@ jobs: ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR - name: Download cuda.core build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} @@ -252,7 +252,7 @@ jobs: - name: Download cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 99cdca6c3..d8cd1918c 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -122,21 +122,21 @@ jobs: run: ./ci/tools/env-vars test - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder - name: Download cuda-python build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: cuda-python-wheel path: . - name: Download cuda.bindings build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} @@ -209,7 +209,7 @@ jobs: - name: Download cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} @@ -221,7 +221,7 @@ jobs: Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.core build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} @@ -233,7 +233,7 @@ jobs: - name: Download cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} From ad0687302337db4e4cca6e51dfa91775d020638f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 02:00:43 -0700 Subject: [PATCH 021/113] Bump actions/checkout from 4.2.2 to 5.0.0 (#831) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...08c6903cd8c0fde910a37f88322edcfb5dd907a8) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve --- .github/workflows/backport.yml | 2 +- .github/workflows/build-docs.yml | 2 +- .github/workflows/build-wheel.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/release-upload.yml | 2 +- .github/workflows/test-wheel-linux.yml | 2 +- .github/workflows/test-wheel-windows.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 97549c66f..fcd9459f9 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -23,7 +23,7 @@ jobs: }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Load branch name id: get-branch diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 40c9d58ea..daebdad4d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -47,7 +47,7 @@ jobs: shell: bash -el {0} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 ref: ${{ inputs.git-tag }} diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 4af5179b2..20995f2cb 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -36,7 +36,7 @@ jobs: (inputs.host-platform == 'win-64' && 'windows-2022') }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccabde7a2..823be159f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }} steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: Get CUDA build version diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a896cebf4..41d266f60 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: build-mode: none steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8 diff --git a/.github/workflows/release-upload.yml b/.github/workflows/release-upload.yml index 1923cbe01..402f0acfd 100644 --- a/.github/workflows/release-upload.yml +++ b/.github/workflows/release-upload.yml @@ -33,7 +33,7 @@ jobs: ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ inputs.git-tag }} steps: - name: Checkout Source - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 ref: ${{ inputs.git-tag }} diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 5e6fab083..a0776a360 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -139,7 +139,7 @@ jobs: run: nvidia-smi - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index d8cd1918c..7fb534273 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -85,7 +85,7 @@ jobs: runs-on: 'cuda-python-windows-gpu-github' steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 From b87c7871d675f50fca3beab051ca383d815df8d9 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 13 Aug 2025 01:40:20 +0800 Subject: [PATCH 022/113] Make it clear `cuda-pathfinder` is installed as part of `cuda-python` (#827) * make it clear cuda-pathfinder is installed as part of cuda-python * Update README.md * rewording + add placeholder hyperlinks --- README.md | 1 + cuda_python/docs/source/index.rst | 3 +++ cuda_python/docs/source/release/12.9.1-notes.rst | 1 + cuda_python/docs/source/release/13.0.0-notes.rst | 1 + cuda_python/setup.py | 1 + 5 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 00e853e29..5f8f3a11e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c * [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities * [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs +* [cuda.pathfinder](https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md): Utilities for locating CUDA components installed in the user's Python environment * [cuda.cccl.cooperative](https://nvidia.github.io/cccl/python/cooperative): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels * [cuda.cccl.parallel](https://nvidia.github.io/cccl/python/parallel): A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc. that are callable on the *host* * [numba.cuda](https://nvidia.github.io/numba-cuda/): Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index 6990df6c4..f0ed6f52d 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -9,11 +9,13 @@ multiple components: - `cuda.core`_: Pythonic access to CUDA runtime and other core functionalities - `cuda.bindings`_: Low-level Python bindings to CUDA C APIs +- `cuda.pathfinder_`: Utilities for locating CUDA components installed in the user's Python environment - `cuda.cccl.cooperative`_: A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels - `cuda.cccl.parallel`_: A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like ``sort``, ``scan``, ``reduce``, ``transform``, etc, that are callable on the *host* - `numba.cuda`_: Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. * `nvmath-python`_: Pythonic access to NVIDIA CPU & GPU Math Libraries, with both *host* and *device* (through `nvmath.device`_) APIs. It also provides low-level Python bindings to host C APIs (through `nvmath.bindings`_). +.. _cuda.pathfinder: https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md .. _nvmath-python: https://docs.nvidia.com/cuda/nvmath-python/latest .. _nvmath.device: https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#device-apis .. _nvmath.bindings: https://docs.nvidia.com/cuda/nvmath-python/latest/bindings/index.html @@ -33,6 +35,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio release.md cuda.core cuda.bindings + cuda.pathfinder cuda.cccl.cooperative cuda.cccl.parallel numba.cuda diff --git a/cuda_python/docs/source/release/12.9.1-notes.rst b/cuda_python/docs/source/release/12.9.1-notes.rst index 282cd56f7..444b7c9ca 100644 --- a/cuda_python/docs/source/release/12.9.1-notes.rst +++ b/cuda_python/docs/source/release/12.9.1-notes.rst @@ -11,6 +11,7 @@ Included components ------------------- * `cuda.bindings 12.9.1 `_ +* `cuda.pathfinder 1.1.0 `_ Highlights diff --git a/cuda_python/docs/source/release/13.0.0-notes.rst b/cuda_python/docs/source/release/13.0.0-notes.rst index 140c28839..e89534bc9 100644 --- a/cuda_python/docs/source/release/13.0.0-notes.rst +++ b/cuda_python/docs/source/release/13.0.0-notes.rst @@ -11,6 +11,7 @@ Included components ------------------- * `cuda.bindings 13.0.0 `_ +* `cuda.pathfinder 1.1.0 `_ Highlights diff --git a/cuda_python/setup.py b/cuda_python/setup.py index dd84f5579..f50dad33c 100644 --- a/cuda_python/setup.py +++ b/cuda_python/setup.py @@ -17,6 +17,7 @@ version=version, install_requires=[ f"cuda-bindings~={version}", + "cuda-pathfinder~=1.1", ], extras_require={ "all": [f"cuda-bindings[all]~={version}"], From 59d1b6be82e857c6c50bf513e99b7b37ed71a4aa Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 14 Aug 2025 15:44:11 -0400 Subject: [PATCH 023/113] Improve #449: Improve StridedMemoryView creation time Two changes: 1. Refactor the versioned/non-versioned paths to reduce the number of branches. 2. Create shape and strides tuples using Python/C API --- .../cuda/core/experimental/_memoryview.pyx | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index abe27b8ab..b80d3b545 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -184,48 +184,52 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): stream=int(stream_ptr) if stream_ptr else None) cdef void* data = NULL + cdef DLTensor* dl_tensor + cdef DLManagedTensorVersioned* dlm_tensor_ver + cdef DLManagedTensor* dlm_tensor + cdef const char *used_name if cpython.PyCapsule_IsValid( capsule, DLPACK_VERSIONED_TENSOR_UNUSED_NAME): data = cpython.PyCapsule_GetPointer( capsule, DLPACK_VERSIONED_TENSOR_UNUSED_NAME) versioned = True + dlm_tensor_ver = data + dl_tensor = &dlm_tensor_ver.dl_tensor + is_readonly = bool((dlm_tensor_ver.flags & DLPACK_FLAG_BITMASK_READ_ONLY) != 0) + used_name = DLPACK_VERSIONED_TENSOR_USED_NAME elif cpython.PyCapsule_IsValid( capsule, DLPACK_TENSOR_UNUSED_NAME): data = cpython.PyCapsule_GetPointer( capsule, DLPACK_TENSOR_UNUSED_NAME) versioned = False - else: - assert False - - cdef DLManagedTensor* dlm_tensor - cdef DLManagedTensorVersioned* dlm_tensor_ver - cdef DLTensor* dl_tensor - if versioned: - dlm_tensor_ver = data - dl_tensor = &dlm_tensor_ver.dl_tensor - is_readonly = bool((dlm_tensor_ver.flags & DLPACK_FLAG_BITMASK_READ_ONLY) != 0) - else: dlm_tensor = data dl_tensor = &dlm_tensor.dl_tensor is_readonly = False + used_name = DLPACK_TENSOR_USED_NAME + else: + assert False cdef StridedMemoryView buf = StridedMemoryView() if view is None else view buf.ptr = (dl_tensor.data) - buf.shape = tuple(int(dl_tensor.shape[i]) for i in range(dl_tensor.ndim)) + + # Construct shape and strides tuples using the Python/C API for speed + buf.shape = cpython.PyTuple_New(dl_tensor.ndim) + for i in range(dl_tensor.ndim): + cpython.PyTuple_SET_ITEM(buf.shape, i, cpython.PyLong_FromLong(dl_tensor.shape[i])) if dl_tensor.strides: - buf.strides = tuple( - int(dl_tensor.strides[i]) for i in range(dl_tensor.ndim)) + buf.strides = cpython.PyTuple_New(dl_tensor.ndim) + for i in range(dl_tensor.ndim): + cpython.PyTuple_SET_ITEM(buf.strides, i, cpython.PyLong_FromLong(dl_tensor.strides[i])) else: # C-order buf.strides = None + buf.dtype = dtype_dlpack_to_numpy(&dl_tensor.dtype) buf.device_id = device_id buf.is_device_accessible = is_device_accessible buf.readonly = is_readonly buf.exporting_obj = obj - cdef const char* used_name = ( - DLPACK_VERSIONED_TENSOR_USED_NAME if versioned else DLPACK_TENSOR_USED_NAME) cpython.PyCapsule_SetName(capsule, used_name) return buf From 8a05be3e9a0fa18afd161295b043250121cd6b2d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 15 Aug 2025 11:31:38 -0400 Subject: [PATCH 024/113] Add carray_int64_t_to_tuple function --- cuda_core/cuda/core/experimental/_memoryview.pyx | 9 +++------ .../cuda/core/experimental/_utils/cuda_utils.pxd | 12 ++++++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index b80d3b545..0b63faeda 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -12,6 +12,7 @@ from typing import Any, Optional import numpy from cuda.core.experimental._utils.cuda_utils import handle_return, driver +from cuda.core.experimental._utils cimport cuda_utils # TODO(leofang): support NumPy structured dtypes @@ -213,13 +214,9 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): buf.ptr = (dl_tensor.data) # Construct shape and strides tuples using the Python/C API for speed - buf.shape = cpython.PyTuple_New(dl_tensor.ndim) - for i in range(dl_tensor.ndim): - cpython.PyTuple_SET_ITEM(buf.shape, i, cpython.PyLong_FromLong(dl_tensor.shape[i])) + buf.shape = cuda_utils.carray_int64_t_to_tuple(dl_tensor.shape, dl_tensor.ndim) if dl_tensor.strides: - buf.strides = cpython.PyTuple_New(dl_tensor.ndim) - for i in range(dl_tensor.ndim): - cpython.PyTuple_SET_ITEM(buf.strides, i, cpython.PyLong_FromLong(dl_tensor.strides[i])) + buf.strides = cuda_utils.carray_int64_t_to_tuple(dl_tensor.strides, dl_tensor.ndim) else: # C-order buf.strides = None diff --git a/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd b/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd index b082fb8bb..987a13df6 100644 --- a/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd +++ b/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd @@ -2,7 +2,19 @@ # # SPDX-License-Identifier: Apache-2.0 + +cimport cpython +cimport libc.stdint + + cpdef int _check_driver_error(error) except?-1 cpdef int _check_runtime_error(error) except?-1 cpdef int _check_nvrtc_error(error) except?-1 cpdef check_or_create_options(type cls, options, str options_description=*, bint keep_none=*) + + +cdef inline tuple carray_int64_t_to_tuple(libc.stdint.int64_t *ptr, int length): + result = cpython.PyTuple_New(length) + for i in range(length): + cpython.PyTuple_SET_ITEM(result, i, cpython.PyLong_FromLongLong(ptr[i])) + return result From df71f240d06fe75992dc05bd883587d93d7ae740 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 15 Aug 2025 11:34:39 -0400 Subject: [PATCH 025/113] Move comment --- cuda_core/cuda/core/experimental/_memoryview.pyx | 1 - cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 0b63faeda..31482229c 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -213,7 +213,6 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): cdef StridedMemoryView buf = StridedMemoryView() if view is None else view buf.ptr = (dl_tensor.data) - # Construct shape and strides tuples using the Python/C API for speed buf.shape = cuda_utils.carray_int64_t_to_tuple(dl_tensor.shape, dl_tensor.ndim) if dl_tensor.strides: buf.strides = cuda_utils.carray_int64_t_to_tuple(dl_tensor.strides, dl_tensor.ndim) diff --git a/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd b/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd index 987a13df6..601736c47 100644 --- a/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd +++ b/cuda_core/cuda/core/experimental/_utils/cuda_utils.pxd @@ -14,6 +14,7 @@ cpdef check_or_create_options(type cls, options, str options_description=*, bint cdef inline tuple carray_int64_t_to_tuple(libc.stdint.int64_t *ptr, int length): + # Construct shape and strides tuples using the Python/C API for speed result = cpython.PyTuple_New(length) for i in range(length): cpython.PyTuple_SET_ITEM(result, i, cpython.PyLong_FromLongLong(ptr[i])) From db85867b63eec4212eff5e6c9b7a87709be2cfb8 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 18 Aug 2025 07:29:10 -0400 Subject: [PATCH 026/113] Make populating the internal symbol table thread-safe (#835) * protect cuPythonInit in driver * add lock for all modules * fixes * fix identation, make consistent * relocate setting __cuPythonInit to avoid deadlock since we use cuGetProcAddress in the init function... * move init check inside lock * make cuPythonInit reentrant + ensure GIL is released when calling underlying C APIs * fix indentation --------- Co-authored-by: Keith Kraus --- .../cuda/bindings/_bindings/cydriver.pyx.in | 16387 ++++++++-------- .../cuda/bindings/_bindings/cynvrtc.pyx.in | 218 +- .../cuda/bindings/_internal/cufile_linux.pyx | 641 +- .../bindings/_internal/nvjitlink_linux.pyx | 236 +- .../bindings/_internal/nvjitlink_windows.pyx | 11 +- .../cuda/bindings/_internal/nvvm_linux.pyx | 222 +- .../cuda/bindings/_internal/nvvm_windows.pyx | 11 +- 7 files changed, 8872 insertions(+), 8854 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index cd29890ba..7fc86b565 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -12,7 +12,9 @@ cimport cuda.bindings._lib.dlfcn as dlfcn from libc.stdint cimport intptr_t import os import sys +import threading cimport cuda.bindings._bindings.loader as loader +cdef object __symbol_lock = threading.RLock() cdef bint __cuPythonInit = False {{if 'cuGetErrorString' in found_functions}}cdef void *__cuGetErrorString = NULL{{endif}} {{if 'cuGetErrorName' in found_functions}}cdef void *__cuGetErrorName = NULL{{endif}} @@ -484,19 +486,23 @@ cdef bint __cuPythonInit = False {{if True}}cdef void *__cuGraphicsVDPAURegisterVideoSurface = NULL{{endif}} {{if True}}cdef void *__cuGraphicsVDPAURegisterOutputSurface = NULL{{endif}} +# To make cuPythonInit reentrant +ctypedef CUresult (*__cuGetProcAddress_v2_T)(const char*, void**, int, cuuint64_t, CUdriverProcAddressQueryResult*) except?CUDA_ERROR_NOT_FOUND nogil +cdef __cuGetProcAddress_v2_T _F_cuGetProcAddress_v2 = NULL + cdef int cuPythonInit() except -1 nogil: global __cuPythonInit - cdef bint usePTDS if __cuPythonInit: return 0 - __cuPythonInit = True - with gil: - usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0) - # Load library + cdef bint usePTDS cdef char libPath[260] - libPath[0] = 0 - with gil: + + with gil, __symbol_lock: + usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0) + + # Load library + libPath[0] = 0 status = loader.getCUDALibraryPath(libPath, sys.maxsize > 2**32) if status == 0 and len(libPath) != 0: path = libPath.decode('utf-8') @@ -506,7 +512,7 @@ cdef int cuPythonInit() except -1 nogil: {{else}} path = 'libcuda.so.1' {{endif}} - + {{if 'Windows' == platform.system()}} LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 try: @@ -518,8361 +524,8364 @@ cdef int cuPythonInit() except -1 nogil: if (handle == NULL): raise RuntimeError('Failed to dlopen ' + path) {{endif}} - - # Get latest __cuGetProcAddress_v2 - {{if 'Windows' == platform.system()}} - with gil: + + # Get latest __cuGetProcAddress_v2 + global __cuGetProcAddress_v2 + {{if 'Windows' == platform.system()}} try: - global __cuGetProcAddress_v2 __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') except: pass - {{else}} - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') - {{endif}} - - # Load using cuGetProcAddress if available - if __cuGetProcAddress_v2 != NULL: - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - cuGetProcAddress('cuMemcpy', &__cuMemcpy, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{else}} + __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') + {{endif}} + + # Load using cuGetProcAddress if available + if __cuGetProcAddress_v2 != NULL: + _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + global __cuGetErrorString + _F_cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - cuGetProcAddress('cuMemcpyPeer', &__cuMemcpyPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuGetErrorName' in found_functions}} + global __cuGetErrorName + _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - cuGetProcAddress('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuInit' in found_functions}} + global __cuInit + _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - cuGetProcAddress('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDriverGetVersion' in found_functions}} + global __cuDriverGetVersion + _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - cuGetProcAddress('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGet' in found_functions}} + global __cuDeviceGet + _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - cuGetProcAddress('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetCount' in found_functions}} + global __cuDeviceGetCount + _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - cuGetProcAddress('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetName' in found_functions}} + global __cuDeviceGetName + _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - cuGetProcAddress('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetUuid_v2' in found_functions}} + global __cuDeviceGetUuid_v2 + _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - cuGetProcAddress('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetLuid' in found_functions}} + global __cuDeviceGetLuid + _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - cuGetProcAddress('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceTotalMem_v2' in found_functions}} + global __cuDeviceTotalMem_v2 + _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - cuGetProcAddress('cuMemcpy2D', &__cuMemcpy2D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + global __cuDeviceGetTexture1DLinearMaxWidth + _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - cuGetProcAddress('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetAttribute' in found_functions}} + global __cuDeviceGetAttribute + _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - cuGetProcAddress('cuMemcpy3D', &__cuMemcpy3D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + global __cuDeviceGetHostAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - cuGetProcAddress('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + global __cuDeviceGetNvSciSyncAttributes + _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - cuGetProcAddress('cuMemcpyAsync', &__cuMemcpyAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceSetMemPool' in found_functions}} + global __cuDeviceSetMemPool + _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - cuGetProcAddress('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetMemPool' in found_functions}} + global __cuDeviceGetMemPool + _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - cuGetProcAddress('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + global __cuDeviceGetDefaultMemPool + _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - cuGetProcAddress('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + global __cuDeviceGetExecAffinitySupport + _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - cuGetProcAddress('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + global __cuFlushGPUDirectRDMAWrites + _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - cuGetProcAddress('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetProperties' in found_functions}} + global __cuDeviceGetProperties + _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - cuGetProcAddress('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceComputeCapability' in found_functions}} + global __cuDeviceComputeCapability + _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - cuGetProcAddress('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + global __cuDevicePrimaryCtxRetain + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - cuGetProcAddress('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + global __cuDevicePrimaryCtxRelease_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + global __cuDevicePrimaryCtxSetFlags_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + global __cuDevicePrimaryCtxGetState + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + global __cuDevicePrimaryCtxReset_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - cuGetProcAddress('cuMemsetD8', &__cuMemsetD8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxCreate_v4' in found_functions}} + global __cuCtxCreate_v4 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - cuGetProcAddress('cuMemsetD16', &__cuMemsetD16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxDestroy_v2' in found_functions}} + global __cuCtxDestroy_v2 + _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - cuGetProcAddress('cuMemsetD32', &__cuMemsetD32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxPushCurrent_v2' in found_functions}} + global __cuCtxPushCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - cuGetProcAddress('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxPopCurrent_v2' in found_functions}} + global __cuCtxPopCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - cuGetProcAddress('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetCurrent' in found_functions}} + global __cuCtxSetCurrent + _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - cuGetProcAddress('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetCurrent' in found_functions}} + global __cuCtxGetCurrent + _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - cuGetProcAddress('cuMemsetD8Async', &__cuMemsetD8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetDevice' in found_functions}} + global __cuCtxGetDevice + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - cuGetProcAddress('cuMemsetD16Async', &__cuMemsetD16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetDevice_v2' in found_functions}} + global __cuCtxGetDevice_v2 + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - cuGetProcAddress('cuMemsetD32Async', &__cuMemsetD32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetFlags' in found_functions}} + global __cuCtxGetFlags + _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - cuGetProcAddress('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetFlags' in found_functions}} + global __cuCtxSetFlags + _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - cuGetProcAddress('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetId' in found_functions}} + global __cuCtxGetId + _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - cuGetProcAddress('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSynchronize' in found_functions}} + global __cuCtxSynchronize + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - cuGetProcAddress('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSynchronize_v2' in found_functions}} + global __cuCtxSynchronize_v2 + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - cuGetProcAddress('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetLimit' in found_functions}} + global __cuCtxSetLimit + _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - cuGetProcAddress('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetLimit' in found_functions}} + global __cuCtxGetLimit + _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - cuGetProcAddress('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetCacheConfig' in found_functions}} + global __cuCtxGetCacheConfig + _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetCacheConfig' in found_functions}} + global __cuCtxSetCacheConfig + _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetApiVersion' in found_functions}} + global __cuCtxGetApiVersion + _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - cuGetProcAddress('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + global __cuCtxGetStreamPriorityRange + _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - cuGetProcAddress('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + global __cuCtxResetPersistingL2Cache + _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - cuGetProcAddress('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetExecAffinity' in found_functions}} + global __cuCtxGetExecAffinity + _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxRecordEvent' in found_functions}} + global __cuCtxRecordEvent + _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - cuGetProcAddress('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxWaitEvent' in found_functions}} + global __cuCtxWaitEvent + _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - cuGetProcAddress('cuStreamGetFlags', &__cuStreamGetFlags, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxAttach' in found_functions}} + global __cuCtxAttach + _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - cuGetProcAddress('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxDetach' in found_functions}} + global __cuCtxDetach + _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + global __cuCtxGetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + global __cuCtxSetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - cuGetProcAddress('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoad' in found_functions}} + global __cuModuleLoad + _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - cuGetProcAddress('cuStreamAddCallback', &__cuStreamAddCallback, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadData' in found_functions}} + global __cuModuleLoadData + _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - cuGetProcAddress('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadDataEx' in found_functions}} + global __cuModuleLoadDataEx + _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - cuGetProcAddress('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadFatBinary' in found_functions}} + global __cuModuleLoadFatBinary + _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - cuGetProcAddress('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleUnload' in found_functions}} + global __cuModuleUnload + _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetLoadingMode' in found_functions}} + global __cuModuleGetLoadingMode + _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetFunction' in found_functions}} + global __cuModuleGetFunction + _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetFunctionCount' in found_functions}} + global __cuModuleGetFunctionCount + _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - cuGetProcAddress('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleEnumerateFunctions' in found_functions}} + global __cuModuleEnumerateFunctions + _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - cuGetProcAddress('cuStreamQuery', &__cuStreamQuery, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetGlobal_v2' in found_functions}} + global __cuModuleGetGlobal_v2 + _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - cuGetProcAddress('cuStreamSynchronize', &__cuStreamSynchronize, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkCreate_v2' in found_functions}} + global __cuLinkCreate_v2 + _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - cuGetProcAddress('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkAddData_v2' in found_functions}} + global __cuLinkAddData_v2 + _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - cuGetProcAddress('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkAddFile_v2' in found_functions}} + global __cuLinkAddFile_v2 + _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - cuGetProcAddress('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkComplete' in found_functions}} + global __cuLinkComplete + _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - cuGetProcAddress('cuEventRecord', &__cuEventRecord, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkDestroy' in found_functions}} + global __cuLinkDestroy + _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - cuGetProcAddress('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetTexRef' in found_functions}} + global __cuModuleGetTexRef + _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - cuGetProcAddress('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetSurfRef' in found_functions}} + global __cuModuleGetSurfRef + _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - cuGetProcAddress('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryLoadData' in found_functions}} + global __cuLibraryLoadData + _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - cuGetProcAddress('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryLoadFromFile' in found_functions}} + global __cuLibraryLoadFromFile + _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - cuGetProcAddress('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryUnload' in found_functions}} + global __cuLibraryUnload + _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - cuGetProcAddress('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetKernel' in found_functions}} + global __cuLibraryGetKernel + _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - cuGetProcAddress('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetKernelCount' in found_functions}} + global __cuLibraryGetKernelCount + _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - cuGetProcAddress('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryEnumerateKernels' in found_functions}} + global __cuLibraryEnumerateKernels + _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - cuGetProcAddress('cuLaunchKernel', &__cuLaunchKernel, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetModule' in found_functions}} + global __cuLibraryGetModule + _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - cuGetProcAddress('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetFunction' in found_functions}} + global __cuKernelGetFunction + _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - cuGetProcAddress('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetLibrary' in found_functions}} + global __cuKernelGetLibrary + _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - cuGetProcAddress('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetGlobal' in found_functions}} + global __cuLibraryGetGlobal + _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - cuGetProcAddress('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetManaged' in found_functions}} + global __cuLibraryGetManaged + _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - cuGetProcAddress('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + global __cuLibraryGetUnifiedFunction + _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - cuGetProcAddress('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetAttribute' in found_functions}} + global __cuKernelGetAttribute + _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - cuGetProcAddress('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelSetAttribute' in found_functions}} + global __cuKernelSetAttribute + _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - cuGetProcAddress('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelSetCacheConfig' in found_functions}} + global __cuKernelSetCacheConfig + _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - cuGetProcAddress('cuMemcpy', &__cuMemcpy, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuKernelGetName' in found_functions}} + global __cuKernelGetName + _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - cuGetProcAddress('cuMemcpyPeer', &__cuMemcpyPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuKernelGetParamInfo' in found_functions}} + global __cuKernelGetParamInfo + _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - cuGetProcAddress('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetInfo_v2' in found_functions}} + global __cuMemGetInfo_v2 + _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - cuGetProcAddress('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAlloc_v2' in found_functions}} + global __cuMemAlloc_v2 + _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - cuGetProcAddress('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocPitch_v2' in found_functions}} + global __cuMemAllocPitch_v2 + _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - cuGetProcAddress('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemFree_v2' in found_functions}} + global __cuMemFree_v2 + _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - cuGetProcAddress('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAddressRange_v2' in found_functions}} + global __cuMemGetAddressRange_v2 + _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - cuGetProcAddress('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocHost_v2' in found_functions}} + global __cuMemAllocHost_v2 + _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - cuGetProcAddress('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemFreeHost' in found_functions}} + global __cuMemFreeHost + _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - cuGetProcAddress('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostAlloc' in found_functions}} + global __cuMemHostAlloc + _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - cuGetProcAddress('cuMemcpy2D', &__cuMemcpy2D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + global __cuMemHostGetDevicePointer_v2 + _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - cuGetProcAddress('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostGetFlags' in found_functions}} + global __cuMemHostGetFlags + _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - cuGetProcAddress('cuMemcpy3D', &__cuMemcpy3D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocManaged' in found_functions}} + global __cuMemAllocManaged + _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - cuGetProcAddress('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + global __cuDeviceRegisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - cuGetProcAddress('cuMemcpyAsync', &__cuMemcpyAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + global __cuDeviceUnregisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - cuGetProcAddress('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + global __cuDeviceGetByPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - cuGetProcAddress('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceGetPCIBusId' in found_functions}} + global __cuDeviceGetPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - cuGetProcAddress('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcGetEventHandle' in found_functions}} + global __cuIpcGetEventHandle + _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - cuGetProcAddress('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcOpenEventHandle' in found_functions}} + global __cuIpcOpenEventHandle + _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - cuGetProcAddress('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcGetMemHandle' in found_functions}} + global __cuIpcGetMemHandle + _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - cuGetProcAddress('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + global __cuIpcOpenMemHandle_v2 + _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - cuGetProcAddress('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcCloseMemHandle' in found_functions}} + global __cuIpcCloseMemHandle + _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - cuGetProcAddress('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostRegister_v2' in found_functions}} + global __cuMemHostRegister_v2 + _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostUnregister' in found_functions}} + global __cuMemHostUnregister + _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayCreate_v2' in found_functions}} + global __cuArrayCreate_v2 + _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + global __cuArrayGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - cuGetProcAddress('cuMemsetD8', &__cuMemsetD8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetSparseProperties' in found_functions}} + global __cuArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - cuGetProcAddress('cuMemsetD16', &__cuMemsetD16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + global __cuMipmappedArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - cuGetProcAddress('cuMemsetD32', &__cuMemsetD32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + global __cuArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - cuGetProcAddress('cuMemsetD2D8', &__cuMemsetD2D8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + global __cuMipmappedArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - cuGetProcAddress('cuMemsetD2D16', &__cuMemsetD2D16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetPlane' in found_functions}} + global __cuArrayGetPlane + _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - cuGetProcAddress('cuMemsetD2D32', &__cuMemsetD2D32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayDestroy' in found_functions}} + global __cuArrayDestroy + _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - cuGetProcAddress('cuMemsetD8Async', &__cuMemsetD8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArray3DCreate_v2' in found_functions}} + global __cuArray3DCreate_v2 + _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - cuGetProcAddress('cuMemsetD16Async', &__cuMemsetD16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + global __cuArray3DGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - cuGetProcAddress('cuMemsetD32Async', &__cuMemsetD32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayCreate' in found_functions}} + global __cuMipmappedArrayCreate + _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - cuGetProcAddress('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + global __cuMipmappedArrayGetLevel + _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - cuGetProcAddress('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayDestroy' in found_functions}} + global __cuMipmappedArrayDestroy + _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - cuGetProcAddress('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + global __cuMemGetHandleForAddressRange + _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - cuGetProcAddress('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAddressReserve' in found_functions}} + global __cuMemAddressReserve + _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - cuGetProcAddress('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAddressFree' in found_functions}} + global __cuMemAddressFree + _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - cuGetProcAddress('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemCreate' in found_functions}} + global __cuMemCreate + _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - cuGetProcAddress('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRelease' in found_functions}} + global __cuMemRelease + _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemMap' in found_functions}} + global __cuMemMap + _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemUnmap' in found_functions}} + global __cuMemUnmap + _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - cuGetProcAddress('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemSetAccess' in found_functions}} + global __cuMemSetAccess + _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - cuGetProcAddress('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAccess' in found_functions}} + global __cuMemGetAccess + _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - cuGetProcAddress('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemExportToShareableHandle' in found_functions}} + global __cuMemExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemImportFromShareableHandle' in found_functions}} + global __cuMemImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - cuGetProcAddress('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAllocationGranularity' in found_functions}} + global __cuMemGetAllocationGranularity + _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - cuGetProcAddress('cuStreamGetFlags', &__cuStreamGetFlags, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + global __cuMemGetAllocationPropertiesFromHandle + _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - cuGetProcAddress('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRetainAllocationHandle' in found_functions}} + global __cuMemRetainAllocationHandle + _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolTrimTo' in found_functions}} + global __cuMemPoolTrimTo + _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolSetAttribute' in found_functions}} + global __cuMemPoolSetAttribute + _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - cuGetProcAddress('cuStreamWaitEvent', &__cuStreamWaitEvent, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolGetAttribute' in found_functions}} + global __cuMemPoolGetAttribute + _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - cuGetProcAddress('cuStreamAddCallback', &__cuStreamAddCallback, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolSetAccess' in found_functions}} + global __cuMemPoolSetAccess + _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - cuGetProcAddress('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolGetAccess' in found_functions}} + global __cuMemPoolGetAccess + _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - cuGetProcAddress('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolCreate' in found_functions}} + global __cuMemPoolCreate + _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - cuGetProcAddress('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolDestroy' in found_functions}} + global __cuMemPoolDestroy + _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetDefaultMemPool' in found_functions}} + global __cuMemGetDefaultMemPool + _F_cuGetProcAddress_v2('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetMemPool' in found_functions}} + global __cuMemGetMemPool + _F_cuGetProcAddress_v2('cuMemGetMemPool', &__cuMemGetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemSetMemPool' in found_functions}} + global __cuMemSetMemPool + _F_cuGetProcAddress_v2('cuMemSetMemPool', &__cuMemSetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - cuGetProcAddress('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + global __cuMemPoolExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - cuGetProcAddress('cuStreamQuery', &__cuStreamQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + global __cuMemPoolImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - cuGetProcAddress('cuStreamSynchronize', &__cuStreamSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolExportPointer' in found_functions}} + global __cuMemPoolExportPointer + _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - cuGetProcAddress('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolImportPointer' in found_functions}} + global __cuMemPoolImportPointer + _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - cuGetProcAddress('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastCreate' in found_functions}} + global __cuMulticastCreate + _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - cuGetProcAddress('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastAddDevice' in found_functions}} + global __cuMulticastAddDevice + _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - cuGetProcAddress('cuEventRecord', &__cuEventRecord, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastBindMem' in found_functions}} + global __cuMulticastBindMem + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - cuGetProcAddress('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastBindAddr' in found_functions}} + global __cuMulticastBindAddr + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - cuGetProcAddress('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastUnbind' in found_functions}} + global __cuMulticastUnbind + _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - cuGetProcAddress('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastGetGranularity' in found_functions}} + global __cuMulticastGetGranularity + _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - cuGetProcAddress('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerGetAttribute' in found_functions}} + global __cuPointerGetAttribute + _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - cuGetProcAddress('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAdvise_v2' in found_functions}} + global __cuMemAdvise_v2 + _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - cuGetProcAddress('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRangeGetAttribute' in found_functions}} + global __cuMemRangeGetAttribute + _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - cuGetProcAddress('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRangeGetAttributes' in found_functions}} + global __cuMemRangeGetAttributes + _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - cuGetProcAddress('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerSetAttribute' in found_functions}} + global __cuPointerSetAttribute + _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - cuGetProcAddress('cuLaunchKernel', &__cuLaunchKernel, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerGetAttributes' in found_functions}} + global __cuPointerGetAttributes + _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - cuGetProcAddress('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamCreate' in found_functions}} + global __cuStreamCreate + _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - cuGetProcAddress('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamCreateWithPriority' in found_functions}} + global __cuStreamCreateWithPriority + _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - cuGetProcAddress('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + global __cuThreadExchangeStreamCaptureMode + _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - cuGetProcAddress('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamDestroy_v2' in found_functions}} + global __cuStreamDestroy_v2 + _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - cuGetProcAddress('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventCreate' in found_functions}} + global __cuEventCreate + _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - cuGetProcAddress('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventQuery' in found_functions}} + global __cuEventQuery + _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - cuGetProcAddress('cuGraphicsMapResources', &__cuGraphicsMapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventSynchronize' in found_functions}} + global __cuEventSynchronize + _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - cuGetProcAddress('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventDestroy_v2' in found_functions}} + global __cuEventDestroy_v2 + _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - cuGetProcAddress('cuGetErrorString', &__cuGetErrorString, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - cuGetProcAddress('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - cuGetProcAddress('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - cuGetProcAddress('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - cuGetProcAddress('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - cuGetProcAddress('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - cuGetProcAddress('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - cuGetProcAddress('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - cuGetProcAddress('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - cuGetProcAddress('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - cuGetProcAddress('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - cuGetProcAddress('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - global __cuDeviceGetHostAtomicCapabilities - cuGetProcAddress('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - cuGetProcAddress('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - cuGetProcAddress('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - cuGetProcAddress('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - cuGetProcAddress('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - cuGetProcAddress('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - cuGetProcAddress('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - cuGetProcAddress('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - cuGetProcAddress('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - cuGetProcAddress('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - cuGetProcAddress('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - cuGetProcAddress('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - cuGetProcAddress('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - cuGetProcAddress('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - cuGetProcAddress('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - cuGetProcAddress('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - cuGetProcAddress('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - cuGetProcAddress('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - cuGetProcAddress('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - cuGetProcAddress('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevice_v2' in found_functions}} - global __cuCtxGetDevice_v2 - cuGetProcAddress('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - cuGetProcAddress('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - cuGetProcAddress('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - cuGetProcAddress('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - cuGetProcAddress('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSynchronize_v2' in found_functions}} - global __cuCtxSynchronize_v2 - cuGetProcAddress('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - cuGetProcAddress('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - cuGetProcAddress('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - cuGetProcAddress('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - cuGetProcAddress('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - cuGetProcAddress('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - cuGetProcAddress('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - cuGetProcAddress('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - cuGetProcAddress('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - cuGetProcAddress('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - cuGetProcAddress('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - cuGetProcAddress('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - cuGetProcAddress('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - cuGetProcAddress('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - cuGetProcAddress('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - cuGetProcAddress('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - cuGetProcAddress('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - cuGetProcAddress('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - cuGetProcAddress('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - cuGetProcAddress('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - cuGetProcAddress('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - cuGetProcAddress('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - cuGetProcAddress('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - cuGetProcAddress('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - cuGetProcAddress('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - cuGetProcAddress('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - cuGetProcAddress('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - cuGetProcAddress('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - cuGetProcAddress('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - cuGetProcAddress('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - cuGetProcAddress('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - cuGetProcAddress('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - cuGetProcAddress('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - cuGetProcAddress('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - cuGetProcAddress('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - cuGetProcAddress('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - cuGetProcAddress('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - cuGetProcAddress('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - cuGetProcAddress('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - cuGetProcAddress('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - cuGetProcAddress('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - cuGetProcAddress('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - cuGetProcAddress('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - cuGetProcAddress('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - cuGetProcAddress('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - cuGetProcAddress('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - cuGetProcAddress('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - cuGetProcAddress('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - cuGetProcAddress('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - cuGetProcAddress('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - cuGetProcAddress('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - cuGetProcAddress('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - cuGetProcAddress('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - cuGetProcAddress('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - cuGetProcAddress('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - cuGetProcAddress('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - cuGetProcAddress('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - cuGetProcAddress('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - cuGetProcAddress('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - cuGetProcAddress('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - cuGetProcAddress('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - cuGetProcAddress('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - cuGetProcAddress('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - cuGetProcAddress('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - cuGetProcAddress('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - cuGetProcAddress('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - cuGetProcAddress('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - cuGetProcAddress('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - cuGetProcAddress('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - cuGetProcAddress('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - cuGetProcAddress('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - cuGetProcAddress('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - cuGetProcAddress('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - cuGetProcAddress('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - cuGetProcAddress('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - cuGetProcAddress('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - cuGetProcAddress('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - cuGetProcAddress('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - cuGetProcAddress('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - cuGetProcAddress('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - cuGetProcAddress('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - cuGetProcAddress('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - cuGetProcAddress('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - cuGetProcAddress('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - cuGetProcAddress('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - cuGetProcAddress('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - cuGetProcAddress('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - cuGetProcAddress('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - cuGetProcAddress('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - cuGetProcAddress('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - cuGetProcAddress('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - cuGetProcAddress('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - cuGetProcAddress('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - cuGetProcAddress('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - cuGetProcAddress('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - cuGetProcAddress('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - cuGetProcAddress('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - cuGetProcAddress('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - cuGetProcAddress('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - cuGetProcAddress('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - cuGetProcAddress('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - cuGetProcAddress('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - cuGetProcAddress('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - cuGetProcAddress('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - cuGetProcAddress('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetDefaultMemPool' in found_functions}} - global __cuMemGetDefaultMemPool - cuGetProcAddress('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetMemPool' in found_functions}} - global __cuMemGetMemPool - cuGetProcAddress('cuMemGetMemPool', &__cuMemGetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemSetMemPool' in found_functions}} - global __cuMemSetMemPool - cuGetProcAddress('cuMemSetMemPool', &__cuMemSetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - cuGetProcAddress('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - cuGetProcAddress('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - cuGetProcAddress('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - cuGetProcAddress('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - cuGetProcAddress('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - cuGetProcAddress('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - cuGetProcAddress('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - cuGetProcAddress('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - cuGetProcAddress('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - cuGetProcAddress('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - cuGetProcAddress('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - cuGetProcAddress('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - cuGetProcAddress('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - cuGetProcAddress('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - cuGetProcAddress('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - cuGetProcAddress('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - cuGetProcAddress('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - cuGetProcAddress('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - cuGetProcAddress('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - cuGetProcAddress('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - cuGetProcAddress('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - cuGetProcAddress('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - cuGetProcAddress('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - cuGetProcAddress('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - cuGetProcAddress('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - cuGetProcAddress('cuImportExternalMemory', &__cuImportExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - cuGetProcAddress('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - cuGetProcAddress('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - cuGetProcAddress('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - cuGetProcAddress('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - cuGetProcAddress('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - cuGetProcAddress('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - cuGetProcAddress('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - cuGetProcAddress('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - cuGetProcAddress('cuFuncGetModule', &__cuFuncGetModule, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - cuGetProcAddress('cuFuncGetName', &__cuFuncGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - cuGetProcAddress('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - cuGetProcAddress('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - cuGetProcAddress('cuFuncLoad', &__cuFuncLoad, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - cuGetProcAddress('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - cuGetProcAddress('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - cuGetProcAddress('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - cuGetProcAddress('cuParamSetSize', &__cuParamSetSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - cuGetProcAddress('cuParamSeti', &__cuParamSeti, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - cuGetProcAddress('cuParamSetf', &__cuParamSetf, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - cuGetProcAddress('cuParamSetv', &__cuParamSetv, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - cuGetProcAddress('cuLaunch', &__cuLaunch, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - cuGetProcAddress('cuLaunchGrid', &__cuLaunchGrid, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - cuGetProcAddress('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - cuGetProcAddress('cuParamSetTexRef', &__cuParamSetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - cuGetProcAddress('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - cuGetProcAddress('cuGraphCreate', &__cuGraphCreate, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - cuGetProcAddress('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - cuGetProcAddress('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - cuGetProcAddress('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - cuGetProcAddress('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - cuGetProcAddress('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - cuGetProcAddress('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - cuGetProcAddress('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - cuGetProcAddress('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - cuGetProcAddress('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - cuGetProcAddress('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - cuGetProcAddress('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - cuGetProcAddress('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - cuGetProcAddress('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - cuGetProcAddress('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - cuGetProcAddress('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - cuGetProcAddress('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - cuGetProcAddress('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - cuGetProcAddress('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - cuGetProcAddress('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - cuGetProcAddress('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - cuGetProcAddress('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - cuGetProcAddress('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - cuGetProcAddress('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - cuGetProcAddress('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - cuGetProcAddress('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - cuGetProcAddress('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - cuGetProcAddress('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - cuGetProcAddress('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - cuGetProcAddress('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - cuGetProcAddress('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - cuGetProcAddress('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - cuGetProcAddress('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - cuGetProcAddress('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - cuGetProcAddress('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - cuGetProcAddress('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - cuGetProcAddress('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - cuGetProcAddress('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - cuGetProcAddress('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - cuGetProcAddress('cuGraphClone', &__cuGraphClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - cuGetProcAddress('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - cuGetProcAddress('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - cuGetProcAddress('cuGraphGetNodes', &__cuGraphGetNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - cuGetProcAddress('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - cuGetProcAddress('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - cuGetProcAddress('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - cuGetProcAddress('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - cuGetProcAddress('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - cuGetProcAddress('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - cuGetProcAddress('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - cuGetProcAddress('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - cuGetProcAddress('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - cuGetProcAddress('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - cuGetProcAddress('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - cuGetProcAddress('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - cuGetProcAddress('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - cuGetProcAddress('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - cuGetProcAddress('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - cuGetProcAddress('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - cuGetProcAddress('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - cuGetProcAddress('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - cuGetProcAddress('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - cuGetProcAddress('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - cuGetProcAddress('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - cuGetProcAddress('cuGraphDestroy', &__cuGraphDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - cuGetProcAddress('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - cuGetProcAddress('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - cuGetProcAddress('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - cuGetProcAddress('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - cuGetProcAddress('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - cuGetProcAddress('cuUserObjectCreate', &__cuUserObjectCreate, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - cuGetProcAddress('cuUserObjectRetain', &__cuUserObjectRetain, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - cuGetProcAddress('cuUserObjectRelease', &__cuUserObjectRelease, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - cuGetProcAddress('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - cuGetProcAddress('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - cuGetProcAddress('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - cuGetProcAddress('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - cuGetProcAddress('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - cuGetProcAddress('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - cuGetProcAddress('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - cuGetProcAddress('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - cuGetProcAddress('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - cuGetProcAddress('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - cuGetProcAddress('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - cuGetProcAddress('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - cuGetProcAddress('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - cuGetProcAddress('cuTexRefSetArray', &__cuTexRefSetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - cuGetProcAddress('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - cuGetProcAddress('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - cuGetProcAddress('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - cuGetProcAddress('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - cuGetProcAddress('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - cuGetProcAddress('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - cuGetProcAddress('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - cuGetProcAddress('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - cuGetProcAddress('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - cuGetProcAddress('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - cuGetProcAddress('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - cuGetProcAddress('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - cuGetProcAddress('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - cuGetProcAddress('cuTexRefGetArray', &__cuTexRefGetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - cuGetProcAddress('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - cuGetProcAddress('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - cuGetProcAddress('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - cuGetProcAddress('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - cuGetProcAddress('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - cuGetProcAddress('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - cuGetProcAddress('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - cuGetProcAddress('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - cuGetProcAddress('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - cuGetProcAddress('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - cuGetProcAddress('cuTexRefCreate', &__cuTexRefCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - cuGetProcAddress('cuTexRefDestroy', &__cuTexRefDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - cuGetProcAddress('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - cuGetProcAddress('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - cuGetProcAddress('cuTexObjectCreate', &__cuTexObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - cuGetProcAddress('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - cuGetProcAddress('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - cuGetProcAddress('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - cuGetProcAddress('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - cuGetProcAddress('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - cuGetProcAddress('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - cuGetProcAddress('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - cuGetProcAddress('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - cuGetProcAddress('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - cuGetProcAddress('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - cuGetProcAddress('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - cuGetProcAddress('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - cuGetProcAddress('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - cuGetProcAddress('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - cuGetProcAddress('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - global __cuDeviceGetP2PAtomicCapabilities - cuGetProcAddress('cuDeviceGetP2PAtomicCapabilities', &__cuDeviceGetP2PAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - global __cuGraphicsUnregisterResource - cuGetProcAddress('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - cuGetProcAddress('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - cuGetProcAddress('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - cuGetProcAddress('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - cuGetProcAddress('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - cuGetProcAddress('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - cuGetProcAddress('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - cuGetProcAddress('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - cuGetProcAddress('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - cuGetProcAddress('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - cuGetProcAddress('cuGetExportTable', &__cuGetExportTable, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - cuGetProcAddress('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - cuGetProcAddress('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - cuGetProcAddress('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - cuGetProcAddress('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - cuGetProcAddress('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - cuGetProcAddress('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - cuGetProcAddress('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - cuGetProcAddress('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - cuGetProcAddress('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - cuGetProcAddress('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - cuGetProcAddress('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - cuGetProcAddress('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxGetId' in found_functions}} - global __cuGreenCtxGetId - cuGetProcAddress('cuGreenCtxGetId', &__cuGreenCtxGetId, 12090, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - cuGetProcAddress('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - cuGetProcAddress('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - cuGetProcAddress('cuLogsCurrent', &__cuLogsCurrent, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - cuGetProcAddress('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - cuGetProcAddress('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - cuGetProcAddress('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - cuGetProcAddress('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - cuGetProcAddress('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - global __cuCheckpointProcessCheckpoint - cuGetProcAddress('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - global __cuCheckpointProcessUnlock - cuGetProcAddress('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - cuGetProcAddress('cuProfilerStart', &__cuProfilerStart, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - cuGetProcAddress('cuProfilerStop', &__cuProfilerStop, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsEGLRegisterImage - cuGetProcAddress('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnect - cuGetProcAddress('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - cuGetProcAddress('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerDisconnect - cuGetProcAddress('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - cuGetProcAddress('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - cuGetProcAddress('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerConnect - cuGetProcAddress('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerDisconnect - cuGetProcAddress('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerPresentFrame - cuGetProcAddress('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerReturnFrame - cuGetProcAddress('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - cuGetProcAddress('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEventCreateFromEGLSync - cuGetProcAddress('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterBuffer - cuGetProcAddress('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterImage - cuGetProcAddress('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGLGetDevices_v2 - cuGetProcAddress('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuVDPAUGetDevice - cuGetProcAddress('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuVDPAUCtxCreate_v2 - cuGetProcAddress('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - cuGetProcAddress('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - cuGetProcAddress('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - return 0 - - {{if 'Windows' == platform.system()}} - # Load using win32GetAddr - with gil: - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - try: - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - try: - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - try: - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - try: - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - try: - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') - except: - pass - {{endif}} - {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord_ptsz') - except: - pass - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') - except: - pass - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') - except: - pass - {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy') - except: - pass - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer') - except: - pass - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - try: - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - try: - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async') - except: - pass - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async') - except: - pass - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async') - except: - pass - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync') - except: - pass - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync') - except: - pass - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync') - except: - pass - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync') - except: - pass - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - try: - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') - except: - pass - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - try: - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync') - except: - pass - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - try: - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') - except: - pass - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority') - except: - pass - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice') - except: - pass - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags') - except: - pass - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2') - except: - pass - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent') - except: - pass - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback') - except: - pass - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2') - except: - pass - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') - except: - pass - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture') - except: - pass - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') - except: - pass - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync') - except: - pass - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery') - except: - pass - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize') - except: - pass - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes') - except: - pass - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute') - except: - pass - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute') - except: - pass - {{endif}} - {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord') - except: - pass - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags') - except: - pass - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') - except: - pass - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2') - except: - pass - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') - except: - pass - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel') - except: - pass - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel') - except: - pass - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams') - except: - pass - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload') - except: - pass - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch') - except: - pass - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources') - except: - pass - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources') - except: - pass - {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - try: - global __cuGetErrorString - __cuGetErrorString = win32api.GetProcAddress(handle, 'cuGetErrorString') - except: - pass - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - try: - global __cuGetErrorName - __cuGetErrorName = win32api.GetProcAddress(handle, 'cuGetErrorName') - except: - pass - {{endif}} - {{if 'cuInit' in found_functions}} - try: - global __cuInit - __cuInit = win32api.GetProcAddress(handle, 'cuInit') - except: - pass - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - try: - global __cuDriverGetVersion - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - except: - pass - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - try: - global __cuDeviceGet - __cuDeviceGet = win32api.GetProcAddress(handle, 'cuDeviceGet') - except: - pass - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - try: - global __cuDeviceGetCount - __cuDeviceGetCount = win32api.GetProcAddress(handle, 'cuDeviceGetCount') - except: - pass - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - try: - global __cuDeviceGetName - __cuDeviceGetName = win32api.GetProcAddress(handle, 'cuDeviceGetName') - except: - pass - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - try: - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = win32api.GetProcAddress(handle, 'cuDeviceGetUuid_v2') - except: - pass - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - try: - global __cuDeviceGetLuid - __cuDeviceGetLuid = win32api.GetProcAddress(handle, 'cuDeviceGetLuid') - except: - pass - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - try: - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = win32api.GetProcAddress(handle, 'cuDeviceTotalMem_v2') - except: - pass - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - try: - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = win32api.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - except: - pass - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - try: - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetAttribute') - except: - pass - {{endif}} - {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - try: - global __cuDeviceGetHostAtomicCapabilities - __cuDeviceGetHostAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') - except: - pass - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - try: - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = win32api.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') - except: - pass - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - try: - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = win32api.GetProcAddress(handle, 'cuDeviceSetMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - try: - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - try: - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - try: - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = win32api.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') - except: - pass - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - try: - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = win32api.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') - except: - pass - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - try: - global __cuDeviceGetProperties - __cuDeviceGetProperties = win32api.GetProcAddress(handle, 'cuDeviceGetProperties') - except: - pass - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - try: - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = win32api.GetProcAddress(handle, 'cuDeviceComputeCapability') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - try: - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - try: - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') - except: - pass - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - try: - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = win32api.GetProcAddress(handle, 'cuCtxCreate_v4') - except: - pass - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - try: - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = win32api.GetProcAddress(handle, 'cuCtxDestroy_v2') - except: - pass - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - try: - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPushCurrent_v2') - except: - pass - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - try: - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPopCurrent_v2') - except: - pass - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - try: - global __cuCtxSetCurrent - __cuCtxSetCurrent = win32api.GetProcAddress(handle, 'cuCtxSetCurrent') - except: - pass - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - try: - global __cuCtxGetCurrent - __cuCtxGetCurrent = win32api.GetProcAddress(handle, 'cuCtxGetCurrent') - except: - pass - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - try: - global __cuCtxGetDevice - __cuCtxGetDevice = win32api.GetProcAddress(handle, 'cuCtxGetDevice') - except: - pass - {{endif}} - {{if 'cuCtxGetDevice_v2' in found_functions}} - try: - global __cuCtxGetDevice_v2 - __cuCtxGetDevice_v2 = win32api.GetProcAddress(handle, 'cuCtxGetDevice_v2') - except: - pass - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - try: - global __cuCtxGetFlags - __cuCtxGetFlags = win32api.GetProcAddress(handle, 'cuCtxGetFlags') - except: - pass - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - try: - global __cuCtxSetFlags - __cuCtxSetFlags = win32api.GetProcAddress(handle, 'cuCtxSetFlags') - except: - pass - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - try: - global __cuCtxGetId - __cuCtxGetId = win32api.GetProcAddress(handle, 'cuCtxGetId') - except: - pass - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - try: - global __cuCtxSynchronize - __cuCtxSynchronize = win32api.GetProcAddress(handle, 'cuCtxSynchronize') - except: - pass - {{endif}} - {{if 'cuCtxSynchronize_v2' in found_functions}} - try: - global __cuCtxSynchronize_v2 - __cuCtxSynchronize_v2 = win32api.GetProcAddress(handle, 'cuCtxSynchronize_v2') - except: - pass - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - try: - global __cuCtxSetLimit - __cuCtxSetLimit = win32api.GetProcAddress(handle, 'cuCtxSetLimit') - except: - pass - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - try: - global __cuCtxGetLimit - __cuCtxGetLimit = win32api.GetProcAddress(handle, 'cuCtxGetLimit') - except: - pass - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - try: - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxGetCacheConfig') - except: - pass - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - try: - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - try: - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = win32api.GetProcAddress(handle, 'cuCtxGetApiVersion') - except: - pass - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - try: - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = win32api.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') - except: - pass - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - try: - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = win32api.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') - except: - pass - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - try: - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = win32api.GetProcAddress(handle, 'cuCtxGetExecAffinity') - except: - pass - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - try: - global __cuCtxRecordEvent - __cuCtxRecordEvent = win32api.GetProcAddress(handle, 'cuCtxRecordEvent') - except: - pass - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - try: - global __cuCtxWaitEvent - __cuCtxWaitEvent = win32api.GetProcAddress(handle, 'cuCtxWaitEvent') - except: - pass - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - try: - global __cuCtxAttach - __cuCtxAttach = win32api.GetProcAddress(handle, 'cuCtxAttach') - except: - pass - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - try: - global __cuCtxDetach - __cuCtxDetach = win32api.GetProcAddress(handle, 'cuCtxDetach') - except: - pass - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - try: - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - try: - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - try: - global __cuModuleLoad - __cuModuleLoad = win32api.GetProcAddress(handle, 'cuModuleLoad') - except: - pass - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - try: - global __cuModuleLoadData - __cuModuleLoadData = win32api.GetProcAddress(handle, 'cuModuleLoadData') - except: - pass - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - try: - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = win32api.GetProcAddress(handle, 'cuModuleLoadDataEx') - except: - pass - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - try: - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = win32api.GetProcAddress(handle, 'cuModuleLoadFatBinary') - except: - pass - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - try: - global __cuModuleUnload - __cuModuleUnload = win32api.GetProcAddress(handle, 'cuModuleUnload') - except: - pass - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - try: - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = win32api.GetProcAddress(handle, 'cuModuleGetLoadingMode') - except: - pass - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - try: - global __cuModuleGetFunction - __cuModuleGetFunction = win32api.GetProcAddress(handle, 'cuModuleGetFunction') - except: - pass - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - try: - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = win32api.GetProcAddress(handle, 'cuModuleGetFunctionCount') - except: - pass - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - try: - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = win32api.GetProcAddress(handle, 'cuModuleEnumerateFunctions') - except: - pass - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - try: - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = win32api.GetProcAddress(handle, 'cuModuleGetGlobal_v2') - except: - pass - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - try: - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = win32api.GetProcAddress(handle, 'cuLinkCreate_v2') - except: - pass - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - try: - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = win32api.GetProcAddress(handle, 'cuLinkAddData_v2') - except: - pass - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - try: - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = win32api.GetProcAddress(handle, 'cuLinkAddFile_v2') - except: - pass - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - try: - global __cuLinkComplete - __cuLinkComplete = win32api.GetProcAddress(handle, 'cuLinkComplete') - except: - pass - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - try: - global __cuLinkDestroy - __cuLinkDestroy = win32api.GetProcAddress(handle, 'cuLinkDestroy') - except: - pass - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - try: - global __cuModuleGetTexRef - __cuModuleGetTexRef = win32api.GetProcAddress(handle, 'cuModuleGetTexRef') - except: - pass - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - try: - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = win32api.GetProcAddress(handle, 'cuModuleGetSurfRef') - except: - pass - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - try: - global __cuLibraryLoadData - __cuLibraryLoadData = win32api.GetProcAddress(handle, 'cuLibraryLoadData') - except: - pass - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - try: - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = win32api.GetProcAddress(handle, 'cuLibraryLoadFromFile') - except: - pass - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - try: - global __cuLibraryUnload - __cuLibraryUnload = win32api.GetProcAddress(handle, 'cuLibraryUnload') - except: - pass - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - try: - global __cuLibraryGetKernel - __cuLibraryGetKernel = win32api.GetProcAddress(handle, 'cuLibraryGetKernel') - except: - pass - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - try: - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = win32api.GetProcAddress(handle, 'cuLibraryGetKernelCount') - except: - pass - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - try: - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = win32api.GetProcAddress(handle, 'cuLibraryEnumerateKernels') - except: - pass - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - try: - global __cuLibraryGetModule - __cuLibraryGetModule = win32api.GetProcAddress(handle, 'cuLibraryGetModule') - except: - pass - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - try: - global __cuKernelGetFunction - __cuKernelGetFunction = win32api.GetProcAddress(handle, 'cuKernelGetFunction') - except: - pass - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - try: - global __cuKernelGetLibrary - __cuKernelGetLibrary = win32api.GetProcAddress(handle, 'cuKernelGetLibrary') - except: - pass - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - try: - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = win32api.GetProcAddress(handle, 'cuLibraryGetGlobal') - except: - pass - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - try: - global __cuLibraryGetManaged - __cuLibraryGetManaged = win32api.GetProcAddress(handle, 'cuLibraryGetManaged') - except: - pass - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - try: - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = win32api.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') - except: - pass - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - try: - global __cuKernelGetAttribute - __cuKernelGetAttribute = win32api.GetProcAddress(handle, 'cuKernelGetAttribute') - except: - pass - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - try: - global __cuKernelSetAttribute - __cuKernelSetAttribute = win32api.GetProcAddress(handle, 'cuKernelSetAttribute') - except: - pass - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - try: - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = win32api.GetProcAddress(handle, 'cuKernelSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - try: - global __cuKernelGetName - __cuKernelGetName = win32api.GetProcAddress(handle, 'cuKernelGetName') - except: - pass - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - try: - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = win32api.GetProcAddress(handle, 'cuKernelGetParamInfo') - except: - pass - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - try: - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = win32api.GetProcAddress(handle, 'cuMemGetInfo_v2') - except: - pass - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - try: - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = win32api.GetProcAddress(handle, 'cuMemAlloc_v2') - except: - pass - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - try: - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = win32api.GetProcAddress(handle, 'cuMemAllocPitch_v2') - except: - pass - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - try: - global __cuMemFree_v2 - __cuMemFree_v2 = win32api.GetProcAddress(handle, 'cuMemFree_v2') - except: - pass - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - try: - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = win32api.GetProcAddress(handle, 'cuMemGetAddressRange_v2') - except: - pass - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - try: - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = win32api.GetProcAddress(handle, 'cuMemAllocHost_v2') - except: - pass - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - try: - global __cuMemFreeHost - __cuMemFreeHost = win32api.GetProcAddress(handle, 'cuMemFreeHost') - except: - pass - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - try: - global __cuMemHostAlloc - __cuMemHostAlloc = win32api.GetProcAddress(handle, 'cuMemHostAlloc') - except: - pass - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - try: - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = win32api.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') - except: - pass - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - try: - global __cuMemHostGetFlags - __cuMemHostGetFlags = win32api.GetProcAddress(handle, 'cuMemHostGetFlags') - except: - pass - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - try: - global __cuMemAllocManaged - __cuMemAllocManaged = win32api.GetProcAddress(handle, 'cuMemAllocManaged') - except: - pass - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - try: - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') - except: - pass - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - try: - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') - except: - pass - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - try: - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') - except: - pass - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - try: - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetPCIBusId') - except: - pass - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - try: - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = win32api.GetProcAddress(handle, 'cuIpcGetEventHandle') - except: - pass - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - try: - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = win32api.GetProcAddress(handle, 'cuIpcOpenEventHandle') - except: - pass - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - try: - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = win32api.GetProcAddress(handle, 'cuIpcGetMemHandle') - except: - pass - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - try: - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = win32api.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') - except: - pass - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - try: - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = win32api.GetProcAddress(handle, 'cuIpcCloseMemHandle') - except: - pass - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - try: - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = win32api.GetProcAddress(handle, 'cuMemHostRegister_v2') - except: - pass - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - try: - global __cuMemHostUnregister - __cuMemHostUnregister = win32api.GetProcAddress(handle, 'cuMemHostUnregister') - except: - pass - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - try: - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = win32api.GetProcAddress(handle, 'cuArrayCreate_v2') - except: - pass - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - try: - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') - except: - pass - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - try: - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuArrayGetSparseProperties') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - try: - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') - except: - pass - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - try: - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - try: - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') - except: - pass - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - try: - global __cuArrayGetPlane - __cuArrayGetPlane = win32api.GetProcAddress(handle, 'cuArrayGetPlane') - except: - pass - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - try: - global __cuArrayDestroy - __cuArrayDestroy = win32api.GetProcAddress(handle, 'cuArrayDestroy') - except: - pass - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - try: - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = win32api.GetProcAddress(handle, 'cuArray3DCreate_v2') - except: - pass - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - try: - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - try: - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = win32api.GetProcAddress(handle, 'cuMipmappedArrayCreate') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - try: - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - try: - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = win32api.GetProcAddress(handle, 'cuMipmappedArrayDestroy') - except: - pass - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - try: - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = win32api.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') - except: - pass - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - try: - global __cuMemAddressReserve - __cuMemAddressReserve = win32api.GetProcAddress(handle, 'cuMemAddressReserve') - except: - pass - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - try: - global __cuMemAddressFree - __cuMemAddressFree = win32api.GetProcAddress(handle, 'cuMemAddressFree') - except: - pass - {{endif}} - {{if 'cuMemCreate' in found_functions}} - try: - global __cuMemCreate - __cuMemCreate = win32api.GetProcAddress(handle, 'cuMemCreate') - except: - pass - {{endif}} - {{if 'cuMemRelease' in found_functions}} - try: - global __cuMemRelease - __cuMemRelease = win32api.GetProcAddress(handle, 'cuMemRelease') - except: - pass - {{endif}} - {{if 'cuMemMap' in found_functions}} - try: - global __cuMemMap - __cuMemMap = win32api.GetProcAddress(handle, 'cuMemMap') - except: - pass - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - try: - global __cuMemUnmap - __cuMemUnmap = win32api.GetProcAddress(handle, 'cuMemUnmap') - except: - pass - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - try: - global __cuMemSetAccess - __cuMemSetAccess = win32api.GetProcAddress(handle, 'cuMemSetAccess') - except: - pass - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - try: - global __cuMemGetAccess - __cuMemGetAccess = win32api.GetProcAddress(handle, 'cuMemGetAccess') - except: - pass - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - try: - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemExportToShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - try: - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemImportFromShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - try: - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = win32api.GetProcAddress(handle, 'cuMemGetAllocationGranularity') - except: - pass - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - try: - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = win32api.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') - except: - pass - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - try: - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = win32api.GetProcAddress(handle, 'cuMemRetainAllocationHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - try: - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = win32api.GetProcAddress(handle, 'cuMemPoolTrimTo') - except: - pass - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - try: - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolSetAttribute') - except: - pass - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - try: - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - try: - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = win32api.GetProcAddress(handle, 'cuMemPoolSetAccess') - except: - pass - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - try: - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = win32api.GetProcAddress(handle, 'cuMemPoolGetAccess') - except: - pass - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - try: - global __cuMemPoolCreate - __cuMemPoolCreate = win32api.GetProcAddress(handle, 'cuMemPoolCreate') - except: - pass - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - try: - global __cuMemPoolDestroy - __cuMemPoolDestroy = win32api.GetProcAddress(handle, 'cuMemPoolDestroy') - except: - pass - {{endif}} - {{if 'cuMemGetDefaultMemPool' in found_functions}} - try: - global __cuMemGetDefaultMemPool - __cuMemGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuMemGetDefaultMemPool') - except: - pass - {{endif}} - {{if 'cuMemGetMemPool' in found_functions}} - try: - global __cuMemGetMemPool - __cuMemGetMemPool = win32api.GetProcAddress(handle, 'cuMemGetMemPool') - except: - pass - {{endif}} - {{if 'cuMemSetMemPool' in found_functions}} - try: - global __cuMemSetMemPool - __cuMemSetMemPool = win32api.GetProcAddress(handle, 'cuMemSetMemPool') - except: - pass - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - try: - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - try: - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - try: - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = win32api.GetProcAddress(handle, 'cuMemPoolExportPointer') - except: - pass - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - try: - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = win32api.GetProcAddress(handle, 'cuMemPoolImportPointer') - except: - pass - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - try: - global __cuMulticastCreate - __cuMulticastCreate = win32api.GetProcAddress(handle, 'cuMulticastCreate') - except: - pass - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - try: - global __cuMulticastAddDevice - __cuMulticastAddDevice = win32api.GetProcAddress(handle, 'cuMulticastAddDevice') - except: - pass - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - try: - global __cuMulticastBindMem - __cuMulticastBindMem = win32api.GetProcAddress(handle, 'cuMulticastBindMem') - except: - pass - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - try: - global __cuMulticastBindAddr - __cuMulticastBindAddr = win32api.GetProcAddress(handle, 'cuMulticastBindAddr') - except: - pass - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - try: - global __cuMulticastUnbind - __cuMulticastUnbind = win32api.GetProcAddress(handle, 'cuMulticastUnbind') - except: - pass - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - try: - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = win32api.GetProcAddress(handle, 'cuMulticastGetGranularity') - except: - pass - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - try: - global __cuPointerGetAttribute - __cuPointerGetAttribute = win32api.GetProcAddress(handle, 'cuPointerGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - try: - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = win32api.GetProcAddress(handle, 'cuMemAdvise_v2') - except: - pass - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - try: - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = win32api.GetProcAddress(handle, 'cuMemRangeGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - try: - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = win32api.GetProcAddress(handle, 'cuMemRangeGetAttributes') - except: - pass - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - try: - global __cuPointerSetAttribute - __cuPointerSetAttribute = win32api.GetProcAddress(handle, 'cuPointerSetAttribute') - except: - pass - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - try: - global __cuPointerGetAttributes - __cuPointerGetAttributes = win32api.GetProcAddress(handle, 'cuPointerGetAttributes') - except: - pass - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - try: - global __cuStreamCreate - __cuStreamCreate = win32api.GetProcAddress(handle, 'cuStreamCreate') - except: - pass - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - try: - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = win32api.GetProcAddress(handle, 'cuStreamCreateWithPriority') - except: - pass - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - try: - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = win32api.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') - except: - pass - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - try: - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = win32api.GetProcAddress(handle, 'cuStreamDestroy_v2') - except: - pass - {{endif}} - {{if 'cuEventCreate' in found_functions}} - try: - global __cuEventCreate - __cuEventCreate = win32api.GetProcAddress(handle, 'cuEventCreate') - except: - pass - {{endif}} - {{if 'cuEventQuery' in found_functions}} - try: - global __cuEventQuery - __cuEventQuery = win32api.GetProcAddress(handle, 'cuEventQuery') - except: - pass - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - try: - global __cuEventSynchronize - __cuEventSynchronize = win32api.GetProcAddress(handle, 'cuEventSynchronize') - except: - pass - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - try: - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = win32api.GetProcAddress(handle, 'cuEventDestroy_v2') - except: - pass - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - try: - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = win32api.GetProcAddress(handle, 'cuEventElapsedTime_v2') - except: - pass - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - try: - global __cuImportExternalMemory - __cuImportExternalMemory = win32api.GetProcAddress(handle, 'cuImportExternalMemory') - except: - pass - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - try: - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') - except: - pass - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - try: - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') - except: - pass - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - try: - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = win32api.GetProcAddress(handle, 'cuDestroyExternalMemory') - except: - pass - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - try: - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = win32api.GetProcAddress(handle, 'cuImportExternalSemaphore') - except: - pass - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - try: - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = win32api.GetProcAddress(handle, 'cuDestroyExternalSemaphore') - except: - pass - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - try: - global __cuFuncGetAttribute - __cuFuncGetAttribute = win32api.GetProcAddress(handle, 'cuFuncGetAttribute') - except: - pass - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - try: - global __cuFuncSetAttribute - __cuFuncSetAttribute = win32api.GetProcAddress(handle, 'cuFuncSetAttribute') - except: - pass - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - try: - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = win32api.GetProcAddress(handle, 'cuFuncSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - try: - global __cuFuncGetModule - __cuFuncGetModule = win32api.GetProcAddress(handle, 'cuFuncGetModule') - except: - pass - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - try: - global __cuFuncGetName - __cuFuncGetName = win32api.GetProcAddress(handle, 'cuFuncGetName') - except: - pass - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - try: - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = win32api.GetProcAddress(handle, 'cuFuncGetParamInfo') - except: - pass - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - try: - global __cuFuncIsLoaded - __cuFuncIsLoaded = win32api.GetProcAddress(handle, 'cuFuncIsLoaded') - except: - pass - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - try: - global __cuFuncLoad - __cuFuncLoad = win32api.GetProcAddress(handle, 'cuFuncLoad') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - try: - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') - except: - pass - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - try: - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = win32api.GetProcAddress(handle, 'cuFuncSetBlockShape') - except: - pass - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - try: - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = win32api.GetProcAddress(handle, 'cuFuncSetSharedSize') - except: - pass - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - try: - global __cuParamSetSize - __cuParamSetSize = win32api.GetProcAddress(handle, 'cuParamSetSize') - except: - pass - {{endif}} - {{if 'cuParamSeti' in found_functions}} - try: - global __cuParamSeti - __cuParamSeti = win32api.GetProcAddress(handle, 'cuParamSeti') - except: - pass - {{endif}} - {{if 'cuParamSetf' in found_functions}} - try: - global __cuParamSetf - __cuParamSetf = win32api.GetProcAddress(handle, 'cuParamSetf') - except: - pass - {{endif}} - {{if 'cuParamSetv' in found_functions}} - try: - global __cuParamSetv - __cuParamSetv = win32api.GetProcAddress(handle, 'cuParamSetv') - except: - pass - {{endif}} - {{if 'cuLaunch' in found_functions}} - try: - global __cuLaunch - __cuLaunch = win32api.GetProcAddress(handle, 'cuLaunch') - except: - pass - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - try: - global __cuLaunchGrid - __cuLaunchGrid = win32api.GetProcAddress(handle, 'cuLaunchGrid') - except: - pass - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - try: - global __cuLaunchGridAsync - __cuLaunchGridAsync = win32api.GetProcAddress(handle, 'cuLaunchGridAsync') - except: - pass - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - try: - global __cuParamSetTexRef - __cuParamSetTexRef = win32api.GetProcAddress(handle, 'cuParamSetTexRef') - except: - pass - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - try: - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - try: - global __cuGraphCreate - __cuGraphCreate = win32api.GetProcAddress(handle, 'cuGraphCreate') - except: - pass - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - try: - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - try: - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = win32api.GetProcAddress(handle, 'cuGraphAddMemcpyNode') - except: - pass - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - try: - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = win32api.GetProcAddress(handle, 'cuGraphAddMemsetNode') - except: - pass - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - try: - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - try: - global __cuGraphAddHostNode - __cuGraphAddHostNode = win32api.GetProcAddress(handle, 'cuGraphAddHostNode') - except: - pass - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - try: - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - try: - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - try: - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = win32api.GetProcAddress(handle, 'cuGraphAddChildGraphNode') - except: - pass - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - try: - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = win32api.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') - except: - pass - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - try: - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = win32api.GetProcAddress(handle, 'cuGraphAddEmptyNode') - except: - pass - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - try: - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = win32api.GetProcAddress(handle, 'cuGraphAddEventRecordNode') - except: - pass - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') - except: - pass - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - try: - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddEventWaitNode') - except: - pass - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') - except: - pass - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - try: - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = win32api.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') - except: - pass - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - try: - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = win32api.GetProcAddress(handle, 'cuGraphAddMemAllocNode') - except: - pass - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - try: - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - try: - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = win32api.GetProcAddress(handle, 'cuGraphAddMemFreeNode') - except: - pass - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - try: - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') - except: - pass - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - try: - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = win32api.GetProcAddress(handle, 'cuDeviceGraphMemTrim') - except: - pass - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') - except: - pass - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') - except: - pass - {{endif}} - {{if 'cuGraphClone' in found_functions}} - try: - global __cuGraphClone - __cuGraphClone = win32api.GetProcAddress(handle, 'cuGraphClone') - except: - pass - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - try: - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = win32api.GetProcAddress(handle, 'cuGraphNodeFindInClone') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - try: - global __cuGraphNodeGetType - __cuGraphNodeGetType = win32api.GetProcAddress(handle, 'cuGraphNodeGetType') - except: - pass - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - try: - global __cuGraphGetNodes - __cuGraphGetNodes = win32api.GetProcAddress(handle, 'cuGraphGetNodes') - except: - pass - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - try: - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = win32api.GetProcAddress(handle, 'cuGraphGetRootNodes') - except: - pass - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - try: - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = win32api.GetProcAddress(handle, 'cuGraphGetEdges_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - try: - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - try: - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') - except: - pass - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - try: - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphAddDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - try: - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - try: - global __cuGraphDestroyNode - __cuGraphDestroyNode = win32api.GetProcAddress(handle, 'cuGraphDestroyNode') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - try: - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') - except: - pass - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - try: - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = win32api.GetProcAddress(handle, 'cuGraphExecGetFlags') - except: - pass - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - try: - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - try: - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - try: - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeSetEnabled') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - try: - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeGetEnabled') - except: - pass - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - try: - global __cuGraphExecDestroy - __cuGraphExecDestroy = win32api.GetProcAddress(handle, 'cuGraphExecDestroy') - except: - pass - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - try: - global __cuGraphDestroy - __cuGraphDestroy = win32api.GetProcAddress(handle, 'cuGraphDestroy') - except: - pass - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - try: - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = win32api.GetProcAddress(handle, 'cuGraphExecUpdate_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - try: - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = win32api.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') - except: - pass - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - try: - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = win32api.GetProcAddress(handle, 'cuGraphDebugDotPrint') - except: - pass - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - try: - global __cuUserObjectCreate - __cuUserObjectCreate = win32api.GetProcAddress(handle, 'cuUserObjectCreate') - except: - pass - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - try: - global __cuUserObjectRetain - __cuUserObjectRetain = win32api.GetProcAddress(handle, 'cuUserObjectRetain') - except: - pass - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - try: - global __cuUserObjectRelease - __cuUserObjectRelease = win32api.GetProcAddress(handle, 'cuUserObjectRelease') - except: - pass - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - try: - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = win32api.GetProcAddress(handle, 'cuGraphRetainUserObject') - except: - pass - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - try: - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = win32api.GetProcAddress(handle, 'cuGraphReleaseUserObject') - except: - pass - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - try: - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddNode_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - try: - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - try: - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - try: - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = win32api.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - except: - pass - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - try: - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = win32api.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - try: - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') - except: - pass - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - try: - global __cuTexRefSetArray - __cuTexRefSetArray = win32api.GetProcAddress(handle, 'cuTexRefSetArray') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - try: - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - try: - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress_v2') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - try: - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') - except: - pass - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - try: - global __cuTexRefSetFormat - __cuTexRefSetFormat = win32api.GetProcAddress(handle, 'cuTexRefSetFormat') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - try: - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefSetAddressMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - try: - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') - except: - pass - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') - except: - pass - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - try: - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefSetBorderColor') - except: - pass - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - try: - global __cuTexRefSetFlags - __cuTexRefSetFlags = win32api.GetProcAddress(handle, 'cuTexRefSetFlags') - except: - pass - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - try: - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefGetAddress_v2') - except: - pass - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - try: - global __cuTexRefGetArray - __cuTexRefGetArray = win32api.GetProcAddress(handle, 'cuTexRefGetArray') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - try: - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') - except: - pass - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - try: - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefGetAddressMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - try: - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - try: - global __cuTexRefGetFormat - __cuTexRefGetFormat = win32api.GetProcAddress(handle, 'cuTexRefGetFormat') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') - except: - pass - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') - except: - pass - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - try: - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefGetBorderColor') - except: - pass - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - try: - global __cuTexRefGetFlags - __cuTexRefGetFlags = win32api.GetProcAddress(handle, 'cuTexRefGetFlags') - except: - pass - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - try: - global __cuTexRefCreate - __cuTexRefCreate = win32api.GetProcAddress(handle, 'cuTexRefCreate') - except: - pass - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - try: - global __cuTexRefDestroy - __cuTexRefDestroy = win32api.GetProcAddress(handle, 'cuTexRefDestroy') - except: - pass - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - try: - global __cuSurfRefSetArray - __cuSurfRefSetArray = win32api.GetProcAddress(handle, 'cuSurfRefSetArray') - except: - pass - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - try: - global __cuSurfRefGetArray - __cuSurfRefGetArray = win32api.GetProcAddress(handle, 'cuSurfRefGetArray') - except: - pass - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - try: - global __cuTexObjectCreate - __cuTexObjectCreate = win32api.GetProcAddress(handle, 'cuTexObjectCreate') - except: - pass - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - try: - global __cuTexObjectDestroy - __cuTexObjectDestroy = win32api.GetProcAddress(handle, 'cuTexObjectDestroy') - except: - pass - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - try: - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') - except: - pass - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - try: - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') - except: - pass - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - try: - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') - except: - pass - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - try: - global __cuSurfObjectCreate - __cuSurfObjectCreate = win32api.GetProcAddress(handle, 'cuSurfObjectCreate') - except: - pass - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - try: - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = win32api.GetProcAddress(handle, 'cuSurfObjectDestroy') - except: - pass - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - try: - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - try: - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = win32api.GetProcAddress(handle, 'cuTensorMapEncodeTiled') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - try: - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - try: - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') - except: - pass - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - try: - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = win32api.GetProcAddress(handle, 'cuTensorMapReplaceAddress') - except: - pass - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - try: - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = win32api.GetProcAddress(handle, 'cuDeviceCanAccessPeer') - except: - pass - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - try: - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxEnablePeerAccess') - except: - pass - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - try: - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxDisablePeerAccess') - except: - pass - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - try: - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') - except: - pass - {{endif}} - {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - try: - global __cuDeviceGetP2PAtomicCapabilities - __cuDeviceGetP2PAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') - except: - pass - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - try: - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = win32api.GetProcAddress(handle, 'cuGraphicsUnregisterResource') - except: - pass - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - try: - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = win32api.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - try: - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - try: - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - try: - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') - except: - pass - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - try: - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') - except: - pass - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - try: - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpGetAttribute') - except: - pass - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') - except: - pass - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - try: - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpSetAttribute') - except: - pass - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') - except: - pass - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - try: - global __cuGetExportTable - __cuGetExportTable = win32api.GetProcAddress(handle, 'cuGetExportTable') - except: - pass - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - try: - global __cuGreenCtxCreate - __cuGreenCtxCreate = win32api.GetProcAddress(handle, 'cuGreenCtxCreate') - except: - pass - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - try: - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = win32api.GetProcAddress(handle, 'cuGreenCtxDestroy') - except: - pass - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - try: - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = win32api.GetProcAddress(handle, 'cuCtxFromGreenCtx') - except: - pass - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - try: - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = win32api.GetProcAddress(handle, 'cuDeviceGetDevResource') - except: - pass - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - try: - global __cuCtxGetDevResource - __cuCtxGetDevResource = win32api.GetProcAddress(handle, 'cuCtxGetDevResource') - except: - pass - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - try: - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = win32api.GetProcAddress(handle, 'cuGreenCtxGetDevResource') - except: - pass - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - try: - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = win32api.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') - except: - pass - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - try: - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = win32api.GetProcAddress(handle, 'cuDevResourceGenerateDesc') - except: - pass - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - try: - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = win32api.GetProcAddress(handle, 'cuGreenCtxRecordEvent') - except: - pass - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - try: - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = win32api.GetProcAddress(handle, 'cuGreenCtxWaitEvent') - except: - pass - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - try: - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = win32api.GetProcAddress(handle, 'cuStreamGetGreenCtx') - except: - pass - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - try: - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = win32api.GetProcAddress(handle, 'cuGreenCtxStreamCreate') - except: - pass - {{endif}} - {{if 'cuGreenCtxGetId' in found_functions}} - try: - global __cuGreenCtxGetId - __cuGreenCtxGetId = win32api.GetProcAddress(handle, 'cuGreenCtxGetId') - except: - pass - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - try: - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = win32api.GetProcAddress(handle, 'cuLogsRegisterCallback') - except: - pass - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - try: - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = win32api.GetProcAddress(handle, 'cuLogsUnregisterCallback') - except: - pass - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - try: - global __cuLogsCurrent - __cuLogsCurrent = win32api.GetProcAddress(handle, 'cuLogsCurrent') - except: - pass - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - try: - global __cuLogsDumpToFile - __cuLogsDumpToFile = win32api.GetProcAddress(handle, 'cuLogsDumpToFile') - except: - pass - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - try: - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = win32api.GetProcAddress(handle, 'cuLogsDumpToMemory') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - try: - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - try: - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetState') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - try: - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = win32api.GetProcAddress(handle, 'cuCheckpointProcessLock') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - try: - global __cuCheckpointProcessCheckpoint - __cuCheckpointProcessCheckpoint = win32api.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - try: - global __cuCheckpointProcessUnlock - __cuCheckpointProcessUnlock = win32api.GetProcAddress(handle, 'cuCheckpointProcessUnlock') - except: - pass - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - try: - global __cuProfilerStart - __cuProfilerStart = win32api.GetProcAddress(handle, 'cuProfilerStart') - except: - pass - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - try: - global __cuProfilerStop - __cuProfilerStop = win32api.GetProcAddress(handle, 'cuProfilerStop') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerConnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = win32api.GetProcAddress(handle, 'cuEventCreateFromEGLSync') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = win32api.GetProcAddress(handle, 'cuGLGetDevices_v2') - except: - pass - {{endif}} - {{if True}} - try: - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = win32api.GetProcAddress(handle, 'cuVDPAUGetDevice') - except: - pass - {{endif}} - {{if True}} - try: - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') - except: - pass - {{endif}} - {{else}} - # Load using dlsym - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy_ptds') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer_ptds') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2_ptds') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2_ptds') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2_ptds') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer_ptds') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync_ptsz') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2_ptds') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2_ptds') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2_ptds') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async_ptsz') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async_ptsz') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async_ptsz') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync_ptsz') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync_ptsz') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync_ptsz') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync_ptsz') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync_ptsz') - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync_ptsz') - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice_ptsz') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags_ptsz') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId_ptsz') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx_ptsz') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent_ptsz') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback_ptsz') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2_ptsz') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph_ptsz') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture_ptsz') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync_ptsz') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery_ptsz') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize_ptsz') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes_ptsz') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute_ptsz') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute_ptsz') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord_ptsz') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags_ptsz') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2_ptsz') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel_ptsz') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx_ptsz') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel_ptsz') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc_ptsz') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams_ptsz') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload_ptsz') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch_ptsz') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources_ptsz') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources_ptsz') - {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync') - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2') - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2') - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync') - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync') - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources') - {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - __cuGetErrorString = dlfcn.dlsym(handle, 'cuGetErrorString') - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - __cuGetErrorName = dlfcn.dlsym(handle, 'cuGetErrorName') - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - __cuInit = dlfcn.dlsym(handle, 'cuInit') - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - __cuDriverGetVersion = dlfcn.dlsym(handle, 'cuDriverGetVersion') - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - __cuDeviceGet = dlfcn.dlsym(handle, 'cuDeviceGet') - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - __cuDeviceGetCount = dlfcn.dlsym(handle, 'cuDeviceGetCount') - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName') - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2') - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - __cuDeviceGetLuid = dlfcn.dlsym(handle, 'cuDeviceGetLuid') - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = dlfcn.dlsym(handle, 'cuDeviceTotalMem_v2') - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = dlfcn.dlsym(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute') - {{endif}} - {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - global __cuDeviceGetHostAtomicCapabilities - __cuDeviceGetHostAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetHostAtomicCapabilities') - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes') - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = dlfcn.dlsym(handle, 'cuDeviceSetMemPool') - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = dlfcn.dlsym(handle, 'cuDeviceGetMemPool') - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = dlfcn.dlsym(handle, 'cuDeviceGetDefaultMemPool') - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = dlfcn.dlsym(handle, 'cuDeviceGetExecAffinitySupport') - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = dlfcn.dlsym(handle, 'cuFlushGPUDirectRDMAWrites') - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - __cuDeviceGetProperties = dlfcn.dlsym(handle, 'cuDeviceGetProperties') - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = dlfcn.dlsym(handle, 'cuDeviceComputeCapability') - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRetain') - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRelease_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxSetFlags_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxGetState') - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2') - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4') - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = dlfcn.dlsym(handle, 'cuCtxDestroy_v2') - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPushCurrent_v2') - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPopCurrent_v2') - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - __cuCtxSetCurrent = dlfcn.dlsym(handle, 'cuCtxSetCurrent') - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - __cuCtxGetCurrent = dlfcn.dlsym(handle, 'cuCtxGetCurrent') - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice') - {{endif}} - {{if 'cuCtxGetDevice_v2' in found_functions}} - global __cuCtxGetDevice_v2 - __cuCtxGetDevice_v2 = dlfcn.dlsym(handle, 'cuCtxGetDevice_v2') - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags') - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - __cuCtxSetFlags = dlfcn.dlsym(handle, 'cuCtxSetFlags') - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - __cuCtxGetId = dlfcn.dlsym(handle, 'cuCtxGetId') - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize') - {{endif}} - {{if 'cuCtxSynchronize_v2' in found_functions}} - global __cuCtxSynchronize_v2 - __cuCtxSynchronize_v2 = dlfcn.dlsym(handle, 'cuCtxSynchronize_v2') - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit') - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - __cuCtxGetLimit = dlfcn.dlsym(handle, 'cuCtxGetLimit') - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = dlfcn.dlsym(handle, 'cuCtxGetCacheConfig') - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = dlfcn.dlsym(handle, 'cuCtxSetCacheConfig') - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = dlfcn.dlsym(handle, 'cuCtxGetApiVersion') - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = dlfcn.dlsym(handle, 'cuCtxGetStreamPriorityRange') - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = dlfcn.dlsym(handle, 'cuCtxResetPersistingL2Cache') - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = dlfcn.dlsym(handle, 'cuCtxGetExecAffinity') - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - __cuCtxRecordEvent = dlfcn.dlsym(handle, 'cuCtxRecordEvent') - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - __cuCtxWaitEvent = dlfcn.dlsym(handle, 'cuCtxWaitEvent') - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - __cuCtxAttach = dlfcn.dlsym(handle, 'cuCtxAttach') - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - __cuCtxDetach = dlfcn.dlsym(handle, 'cuCtxDetach') - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxGetSharedMemConfig') - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxSetSharedMemConfig') - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - __cuModuleLoad = dlfcn.dlsym(handle, 'cuModuleLoad') - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - __cuModuleLoadData = dlfcn.dlsym(handle, 'cuModuleLoadData') - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = dlfcn.dlsym(handle, 'cuModuleLoadDataEx') - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = dlfcn.dlsym(handle, 'cuModuleLoadFatBinary') - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - __cuModuleUnload = dlfcn.dlsym(handle, 'cuModuleUnload') - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = dlfcn.dlsym(handle, 'cuModuleGetLoadingMode') - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - __cuModuleGetFunction = dlfcn.dlsym(handle, 'cuModuleGetFunction') - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = dlfcn.dlsym(handle, 'cuModuleGetFunctionCount') - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = dlfcn.dlsym(handle, 'cuModuleEnumerateFunctions') - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = dlfcn.dlsym(handle, 'cuModuleGetGlobal_v2') - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = dlfcn.dlsym(handle, 'cuLinkCreate_v2') - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = dlfcn.dlsym(handle, 'cuLinkAddData_v2') - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = dlfcn.dlsym(handle, 'cuLinkAddFile_v2') - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - __cuLinkComplete = dlfcn.dlsym(handle, 'cuLinkComplete') - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - __cuLinkDestroy = dlfcn.dlsym(handle, 'cuLinkDestroy') - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - __cuModuleGetTexRef = dlfcn.dlsym(handle, 'cuModuleGetTexRef') - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = dlfcn.dlsym(handle, 'cuModuleGetSurfRef') - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - __cuLibraryLoadData = dlfcn.dlsym(handle, 'cuLibraryLoadData') - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = dlfcn.dlsym(handle, 'cuLibraryLoadFromFile') - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - __cuLibraryUnload = dlfcn.dlsym(handle, 'cuLibraryUnload') - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - __cuLibraryGetKernel = dlfcn.dlsym(handle, 'cuLibraryGetKernel') - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = dlfcn.dlsym(handle, 'cuLibraryGetKernelCount') - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = dlfcn.dlsym(handle, 'cuLibraryEnumerateKernels') - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - __cuLibraryGetModule = dlfcn.dlsym(handle, 'cuLibraryGetModule') - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - __cuKernelGetFunction = dlfcn.dlsym(handle, 'cuKernelGetFunction') - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - __cuKernelGetLibrary = dlfcn.dlsym(handle, 'cuKernelGetLibrary') - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = dlfcn.dlsym(handle, 'cuLibraryGetGlobal') - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - __cuLibraryGetManaged = dlfcn.dlsym(handle, 'cuLibraryGetManaged') - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = dlfcn.dlsym(handle, 'cuLibraryGetUnifiedFunction') - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - __cuKernelGetAttribute = dlfcn.dlsym(handle, 'cuKernelGetAttribute') - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - __cuKernelSetAttribute = dlfcn.dlsym(handle, 'cuKernelSetAttribute') - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = dlfcn.dlsym(handle, 'cuKernelSetCacheConfig') - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - __cuKernelGetName = dlfcn.dlsym(handle, 'cuKernelGetName') - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = dlfcn.dlsym(handle, 'cuKernelGetParamInfo') - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = dlfcn.dlsym(handle, 'cuMemGetInfo_v2') - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = dlfcn.dlsym(handle, 'cuMemAlloc_v2') - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = dlfcn.dlsym(handle, 'cuMemAllocPitch_v2') - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - __cuMemFree_v2 = dlfcn.dlsym(handle, 'cuMemFree_v2') - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = dlfcn.dlsym(handle, 'cuMemGetAddressRange_v2') - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = dlfcn.dlsym(handle, 'cuMemAllocHost_v2') - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - __cuMemFreeHost = dlfcn.dlsym(handle, 'cuMemFreeHost') - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - __cuMemHostAlloc = dlfcn.dlsym(handle, 'cuMemHostAlloc') - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = dlfcn.dlsym(handle, 'cuMemHostGetDevicePointer_v2') - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - __cuMemHostGetFlags = dlfcn.dlsym(handle, 'cuMemHostGetFlags') - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - __cuMemAllocManaged = dlfcn.dlsym(handle, 'cuMemAllocManaged') - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceRegisterAsyncNotification') - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceUnregisterAsyncNotification') - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetByPCIBusId') - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetPCIBusId') - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = dlfcn.dlsym(handle, 'cuIpcGetEventHandle') - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = dlfcn.dlsym(handle, 'cuIpcOpenEventHandle') - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = dlfcn.dlsym(handle, 'cuIpcGetMemHandle') - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = dlfcn.dlsym(handle, 'cuIpcOpenMemHandle_v2') - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = dlfcn.dlsym(handle, 'cuIpcCloseMemHandle') - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = dlfcn.dlsym(handle, 'cuMemHostRegister_v2') - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - __cuMemHostUnregister = dlfcn.dlsym(handle, 'cuMemHostUnregister') - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = dlfcn.dlsym(handle, 'cuArrayCreate_v2') - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArrayGetDescriptor_v2') - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuArrayGetSparseProperties') - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuMipmappedArrayGetSparseProperties') - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuArrayGetMemoryRequirements') - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuMipmappedArrayGetMemoryRequirements') - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - __cuArrayGetPlane = dlfcn.dlsym(handle, 'cuArrayGetPlane') - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - __cuArrayDestroy = dlfcn.dlsym(handle, 'cuArrayDestroy') - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = dlfcn.dlsym(handle, 'cuArray3DCreate_v2') - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArray3DGetDescriptor_v2') - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = dlfcn.dlsym(handle, 'cuMipmappedArrayCreate') - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = dlfcn.dlsym(handle, 'cuMipmappedArrayGetLevel') - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = dlfcn.dlsym(handle, 'cuMipmappedArrayDestroy') - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = dlfcn.dlsym(handle, 'cuMemGetHandleForAddressRange') - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - __cuMemAddressReserve = dlfcn.dlsym(handle, 'cuMemAddressReserve') - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - __cuMemAddressFree = dlfcn.dlsym(handle, 'cuMemAddressFree') - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - __cuMemCreate = dlfcn.dlsym(handle, 'cuMemCreate') - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - __cuMemRelease = dlfcn.dlsym(handle, 'cuMemRelease') - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - __cuMemMap = dlfcn.dlsym(handle, 'cuMemMap') - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - __cuMemUnmap = dlfcn.dlsym(handle, 'cuMemUnmap') - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - __cuMemSetAccess = dlfcn.dlsym(handle, 'cuMemSetAccess') - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - __cuMemGetAccess = dlfcn.dlsym(handle, 'cuMemGetAccess') - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemExportToShareableHandle') - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemImportFromShareableHandle') - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = dlfcn.dlsym(handle, 'cuMemGetAllocationGranularity') - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = dlfcn.dlsym(handle, 'cuMemGetAllocationPropertiesFromHandle') - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = dlfcn.dlsym(handle, 'cuMemRetainAllocationHandle') - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = dlfcn.dlsym(handle, 'cuMemPoolTrimTo') - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = dlfcn.dlsym(handle, 'cuMemPoolSetAttribute') - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = dlfcn.dlsym(handle, 'cuMemPoolGetAttribute') - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = dlfcn.dlsym(handle, 'cuMemPoolSetAccess') - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = dlfcn.dlsym(handle, 'cuMemPoolGetAccess') - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - __cuMemPoolCreate = dlfcn.dlsym(handle, 'cuMemPoolCreate') - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy') - {{endif}} - {{if 'cuMemGetDefaultMemPool' in found_functions}} - global __cuMemGetDefaultMemPool - __cuMemGetDefaultMemPool = dlfcn.dlsym(handle, 'cuMemGetDefaultMemPool') - {{endif}} - {{if 'cuMemGetMemPool' in found_functions}} - global __cuMemGetMemPool - __cuMemGetMemPool = dlfcn.dlsym(handle, 'cuMemGetMemPool') - {{endif}} - {{if 'cuMemSetMemPool' in found_functions}} - global __cuMemSetMemPool - __cuMemSetMemPool = dlfcn.dlsym(handle, 'cuMemSetMemPool') - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle') - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolImportFromShareableHandle') - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = dlfcn.dlsym(handle, 'cuMemPoolExportPointer') - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = dlfcn.dlsym(handle, 'cuMemPoolImportPointer') - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - __cuMulticastCreate = dlfcn.dlsym(handle, 'cuMulticastCreate') - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - __cuMulticastAddDevice = dlfcn.dlsym(handle, 'cuMulticastAddDevice') - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - __cuMulticastBindMem = dlfcn.dlsym(handle, 'cuMulticastBindMem') - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr') - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - __cuMulticastUnbind = dlfcn.dlsym(handle, 'cuMulticastUnbind') - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = dlfcn.dlsym(handle, 'cuMulticastGetGranularity') - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute') - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2') - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = dlfcn.dlsym(handle, 'cuMemRangeGetAttribute') - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = dlfcn.dlsym(handle, 'cuMemRangeGetAttributes') - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - __cuPointerSetAttribute = dlfcn.dlsym(handle, 'cuPointerSetAttribute') - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - __cuPointerGetAttributes = dlfcn.dlsym(handle, 'cuPointerGetAttributes') - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - __cuStreamCreate = dlfcn.dlsym(handle, 'cuStreamCreate') - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = dlfcn.dlsym(handle, 'cuStreamCreateWithPriority') - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = dlfcn.dlsym(handle, 'cuThreadExchangeStreamCaptureMode') - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = dlfcn.dlsym(handle, 'cuStreamDestroy_v2') - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - __cuEventCreate = dlfcn.dlsym(handle, 'cuEventCreate') - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - __cuEventQuery = dlfcn.dlsym(handle, 'cuEventQuery') - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - __cuEventSynchronize = dlfcn.dlsym(handle, 'cuEventSynchronize') - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2') - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2') - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - __cuImportExternalMemory = dlfcn.dlsym(handle, 'cuImportExternalMemory') - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedBuffer') - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedMipmappedArray') - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = dlfcn.dlsym(handle, 'cuDestroyExternalMemory') - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = dlfcn.dlsym(handle, 'cuImportExternalSemaphore') - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = dlfcn.dlsym(handle, 'cuDestroyExternalSemaphore') - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - __cuFuncGetAttribute = dlfcn.dlsym(handle, 'cuFuncGetAttribute') - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - __cuFuncSetAttribute = dlfcn.dlsym(handle, 'cuFuncSetAttribute') - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = dlfcn.dlsym(handle, 'cuFuncSetCacheConfig') - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - __cuFuncGetModule = dlfcn.dlsym(handle, 'cuFuncGetModule') - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - __cuFuncGetName = dlfcn.dlsym(handle, 'cuFuncGetName') - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = dlfcn.dlsym(handle, 'cuFuncGetParamInfo') - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - __cuFuncIsLoaded = dlfcn.dlsym(handle, 'cuFuncIsLoaded') - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - __cuFuncLoad = dlfcn.dlsym(handle, 'cuFuncLoad') - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernelMultiDevice') - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = dlfcn.dlsym(handle, 'cuFuncSetBlockShape') - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = dlfcn.dlsym(handle, 'cuFuncSetSharedSize') - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - __cuParamSetSize = dlfcn.dlsym(handle, 'cuParamSetSize') - {{endif}} - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - __cuParamSeti = dlfcn.dlsym(handle, 'cuParamSeti') - {{endif}} - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - __cuParamSetf = dlfcn.dlsym(handle, 'cuParamSetf') - {{endif}} - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - __cuParamSetv = dlfcn.dlsym(handle, 'cuParamSetv') - {{endif}} - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - __cuLaunch = dlfcn.dlsym(handle, 'cuLaunch') - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - __cuLaunchGrid = dlfcn.dlsym(handle, 'cuLaunchGrid') - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - __cuLaunchGridAsync = dlfcn.dlsym(handle, 'cuLaunchGridAsync') - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - __cuParamSetTexRef = dlfcn.dlsym(handle, 'cuParamSetTexRef') - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = dlfcn.dlsym(handle, 'cuFuncSetSharedMemConfig') - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - __cuGraphCreate = dlfcn.dlsym(handle, 'cuGraphCreate') - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddKernelNode_v2') - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetParams_v2') - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = dlfcn.dlsym(handle, 'cuGraphAddMemcpyNode') - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeGetParams') - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = dlfcn.dlsym(handle, 'cuGraphAddMemsetNode') - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeGetParams') - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - __cuGraphAddHostNode = dlfcn.dlsym(handle, 'cuGraphAddHostNode') - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeGetParams') - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeSetParams') - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = dlfcn.dlsym(handle, 'cuGraphAddChildGraphNode') - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = dlfcn.dlsym(handle, 'cuGraphChildGraphNodeGetGraph') - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = dlfcn.dlsym(handle, 'cuGraphAddEmptyNode') - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = dlfcn.dlsym(handle, 'cuGraphAddEventRecordNode') - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeGetEvent') - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = dlfcn.dlsym(handle, 'cuGraphAddEventWaitNode') - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeGetEvent') - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresSignalNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresWaitNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = dlfcn.dlsym(handle, 'cuGraphAddBatchMemOpNode') - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeGetParams') - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = dlfcn.dlsym(handle, 'cuGraphAddMemAllocNode') - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemAllocNodeGetParams') - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = dlfcn.dlsym(handle, 'cuGraphAddMemFreeNode') - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemFreeNodeGetParams') - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = dlfcn.dlsym(handle, 'cuDeviceGraphMemTrim') - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceGetGraphMemAttribute') - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceSetGraphMemAttribute') - {{endif}} - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - __cuGraphClone = dlfcn.dlsym(handle, 'cuGraphClone') - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = dlfcn.dlsym(handle, 'cuGraphNodeFindInClone') - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - __cuGraphNodeGetType = dlfcn.dlsym(handle, 'cuGraphNodeGetType') - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - __cuGraphGetNodes = dlfcn.dlsym(handle, 'cuGraphGetNodes') - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes') - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2') - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2') - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2') - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2') - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2') - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - __cuGraphDestroyNode = dlfcn.dlsym(handle, 'cuGraphDestroyNode') - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = dlfcn.dlsym(handle, 'cuGraphInstantiateWithFlags') - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = dlfcn.dlsym(handle, 'cuGraphExecGetFlags') - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphExecKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecHostNodeSetParams') - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecChildGraphNodeSetParams') - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeSetEnabled') - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeGetEnabled') - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - __cuGraphExecDestroy = dlfcn.dlsym(handle, 'cuGraphExecDestroy') - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - __cuGraphDestroy = dlfcn.dlsym(handle, 'cuGraphDestroy') - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = dlfcn.dlsym(handle, 'cuGraphExecUpdate_v2') - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = dlfcn.dlsym(handle, 'cuGraphKernelNodeCopyAttributes') - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetAttribute') - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetAttribute') - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = dlfcn.dlsym(handle, 'cuGraphDebugDotPrint') - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - __cuUserObjectCreate = dlfcn.dlsym(handle, 'cuUserObjectCreate') - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - __cuUserObjectRetain = dlfcn.dlsym(handle, 'cuUserObjectRetain') - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - __cuUserObjectRelease = dlfcn.dlsym(handle, 'cuUserObjectRelease') - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = dlfcn.dlsym(handle, 'cuGraphRetainUserObject') - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject') - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2') - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphNodeSetParams') - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecNodeSetParams') - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = dlfcn.dlsym(handle, 'cuGraphConditionalHandleCreate') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSize') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = dlfcn.dlsym(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialClusterSize') - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveClusters') - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - __cuTexRefSetArray = dlfcn.dlsym(handle, 'cuTexRefSetArray') - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefSetMipmappedArray') - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefSetAddress_v2') - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = dlfcn.dlsym(handle, 'cuTexRefSetAddress2D_v3') - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - __cuTexRefSetFormat = dlfcn.dlsym(handle, 'cuTexRefSetFormat') - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = dlfcn.dlsym(handle, 'cuTexRefSetAddressMode') - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefSetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = dlfcn.dlsym(handle, 'cuTexRefSetBorderColor') - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - __cuTexRefSetFlags = dlfcn.dlsym(handle, 'cuTexRefSetFlags') - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefGetAddress_v2') - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - __cuTexRefGetArray = dlfcn.dlsym(handle, 'cuTexRefGetArray') - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefGetMipmappedArray') - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = dlfcn.dlsym(handle, 'cuTexRefGetAddressMode') - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetFilterMode') - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - __cuTexRefGetFormat = dlfcn.dlsym(handle, 'cuTexRefGetFormat') - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefGetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = dlfcn.dlsym(handle, 'cuTexRefGetBorderColor') - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - __cuTexRefGetFlags = dlfcn.dlsym(handle, 'cuTexRefGetFlags') - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - __cuTexRefCreate = dlfcn.dlsym(handle, 'cuTexRefCreate') - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - __cuTexRefDestroy = dlfcn.dlsym(handle, 'cuTexRefDestroy') - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - __cuSurfRefSetArray = dlfcn.dlsym(handle, 'cuSurfRefSetArray') - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - __cuSurfRefGetArray = dlfcn.dlsym(handle, 'cuSurfRefGetArray') - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - __cuTexObjectCreate = dlfcn.dlsym(handle, 'cuTexObjectCreate') - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - __cuTexObjectDestroy = dlfcn.dlsym(handle, 'cuTexObjectDestroy') - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceDesc') - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = dlfcn.dlsym(handle, 'cuTexObjectGetTextureDesc') - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceViewDesc') - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - __cuSurfObjectCreate = dlfcn.dlsym(handle, 'cuSurfObjectCreate') - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = dlfcn.dlsym(handle, 'cuSurfObjectDestroy') - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuSurfObjectGetResourceDesc') - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = dlfcn.dlsym(handle, 'cuTensorMapEncodeTiled') - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2col') - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2colWide') - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = dlfcn.dlsym(handle, 'cuTensorMapReplaceAddress') - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = dlfcn.dlsym(handle, 'cuDeviceCanAccessPeer') - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = dlfcn.dlsym(handle, 'cuCtxEnablePeerAccess') - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = dlfcn.dlsym(handle, 'cuCtxDisablePeerAccess') - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute') - {{endif}} - {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - global __cuDeviceGetP2PAtomicCapabilities - __cuDeviceGetP2PAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetP2PAtomicCapabilities') - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource') - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = dlfcn.dlsym(handle, 'cuGraphicsSubResourceGetMappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedPointer_v2') - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceSetMapFlags_v2') - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = dlfcn.dlsym(handle, 'cuCoredumpGetAttribute') - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpGetAttributeGlobal') - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = dlfcn.dlsym(handle, 'cuCoredumpSetAttribute') - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpSetAttributeGlobal') - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - __cuGetExportTable = dlfcn.dlsym(handle, 'cuGetExportTable') - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - __cuGreenCtxCreate = dlfcn.dlsym(handle, 'cuGreenCtxCreate') - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = dlfcn.dlsym(handle, 'cuGreenCtxDestroy') - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = dlfcn.dlsym(handle, 'cuCtxFromGreenCtx') - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = dlfcn.dlsym(handle, 'cuDeviceGetDevResource') - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - __cuCtxGetDevResource = dlfcn.dlsym(handle, 'cuCtxGetDevResource') - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = dlfcn.dlsym(handle, 'cuGreenCtxGetDevResource') - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = dlfcn.dlsym(handle, 'cuDevSmResourceSplitByCount') - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = dlfcn.dlsym(handle, 'cuDevResourceGenerateDesc') - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = dlfcn.dlsym(handle, 'cuGreenCtxRecordEvent') - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = dlfcn.dlsym(handle, 'cuGreenCtxWaitEvent') - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = dlfcn.dlsym(handle, 'cuStreamGetGreenCtx') - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate') - {{endif}} - {{if 'cuGreenCtxGetId' in found_functions}} - global __cuGreenCtxGetId - __cuGreenCtxGetId = dlfcn.dlsym(handle, 'cuGreenCtxGetId') - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback') - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = dlfcn.dlsym(handle, 'cuLogsUnregisterCallback') - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - __cuLogsCurrent = dlfcn.dlsym(handle, 'cuLogsCurrent') - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - __cuLogsDumpToFile = dlfcn.dlsym(handle, 'cuLogsDumpToFile') - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = dlfcn.dlsym(handle, 'cuLogsDumpToMemory') - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = dlfcn.dlsym(handle, 'cuCheckpointProcessGetRestoreThreadId') - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = dlfcn.dlsym(handle, 'cuCheckpointProcessGetState') - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = dlfcn.dlsym(handle, 'cuCheckpointProcessLock') - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - global __cuCheckpointProcessCheckpoint - __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - global __cuCheckpointProcessUnlock - __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - __cuProfilerStart = dlfcn.dlsym(handle, 'cuProfilerStart') - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - __cuProfilerStop = dlfcn.dlsym(handle, 'cuProfilerStop') - {{endif}} - {{if True}} - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsEGLRegisterImage') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnectWithFlags') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerAcquireFrame') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerReleaseFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerPresentFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerReturnFrame') - {{endif}} - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedEglFrame') - {{endif}} - {{if True}} - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = dlfcn.dlsym(handle, 'cuEventCreateFromEGLSync') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterBuffer') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterImage') - {{endif}} - {{if True}} - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = dlfcn.dlsym(handle, 'cuGLGetDevices_v2') - {{endif}} - {{if True}} - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = dlfcn.dlsym(handle, 'cuVDPAUGetDevice') - {{endif}} - {{if True}} - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = dlfcn.dlsym(handle, 'cuVDPAUCtxCreate_v2') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterVideoSurface') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface') - {{endif}} - {{endif}} + {{if 'cuEventElapsedTime_v2' in found_functions}} + global __cuEventElapsedTime_v2 + _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + global __cuImportExternalMemory + _F_cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + global __cuExternalMemoryGetMappedBuffer + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + global __cuExternalMemoryGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + global __cuDestroyExternalMemory + _F_cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + global __cuImportExternalSemaphore + _F_cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + global __cuDestroyExternalSemaphore + _F_cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + global __cuFuncGetAttribute + _F_cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + global __cuFuncSetAttribute + _F_cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + global __cuFuncSetCacheConfig + _F_cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + global __cuFuncGetModule + _F_cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + global __cuFuncGetName + _F_cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + global __cuFuncGetParamInfo + _F_cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + global __cuFuncIsLoaded + _F_cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + global __cuFuncLoad + _F_cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + global __cuLaunchCooperativeKernelMultiDevice + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + global __cuFuncSetBlockShape + _F_cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + global __cuFuncSetSharedSize + _F_cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + global __cuParamSetSize + _F_cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSeti' in found_functions}} + global __cuParamSeti + _F_cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetf' in found_functions}} + global __cuParamSetf + _F_cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetv' in found_functions}} + global __cuParamSetv + _F_cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunch' in found_functions}} + global __cuLaunch + _F_cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + global __cuLaunchGrid + _F_cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + global __cuLaunchGridAsync + _F_cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + global __cuParamSetTexRef + _F_cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + global __cuFuncSetSharedMemConfig + _F_cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + global __cuGraphCreate + _F_cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + global __cuGraphAddKernelNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + global __cuGraphKernelNodeGetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + global __cuGraphKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + global __cuGraphAddMemcpyNode + _F_cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + global __cuGraphMemcpyNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + global __cuGraphMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + global __cuGraphAddMemsetNode + _F_cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + global __cuGraphMemsetNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + global __cuGraphMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + global __cuGraphAddHostNode + _F_cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + global __cuGraphHostNodeGetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + global __cuGraphHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + global __cuGraphAddChildGraphNode + _F_cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + global __cuGraphChildGraphNodeGetGraph + _F_cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + global __cuGraphAddEmptyNode + _F_cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + _F_cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + global __cuGraphEventRecordNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + global __cuGraphEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + global __cuGraphAddEventWaitNode + _F_cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + global __cuGraphEventWaitNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + global __cuGraphEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + global __cuGraphAddExternalSemaphoresSignalNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + global __cuGraphAddExternalSemaphoresWaitNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + global __cuGraphAddBatchMemOpNode + _F_cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + global __cuGraphBatchMemOpNodeGetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphExecBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + global __cuGraphAddMemAllocNode + _F_cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + global __cuGraphMemAllocNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + global __cuGraphAddMemFreeNode + _F_cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + global __cuGraphMemFreeNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + global __cuDeviceGraphMemTrim + _F_cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + global __cuDeviceGetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + global __cuDeviceSetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphClone' in found_functions}} + global __cuGraphClone + _F_cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + global __cuGraphNodeFindInClone + _F_cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + global __cuGraphNodeGetType + _F_cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + global __cuGraphGetNodes + _F_cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + global __cuGraphGetRootNodes + _F_cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + global __cuGraphGetEdges_v2 + _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + global __cuGraphNodeGetDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + global __cuGraphNodeGetDependentNodes_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + global __cuGraphAddDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + global __cuGraphRemoveDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + global __cuGraphDestroyNode + _F_cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + global __cuGraphInstantiateWithFlags + _F_cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + global __cuGraphExecGetFlags + _F_cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + global __cuGraphExecKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + global __cuGraphExecMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + global __cuGraphExecMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + global __cuGraphExecHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + global __cuGraphExecChildGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + global __cuGraphExecEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + global __cuGraphExecEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + global __cuGraphNodeSetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + global __cuGraphNodeGetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + global __cuGraphExecDestroy + _F_cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + global __cuGraphDestroy + _F_cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + global __cuGraphExecUpdate_v2 + _F_cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + global __cuGraphKernelNodeCopyAttributes + _F_cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + global __cuGraphKernelNodeGetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + global __cuGraphKernelNodeSetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + global __cuGraphDebugDotPrint + _F_cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + global __cuUserObjectCreate + _F_cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + global __cuUserObjectRetain + _F_cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + global __cuUserObjectRelease + _F_cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + global __cuGraphRetainUserObject + _F_cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + global __cuGraphReleaseUserObject + _F_cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + global __cuGraphAddNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + global __cuGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + global __cuGraphExecNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + global __cuGraphConditionalHandleCreate + _F_cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + global __cuOccupancyMaxPotentialBlockSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + global __cuOccupancyAvailableDynamicSMemPerBlock + _F_cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + global __cuOccupancyMaxPotentialClusterSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + global __cuOccupancyMaxActiveClusters + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + global __cuTexRefSetArray + _F_cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + global __cuTexRefSetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + global __cuTexRefSetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + global __cuTexRefSetAddress2D_v3 + _F_cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + global __cuTexRefSetFormat + _F_cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + global __cuTexRefSetAddressMode + _F_cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + global __cuTexRefSetFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + global __cuTexRefSetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + global __cuTexRefSetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + global __cuTexRefSetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + global __cuTexRefSetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + global __cuTexRefSetBorderColor + _F_cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + global __cuTexRefSetFlags + _F_cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + global __cuTexRefGetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + global __cuTexRefGetArray + _F_cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + global __cuTexRefGetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + global __cuTexRefGetAddressMode + _F_cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + global __cuTexRefGetFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + global __cuTexRefGetFormat + _F_cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + global __cuTexRefGetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + global __cuTexRefGetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + global __cuTexRefGetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + global __cuTexRefGetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + global __cuTexRefGetBorderColor + _F_cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + global __cuTexRefGetFlags + _F_cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + global __cuTexRefCreate + _F_cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + global __cuTexRefDestroy + _F_cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + global __cuSurfRefSetArray + _F_cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + global __cuSurfRefGetArray + _F_cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + global __cuTexObjectCreate + _F_cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + global __cuTexObjectDestroy + _F_cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + global __cuTexObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + global __cuTexObjectGetTextureDesc + _F_cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + global __cuTexObjectGetResourceViewDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + global __cuSurfObjectCreate + _F_cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + global __cuSurfObjectDestroy + _F_cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + global __cuSurfObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + global __cuTensorMapEncodeTiled + _F_cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + global __cuTensorMapEncodeIm2col + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + global __cuTensorMapEncodeIm2colWide + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + global __cuTensorMapReplaceAddress + _F_cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + global __cuDeviceCanAccessPeer + _F_cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + global __cuCtxEnablePeerAccess + _F_cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + global __cuCtxDisablePeerAccess + _F_cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + global __cuDeviceGetP2PAttribute + _F_cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + global __cuDeviceGetP2PAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetP2PAtomicCapabilities', &__cuDeviceGetP2PAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + global __cuGraphicsUnregisterResource + _F_cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + global __cuGraphicsSubResourceGetMappedArray + _F_cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + global __cuGraphicsResourceGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + global __cuGraphicsResourceGetMappedPointer_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + global __cuGraphicsResourceSetMapFlags_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + global __cuGetProcAddress_v2 + _F_cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + global __cuCoredumpGetAttribute + _F_cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + global __cuCoredumpGetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + global __cuCoredumpSetAttribute + _F_cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + global __cuCoredumpSetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + global __cuGetExportTable + _F_cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + global __cuGreenCtxCreate + _F_cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + global __cuGreenCtxDestroy + _F_cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + global __cuCtxFromGreenCtx + _F_cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + global __cuDeviceGetDevResource + _F_cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + global __cuCtxGetDevResource + _F_cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + global __cuGreenCtxGetDevResource + _F_cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + global __cuDevSmResourceSplitByCount + _F_cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + global __cuDevResourceGenerateDesc + _F_cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + global __cuGreenCtxRecordEvent + _F_cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + global __cuGreenCtxWaitEvent + _F_cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + global __cuStreamGetGreenCtx + _F_cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + global __cuGreenCtxStreamCreate + _F_cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + global __cuGreenCtxGetId + _F_cuGetProcAddress_v2('cuGreenCtxGetId', &__cuGreenCtxGetId, 12090, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + global __cuLogsRegisterCallback + _F_cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + global __cuLogsUnregisterCallback + _F_cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + global __cuLogsCurrent + _F_cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + global __cuLogsDumpToFile + _F_cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + global __cuLogsDumpToMemory + _F_cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + global __cuCheckpointProcessGetRestoreThreadId + _F_cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + global __cuCheckpointProcessGetState + _F_cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + global __cuCheckpointProcessLock + _F_cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + global __cuCheckpointProcessCheckpoint + _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + global __cuCheckpointProcessUnlock + _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + global __cuProfilerStart + _F_cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + global __cuProfilerStop + _F_cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsEGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnectWithFlags + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerAcquireFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerReleaseFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerConnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerPresentFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerReturnFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsResourceGetMappedEglFrame + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEventCreateFromEGLSync + _F_cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterBuffer + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGLGetDevices_v2 + _F_cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuVDPAUGetDevice + _F_cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuVDPAUCtxCreate_v2 + _F_cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterVideoSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterOutputSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + + __cuPythonInit = True + return 0 + + {{if 'Windows' == platform.system()}} + # Load using win32GetAddr + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + try: + global __cuMemcpy + __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + try: + global __cuMemcpyPeer + __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + try: + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + try: + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + try: + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + try: + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + try: + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + try: + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + try: + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + try: + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + try: + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + try: + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + try: + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + try: + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') + except: + pass + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + try: + global __cuMemcpyAsync + __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + try: + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + try: + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + try: + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + try: + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + try: + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + try: + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + try: + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + try: + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + try: + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + try: + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + try: + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + try: + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + try: + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + try: + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + try: + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + try: + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + try: + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') + except: + pass + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + try: + global __cuMemsetD8Async + __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + try: + global __cuMemsetD16Async + __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + try: + global __cuMemsetD32Async + __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + try: + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + try: + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + try: + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') + except: + pass + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + try: + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + try: + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + try: + global __cuMemFreeAsync + __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + try: + global __cuMemAllocAsync + __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + try: + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + try: + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + try: + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + try: + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + try: + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + try: + global __cuStreamGetPriority + __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + try: + global __cuStreamGetDevice + __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + try: + global __cuStreamGetFlags + __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + try: + global __cuStreamGetId + __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + try: + global __cuStreamGetCtx + __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + try: + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + try: + global __cuStreamWaitEvent + __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + try: + global __cuStreamAddCallback + __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + try: + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + try: + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + try: + global __cuStreamEndCapture + __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + try: + global __cuStreamIsCapturing + __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + try: + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + try: + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + try: + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + try: + global __cuStreamQuery + __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + try: + global __cuStreamSynchronize + __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + try: + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + try: + global __cuStreamGetAttribute + __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + try: + global __cuStreamSetAttribute + __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') + except: + pass + {{endif}} + {{if 'cuEventRecord' in found_functions}} + try: + global __cuEventRecord + __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord_ptsz') + except: + pass + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + try: + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') + except: + pass + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + try: + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + try: + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + try: + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + try: + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + try: + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + try: + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + try: + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') + except: + pass + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + try: + global __cuLaunchKernel + __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel_ptsz') + except: + pass + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + try: + global __cuLaunchKernelEx + __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') + except: + pass + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + try: + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') + except: + pass + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + try: + global __cuLaunchHostFunc + __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') + except: + pass + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + try: + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') + except: + pass + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + try: + global __cuGraphUpload + __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload_ptsz') + except: + pass + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + try: + global __cuGraphLaunch + __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch_ptsz') + except: + pass + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + try: + global __cuGraphicsMapResources + __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') + except: + pass + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + try: + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') + except: + pass + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + try: + global __cuMemcpy + __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy') + except: + pass + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + try: + global __cuMemcpyPeer + __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + try: + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + try: + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + try: + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + try: + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + try: + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + try: + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + try: + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + try: + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + try: + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + try: + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + try: + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + try: + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer') + except: + pass + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + try: + global __cuMemcpyAsync + __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync') + except: + pass + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + try: + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + try: + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + try: + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + try: + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + try: + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + try: + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + try: + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + try: + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + try: + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') + except: + pass + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + try: + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + try: + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + try: + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + try: + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + try: + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + try: + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + try: + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + try: + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2') + except: + pass + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + try: + global __cuMemsetD8Async + __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async') + except: + pass + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + try: + global __cuMemsetD16Async + __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async') + except: + pass + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + try: + global __cuMemsetD32Async + __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async') + except: + pass + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + try: + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async') + except: + pass + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + try: + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async') + except: + pass + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + try: + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async') + except: + pass + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + try: + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync') + except: + pass + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + try: + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync') + except: + pass + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + try: + global __cuMemFreeAsync + __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync') + except: + pass + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + try: + global __cuMemAllocAsync + __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync') + except: + pass + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + try: + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') + except: + pass + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + try: + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') + except: + pass + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + try: + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') + except: + pass + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + try: + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync') + except: + pass + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + try: + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') + except: + pass + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + try: + global __cuStreamGetPriority + __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority') + except: + pass + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + try: + global __cuStreamGetDevice + __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice') + except: + pass + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + try: + global __cuStreamGetFlags + __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags') + except: + pass + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + try: + global __cuStreamGetId + __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId') + except: + pass + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + try: + global __cuStreamGetCtx + __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx') + except: + pass + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + try: + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2') + except: + pass + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + try: + global __cuStreamWaitEvent + __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent') + except: + pass + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + try: + global __cuStreamAddCallback + __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback') + except: + pass + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + try: + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2') + except: + pass + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + try: + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') + except: + pass + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + try: + global __cuStreamEndCapture + __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture') + except: + pass + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + try: + global __cuStreamIsCapturing + __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing') + except: + pass + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + try: + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') + except: + pass + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + try: + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') + except: + pass + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + try: + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync') + except: + pass + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + try: + global __cuStreamQuery + __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery') + except: + pass + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + try: + global __cuStreamSynchronize + __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize') + except: + pass + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + try: + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes') + except: + pass + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + try: + global __cuStreamGetAttribute + __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute') + except: + pass + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + try: + global __cuStreamSetAttribute + __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute') + except: + pass + {{endif}} + {{if 'cuEventRecord' in found_functions}} + try: + global __cuEventRecord + __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord') + except: + pass + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + try: + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags') + except: + pass + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + try: + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') + except: + pass + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + try: + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') + except: + pass + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + try: + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2') + except: + pass + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + try: + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2') + except: + pass + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + try: + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2') + except: + pass + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + try: + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2') + except: + pass + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + try: + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') + except: + pass + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + try: + global __cuLaunchKernel + __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel') + except: + pass + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + try: + global __cuLaunchKernelEx + __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx') + except: + pass + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + try: + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel') + except: + pass + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + try: + global __cuLaunchHostFunc + __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc') + except: + pass + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + try: + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams') + except: + pass + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + try: + global __cuGraphUpload + __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload') + except: + pass + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + try: + global __cuGraphLaunch + __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch') + except: + pass + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + try: + global __cuGraphicsMapResources + __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources') + except: + pass + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + try: + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources') + except: + pass + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + try: + global __cuGetErrorString + __cuGetErrorString = win32api.GetProcAddress(handle, 'cuGetErrorString') + except: + pass + {{endif}} + {{if 'cuGetErrorName' in found_functions}} + try: + global __cuGetErrorName + __cuGetErrorName = win32api.GetProcAddress(handle, 'cuGetErrorName') + except: + pass + {{endif}} + {{if 'cuInit' in found_functions}} + try: + global __cuInit + __cuInit = win32api.GetProcAddress(handle, 'cuInit') + except: + pass + {{endif}} + {{if 'cuDriverGetVersion' in found_functions}} + try: + global __cuDriverGetVersion + __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') + except: + pass + {{endif}} + {{if 'cuDeviceGet' in found_functions}} + try: + global __cuDeviceGet + __cuDeviceGet = win32api.GetProcAddress(handle, 'cuDeviceGet') + except: + pass + {{endif}} + {{if 'cuDeviceGetCount' in found_functions}} + try: + global __cuDeviceGetCount + __cuDeviceGetCount = win32api.GetProcAddress(handle, 'cuDeviceGetCount') + except: + pass + {{endif}} + {{if 'cuDeviceGetName' in found_functions}} + try: + global __cuDeviceGetName + __cuDeviceGetName = win32api.GetProcAddress(handle, 'cuDeviceGetName') + except: + pass + {{endif}} + {{if 'cuDeviceGetUuid_v2' in found_functions}} + try: + global __cuDeviceGetUuid_v2 + __cuDeviceGetUuid_v2 = win32api.GetProcAddress(handle, 'cuDeviceGetUuid_v2') + except: + pass + {{endif}} + {{if 'cuDeviceGetLuid' in found_functions}} + try: + global __cuDeviceGetLuid + __cuDeviceGetLuid = win32api.GetProcAddress(handle, 'cuDeviceGetLuid') + except: + pass + {{endif}} + {{if 'cuDeviceTotalMem_v2' in found_functions}} + try: + global __cuDeviceTotalMem_v2 + __cuDeviceTotalMem_v2 = win32api.GetProcAddress(handle, 'cuDeviceTotalMem_v2') + except: + pass + {{endif}} + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + try: + global __cuDeviceGetTexture1DLinearMaxWidth + __cuDeviceGetTexture1DLinearMaxWidth = win32api.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') + except: + pass + {{endif}} + {{if 'cuDeviceGetAttribute' in found_functions}} + try: + global __cuDeviceGetAttribute + __cuDeviceGetAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetAttribute') + except: + pass + {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + try: + global __cuDeviceGetHostAtomicCapabilities + __cuDeviceGetHostAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') + except: + pass + {{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + try: + global __cuDeviceGetNvSciSyncAttributes + __cuDeviceGetNvSciSyncAttributes = win32api.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') + except: + pass + {{endif}} + {{if 'cuDeviceSetMemPool' in found_functions}} + try: + global __cuDeviceSetMemPool + __cuDeviceSetMemPool = win32api.GetProcAddress(handle, 'cuDeviceSetMemPool') + except: + pass + {{endif}} + {{if 'cuDeviceGetMemPool' in found_functions}} + try: + global __cuDeviceGetMemPool + __cuDeviceGetMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetMemPool') + except: + pass + {{endif}} + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + try: + global __cuDeviceGetDefaultMemPool + __cuDeviceGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') + except: + pass + {{endif}} + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + try: + global __cuDeviceGetExecAffinitySupport + __cuDeviceGetExecAffinitySupport = win32api.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') + except: + pass + {{endif}} + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + try: + global __cuFlushGPUDirectRDMAWrites + __cuFlushGPUDirectRDMAWrites = win32api.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') + except: + pass + {{endif}} + {{if 'cuDeviceGetProperties' in found_functions}} + try: + global __cuDeviceGetProperties + __cuDeviceGetProperties = win32api.GetProcAddress(handle, 'cuDeviceGetProperties') + except: + pass + {{endif}} + {{if 'cuDeviceComputeCapability' in found_functions}} + try: + global __cuDeviceComputeCapability + __cuDeviceComputeCapability = win32api.GetProcAddress(handle, 'cuDeviceComputeCapability') + except: + pass + {{endif}} + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + try: + global __cuDevicePrimaryCtxRetain + __cuDevicePrimaryCtxRetain = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') + except: + pass + {{endif}} + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + try: + global __cuDevicePrimaryCtxRelease_v2 + __cuDevicePrimaryCtxRelease_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') + except: + pass + {{endif}} + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + try: + global __cuDevicePrimaryCtxSetFlags_v2 + __cuDevicePrimaryCtxSetFlags_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') + except: + pass + {{endif}} + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + try: + global __cuDevicePrimaryCtxGetState + __cuDevicePrimaryCtxGetState = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') + except: + pass + {{endif}} + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + try: + global __cuDevicePrimaryCtxReset_v2 + __cuDevicePrimaryCtxReset_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') + except: + pass + {{endif}} + {{if 'cuCtxCreate_v4' in found_functions}} + try: + global __cuCtxCreate_v4 + __cuCtxCreate_v4 = win32api.GetProcAddress(handle, 'cuCtxCreate_v4') + except: + pass + {{endif}} + {{if 'cuCtxDestroy_v2' in found_functions}} + try: + global __cuCtxDestroy_v2 + __cuCtxDestroy_v2 = win32api.GetProcAddress(handle, 'cuCtxDestroy_v2') + except: + pass + {{endif}} + {{if 'cuCtxPushCurrent_v2' in found_functions}} + try: + global __cuCtxPushCurrent_v2 + __cuCtxPushCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPushCurrent_v2') + except: + pass + {{endif}} + {{if 'cuCtxPopCurrent_v2' in found_functions}} + try: + global __cuCtxPopCurrent_v2 + __cuCtxPopCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPopCurrent_v2') + except: + pass + {{endif}} + {{if 'cuCtxSetCurrent' in found_functions}} + try: + global __cuCtxSetCurrent + __cuCtxSetCurrent = win32api.GetProcAddress(handle, 'cuCtxSetCurrent') + except: + pass + {{endif}} + {{if 'cuCtxGetCurrent' in found_functions}} + try: + global __cuCtxGetCurrent + __cuCtxGetCurrent = win32api.GetProcAddress(handle, 'cuCtxGetCurrent') + except: + pass + {{endif}} + {{if 'cuCtxGetDevice' in found_functions}} + try: + global __cuCtxGetDevice + __cuCtxGetDevice = win32api.GetProcAddress(handle, 'cuCtxGetDevice') + except: + pass + {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + try: + global __cuCtxGetDevice_v2 + __cuCtxGetDevice_v2 = win32api.GetProcAddress(handle, 'cuCtxGetDevice_v2') + except: + pass + {{endif}} + {{if 'cuCtxGetFlags' in found_functions}} + try: + global __cuCtxGetFlags + __cuCtxGetFlags = win32api.GetProcAddress(handle, 'cuCtxGetFlags') + except: + pass + {{endif}} + {{if 'cuCtxSetFlags' in found_functions}} + try: + global __cuCtxSetFlags + __cuCtxSetFlags = win32api.GetProcAddress(handle, 'cuCtxSetFlags') + except: + pass + {{endif}} + {{if 'cuCtxGetId' in found_functions}} + try: + global __cuCtxGetId + __cuCtxGetId = win32api.GetProcAddress(handle, 'cuCtxGetId') + except: + pass + {{endif}} + {{if 'cuCtxSynchronize' in found_functions}} + try: + global __cuCtxSynchronize + __cuCtxSynchronize = win32api.GetProcAddress(handle, 'cuCtxSynchronize') + except: + pass + {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + try: + global __cuCtxSynchronize_v2 + __cuCtxSynchronize_v2 = win32api.GetProcAddress(handle, 'cuCtxSynchronize_v2') + except: + pass + {{endif}} + {{if 'cuCtxSetLimit' in found_functions}} + try: + global __cuCtxSetLimit + __cuCtxSetLimit = win32api.GetProcAddress(handle, 'cuCtxSetLimit') + except: + pass + {{endif}} + {{if 'cuCtxGetLimit' in found_functions}} + try: + global __cuCtxGetLimit + __cuCtxGetLimit = win32api.GetProcAddress(handle, 'cuCtxGetLimit') + except: + pass + {{endif}} + {{if 'cuCtxGetCacheConfig' in found_functions}} + try: + global __cuCtxGetCacheConfig + __cuCtxGetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxGetCacheConfig') + except: + pass + {{endif}} + {{if 'cuCtxSetCacheConfig' in found_functions}} + try: + global __cuCtxSetCacheConfig + __cuCtxSetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxSetCacheConfig') + except: + pass + {{endif}} + {{if 'cuCtxGetApiVersion' in found_functions}} + try: + global __cuCtxGetApiVersion + __cuCtxGetApiVersion = win32api.GetProcAddress(handle, 'cuCtxGetApiVersion') + except: + pass + {{endif}} + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + try: + global __cuCtxGetStreamPriorityRange + __cuCtxGetStreamPriorityRange = win32api.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') + except: + pass + {{endif}} + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + try: + global __cuCtxResetPersistingL2Cache + __cuCtxResetPersistingL2Cache = win32api.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') + except: + pass + {{endif}} + {{if 'cuCtxGetExecAffinity' in found_functions}} + try: + global __cuCtxGetExecAffinity + __cuCtxGetExecAffinity = win32api.GetProcAddress(handle, 'cuCtxGetExecAffinity') + except: + pass + {{endif}} + {{if 'cuCtxRecordEvent' in found_functions}} + try: + global __cuCtxRecordEvent + __cuCtxRecordEvent = win32api.GetProcAddress(handle, 'cuCtxRecordEvent') + except: + pass + {{endif}} + {{if 'cuCtxWaitEvent' in found_functions}} + try: + global __cuCtxWaitEvent + __cuCtxWaitEvent = win32api.GetProcAddress(handle, 'cuCtxWaitEvent') + except: + pass + {{endif}} + {{if 'cuCtxAttach' in found_functions}} + try: + global __cuCtxAttach + __cuCtxAttach = win32api.GetProcAddress(handle, 'cuCtxAttach') + except: + pass + {{endif}} + {{if 'cuCtxDetach' in found_functions}} + try: + global __cuCtxDetach + __cuCtxDetach = win32api.GetProcAddress(handle, 'cuCtxDetach') + except: + pass + {{endif}} + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + try: + global __cuCtxGetSharedMemConfig + __cuCtxGetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') + except: + pass + {{endif}} + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + try: + global __cuCtxSetSharedMemConfig + __cuCtxSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') + except: + pass + {{endif}} + {{if 'cuModuleLoad' in found_functions}} + try: + global __cuModuleLoad + __cuModuleLoad = win32api.GetProcAddress(handle, 'cuModuleLoad') + except: + pass + {{endif}} + {{if 'cuModuleLoadData' in found_functions}} + try: + global __cuModuleLoadData + __cuModuleLoadData = win32api.GetProcAddress(handle, 'cuModuleLoadData') + except: + pass + {{endif}} + {{if 'cuModuleLoadDataEx' in found_functions}} + try: + global __cuModuleLoadDataEx + __cuModuleLoadDataEx = win32api.GetProcAddress(handle, 'cuModuleLoadDataEx') + except: + pass + {{endif}} + {{if 'cuModuleLoadFatBinary' in found_functions}} + try: + global __cuModuleLoadFatBinary + __cuModuleLoadFatBinary = win32api.GetProcAddress(handle, 'cuModuleLoadFatBinary') + except: + pass + {{endif}} + {{if 'cuModuleUnload' in found_functions}} + try: + global __cuModuleUnload + __cuModuleUnload = win32api.GetProcAddress(handle, 'cuModuleUnload') + except: + pass + {{endif}} + {{if 'cuModuleGetLoadingMode' in found_functions}} + try: + global __cuModuleGetLoadingMode + __cuModuleGetLoadingMode = win32api.GetProcAddress(handle, 'cuModuleGetLoadingMode') + except: + pass + {{endif}} + {{if 'cuModuleGetFunction' in found_functions}} + try: + global __cuModuleGetFunction + __cuModuleGetFunction = win32api.GetProcAddress(handle, 'cuModuleGetFunction') + except: + pass + {{endif}} + {{if 'cuModuleGetFunctionCount' in found_functions}} + try: + global __cuModuleGetFunctionCount + __cuModuleGetFunctionCount = win32api.GetProcAddress(handle, 'cuModuleGetFunctionCount') + except: + pass + {{endif}} + {{if 'cuModuleEnumerateFunctions' in found_functions}} + try: + global __cuModuleEnumerateFunctions + __cuModuleEnumerateFunctions = win32api.GetProcAddress(handle, 'cuModuleEnumerateFunctions') + except: + pass + {{endif}} + {{if 'cuModuleGetGlobal_v2' in found_functions}} + try: + global __cuModuleGetGlobal_v2 + __cuModuleGetGlobal_v2 = win32api.GetProcAddress(handle, 'cuModuleGetGlobal_v2') + except: + pass + {{endif}} + {{if 'cuLinkCreate_v2' in found_functions}} + try: + global __cuLinkCreate_v2 + __cuLinkCreate_v2 = win32api.GetProcAddress(handle, 'cuLinkCreate_v2') + except: + pass + {{endif}} + {{if 'cuLinkAddData_v2' in found_functions}} + try: + global __cuLinkAddData_v2 + __cuLinkAddData_v2 = win32api.GetProcAddress(handle, 'cuLinkAddData_v2') + except: + pass + {{endif}} + {{if 'cuLinkAddFile_v2' in found_functions}} + try: + global __cuLinkAddFile_v2 + __cuLinkAddFile_v2 = win32api.GetProcAddress(handle, 'cuLinkAddFile_v2') + except: + pass + {{endif}} + {{if 'cuLinkComplete' in found_functions}} + try: + global __cuLinkComplete + __cuLinkComplete = win32api.GetProcAddress(handle, 'cuLinkComplete') + except: + pass + {{endif}} + {{if 'cuLinkDestroy' in found_functions}} + try: + global __cuLinkDestroy + __cuLinkDestroy = win32api.GetProcAddress(handle, 'cuLinkDestroy') + except: + pass + {{endif}} + {{if 'cuModuleGetTexRef' in found_functions}} + try: + global __cuModuleGetTexRef + __cuModuleGetTexRef = win32api.GetProcAddress(handle, 'cuModuleGetTexRef') + except: + pass + {{endif}} + {{if 'cuModuleGetSurfRef' in found_functions}} + try: + global __cuModuleGetSurfRef + __cuModuleGetSurfRef = win32api.GetProcAddress(handle, 'cuModuleGetSurfRef') + except: + pass + {{endif}} + {{if 'cuLibraryLoadData' in found_functions}} + try: + global __cuLibraryLoadData + __cuLibraryLoadData = win32api.GetProcAddress(handle, 'cuLibraryLoadData') + except: + pass + {{endif}} + {{if 'cuLibraryLoadFromFile' in found_functions}} + try: + global __cuLibraryLoadFromFile + __cuLibraryLoadFromFile = win32api.GetProcAddress(handle, 'cuLibraryLoadFromFile') + except: + pass + {{endif}} + {{if 'cuLibraryUnload' in found_functions}} + try: + global __cuLibraryUnload + __cuLibraryUnload = win32api.GetProcAddress(handle, 'cuLibraryUnload') + except: + pass + {{endif}} + {{if 'cuLibraryGetKernel' in found_functions}} + try: + global __cuLibraryGetKernel + __cuLibraryGetKernel = win32api.GetProcAddress(handle, 'cuLibraryGetKernel') + except: + pass + {{endif}} + {{if 'cuLibraryGetKernelCount' in found_functions}} + try: + global __cuLibraryGetKernelCount + __cuLibraryGetKernelCount = win32api.GetProcAddress(handle, 'cuLibraryGetKernelCount') + except: + pass + {{endif}} + {{if 'cuLibraryEnumerateKernels' in found_functions}} + try: + global __cuLibraryEnumerateKernels + __cuLibraryEnumerateKernels = win32api.GetProcAddress(handle, 'cuLibraryEnumerateKernels') + except: + pass + {{endif}} + {{if 'cuLibraryGetModule' in found_functions}} + try: + global __cuLibraryGetModule + __cuLibraryGetModule = win32api.GetProcAddress(handle, 'cuLibraryGetModule') + except: + pass + {{endif}} + {{if 'cuKernelGetFunction' in found_functions}} + try: + global __cuKernelGetFunction + __cuKernelGetFunction = win32api.GetProcAddress(handle, 'cuKernelGetFunction') + except: + pass + {{endif}} + {{if 'cuKernelGetLibrary' in found_functions}} + try: + global __cuKernelGetLibrary + __cuKernelGetLibrary = win32api.GetProcAddress(handle, 'cuKernelGetLibrary') + except: + pass + {{endif}} + {{if 'cuLibraryGetGlobal' in found_functions}} + try: + global __cuLibraryGetGlobal + __cuLibraryGetGlobal = win32api.GetProcAddress(handle, 'cuLibraryGetGlobal') + except: + pass + {{endif}} + {{if 'cuLibraryGetManaged' in found_functions}} + try: + global __cuLibraryGetManaged + __cuLibraryGetManaged = win32api.GetProcAddress(handle, 'cuLibraryGetManaged') + except: + pass + {{endif}} + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + try: + global __cuLibraryGetUnifiedFunction + __cuLibraryGetUnifiedFunction = win32api.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') + except: + pass + {{endif}} + {{if 'cuKernelGetAttribute' in found_functions}} + try: + global __cuKernelGetAttribute + __cuKernelGetAttribute = win32api.GetProcAddress(handle, 'cuKernelGetAttribute') + except: + pass + {{endif}} + {{if 'cuKernelSetAttribute' in found_functions}} + try: + global __cuKernelSetAttribute + __cuKernelSetAttribute = win32api.GetProcAddress(handle, 'cuKernelSetAttribute') + except: + pass + {{endif}} + {{if 'cuKernelSetCacheConfig' in found_functions}} + try: + global __cuKernelSetCacheConfig + __cuKernelSetCacheConfig = win32api.GetProcAddress(handle, 'cuKernelSetCacheConfig') + except: + pass + {{endif}} + {{if 'cuKernelGetName' in found_functions}} + try: + global __cuKernelGetName + __cuKernelGetName = win32api.GetProcAddress(handle, 'cuKernelGetName') + except: + pass + {{endif}} + {{if 'cuKernelGetParamInfo' in found_functions}} + try: + global __cuKernelGetParamInfo + __cuKernelGetParamInfo = win32api.GetProcAddress(handle, 'cuKernelGetParamInfo') + except: + pass + {{endif}} + {{if 'cuMemGetInfo_v2' in found_functions}} + try: + global __cuMemGetInfo_v2 + __cuMemGetInfo_v2 = win32api.GetProcAddress(handle, 'cuMemGetInfo_v2') + except: + pass + {{endif}} + {{if 'cuMemAlloc_v2' in found_functions}} + try: + global __cuMemAlloc_v2 + __cuMemAlloc_v2 = win32api.GetProcAddress(handle, 'cuMemAlloc_v2') + except: + pass + {{endif}} + {{if 'cuMemAllocPitch_v2' in found_functions}} + try: + global __cuMemAllocPitch_v2 + __cuMemAllocPitch_v2 = win32api.GetProcAddress(handle, 'cuMemAllocPitch_v2') + except: + pass + {{endif}} + {{if 'cuMemFree_v2' in found_functions}} + try: + global __cuMemFree_v2 + __cuMemFree_v2 = win32api.GetProcAddress(handle, 'cuMemFree_v2') + except: + pass + {{endif}} + {{if 'cuMemGetAddressRange_v2' in found_functions}} + try: + global __cuMemGetAddressRange_v2 + __cuMemGetAddressRange_v2 = win32api.GetProcAddress(handle, 'cuMemGetAddressRange_v2') + except: + pass + {{endif}} + {{if 'cuMemAllocHost_v2' in found_functions}} + try: + global __cuMemAllocHost_v2 + __cuMemAllocHost_v2 = win32api.GetProcAddress(handle, 'cuMemAllocHost_v2') + except: + pass + {{endif}} + {{if 'cuMemFreeHost' in found_functions}} + try: + global __cuMemFreeHost + __cuMemFreeHost = win32api.GetProcAddress(handle, 'cuMemFreeHost') + except: + pass + {{endif}} + {{if 'cuMemHostAlloc' in found_functions}} + try: + global __cuMemHostAlloc + __cuMemHostAlloc = win32api.GetProcAddress(handle, 'cuMemHostAlloc') + except: + pass + {{endif}} + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + try: + global __cuMemHostGetDevicePointer_v2 + __cuMemHostGetDevicePointer_v2 = win32api.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') + except: + pass + {{endif}} + {{if 'cuMemHostGetFlags' in found_functions}} + try: + global __cuMemHostGetFlags + __cuMemHostGetFlags = win32api.GetProcAddress(handle, 'cuMemHostGetFlags') + except: + pass + {{endif}} + {{if 'cuMemAllocManaged' in found_functions}} + try: + global __cuMemAllocManaged + __cuMemAllocManaged = win32api.GetProcAddress(handle, 'cuMemAllocManaged') + except: + pass + {{endif}} + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + try: + global __cuDeviceRegisterAsyncNotification + __cuDeviceRegisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') + except: + pass + {{endif}} + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + try: + global __cuDeviceUnregisterAsyncNotification + __cuDeviceUnregisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') + except: + pass + {{endif}} + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + try: + global __cuDeviceGetByPCIBusId + __cuDeviceGetByPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') + except: + pass + {{endif}} + {{if 'cuDeviceGetPCIBusId' in found_functions}} + try: + global __cuDeviceGetPCIBusId + __cuDeviceGetPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetPCIBusId') + except: + pass + {{endif}} + {{if 'cuIpcGetEventHandle' in found_functions}} + try: + global __cuIpcGetEventHandle + __cuIpcGetEventHandle = win32api.GetProcAddress(handle, 'cuIpcGetEventHandle') + except: + pass + {{endif}} + {{if 'cuIpcOpenEventHandle' in found_functions}} + try: + global __cuIpcOpenEventHandle + __cuIpcOpenEventHandle = win32api.GetProcAddress(handle, 'cuIpcOpenEventHandle') + except: + pass + {{endif}} + {{if 'cuIpcGetMemHandle' in found_functions}} + try: + global __cuIpcGetMemHandle + __cuIpcGetMemHandle = win32api.GetProcAddress(handle, 'cuIpcGetMemHandle') + except: + pass + {{endif}} + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + try: + global __cuIpcOpenMemHandle_v2 + __cuIpcOpenMemHandle_v2 = win32api.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') + except: + pass + {{endif}} + {{if 'cuIpcCloseMemHandle' in found_functions}} + try: + global __cuIpcCloseMemHandle + __cuIpcCloseMemHandle = win32api.GetProcAddress(handle, 'cuIpcCloseMemHandle') + except: + pass + {{endif}} + {{if 'cuMemHostRegister_v2' in found_functions}} + try: + global __cuMemHostRegister_v2 + __cuMemHostRegister_v2 = win32api.GetProcAddress(handle, 'cuMemHostRegister_v2') + except: + pass + {{endif}} + {{if 'cuMemHostUnregister' in found_functions}} + try: + global __cuMemHostUnregister + __cuMemHostUnregister = win32api.GetProcAddress(handle, 'cuMemHostUnregister') + except: + pass + {{endif}} + {{if 'cuArrayCreate_v2' in found_functions}} + try: + global __cuArrayCreate_v2 + __cuArrayCreate_v2 = win32api.GetProcAddress(handle, 'cuArrayCreate_v2') + except: + pass + {{endif}} + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + try: + global __cuArrayGetDescriptor_v2 + __cuArrayGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') + except: + pass + {{endif}} + {{if 'cuArrayGetSparseProperties' in found_functions}} + try: + global __cuArrayGetSparseProperties + __cuArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuArrayGetSparseProperties') + except: + pass + {{endif}} + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + try: + global __cuMipmappedArrayGetSparseProperties + __cuMipmappedArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') + except: + pass + {{endif}} + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + try: + global __cuArrayGetMemoryRequirements + __cuArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') + except: + pass + {{endif}} + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + try: + global __cuMipmappedArrayGetMemoryRequirements + __cuMipmappedArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') + except: + pass + {{endif}} + {{if 'cuArrayGetPlane' in found_functions}} + try: + global __cuArrayGetPlane + __cuArrayGetPlane = win32api.GetProcAddress(handle, 'cuArrayGetPlane') + except: + pass + {{endif}} + {{if 'cuArrayDestroy' in found_functions}} + try: + global __cuArrayDestroy + __cuArrayDestroy = win32api.GetProcAddress(handle, 'cuArrayDestroy') + except: + pass + {{endif}} + {{if 'cuArray3DCreate_v2' in found_functions}} + try: + global __cuArray3DCreate_v2 + __cuArray3DCreate_v2 = win32api.GetProcAddress(handle, 'cuArray3DCreate_v2') + except: + pass + {{endif}} + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + try: + global __cuArray3DGetDescriptor_v2 + __cuArray3DGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') + except: + pass + {{endif}} + {{if 'cuMipmappedArrayCreate' in found_functions}} + try: + global __cuMipmappedArrayCreate + __cuMipmappedArrayCreate = win32api.GetProcAddress(handle, 'cuMipmappedArrayCreate') + except: + pass + {{endif}} + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + try: + global __cuMipmappedArrayGetLevel + __cuMipmappedArrayGetLevel = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') + except: + pass + {{endif}} + {{if 'cuMipmappedArrayDestroy' in found_functions}} + try: + global __cuMipmappedArrayDestroy + __cuMipmappedArrayDestroy = win32api.GetProcAddress(handle, 'cuMipmappedArrayDestroy') + except: + pass + {{endif}} + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + try: + global __cuMemGetHandleForAddressRange + __cuMemGetHandleForAddressRange = win32api.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') + except: + pass + {{endif}} + {{if 'cuMemAddressReserve' in found_functions}} + try: + global __cuMemAddressReserve + __cuMemAddressReserve = win32api.GetProcAddress(handle, 'cuMemAddressReserve') + except: + pass + {{endif}} + {{if 'cuMemAddressFree' in found_functions}} + try: + global __cuMemAddressFree + __cuMemAddressFree = win32api.GetProcAddress(handle, 'cuMemAddressFree') + except: + pass + {{endif}} + {{if 'cuMemCreate' in found_functions}} + try: + global __cuMemCreate + __cuMemCreate = win32api.GetProcAddress(handle, 'cuMemCreate') + except: + pass + {{endif}} + {{if 'cuMemRelease' in found_functions}} + try: + global __cuMemRelease + __cuMemRelease = win32api.GetProcAddress(handle, 'cuMemRelease') + except: + pass + {{endif}} + {{if 'cuMemMap' in found_functions}} + try: + global __cuMemMap + __cuMemMap = win32api.GetProcAddress(handle, 'cuMemMap') + except: + pass + {{endif}} + {{if 'cuMemUnmap' in found_functions}} + try: + global __cuMemUnmap + __cuMemUnmap = win32api.GetProcAddress(handle, 'cuMemUnmap') + except: + pass + {{endif}} + {{if 'cuMemSetAccess' in found_functions}} + try: + global __cuMemSetAccess + __cuMemSetAccess = win32api.GetProcAddress(handle, 'cuMemSetAccess') + except: + pass + {{endif}} + {{if 'cuMemGetAccess' in found_functions}} + try: + global __cuMemGetAccess + __cuMemGetAccess = win32api.GetProcAddress(handle, 'cuMemGetAccess') + except: + pass + {{endif}} + {{if 'cuMemExportToShareableHandle' in found_functions}} + try: + global __cuMemExportToShareableHandle + __cuMemExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemExportToShareableHandle') + except: + pass + {{endif}} + {{if 'cuMemImportFromShareableHandle' in found_functions}} + try: + global __cuMemImportFromShareableHandle + __cuMemImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemImportFromShareableHandle') + except: + pass + {{endif}} + {{if 'cuMemGetAllocationGranularity' in found_functions}} + try: + global __cuMemGetAllocationGranularity + __cuMemGetAllocationGranularity = win32api.GetProcAddress(handle, 'cuMemGetAllocationGranularity') + except: + pass + {{endif}} + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + try: + global __cuMemGetAllocationPropertiesFromHandle + __cuMemGetAllocationPropertiesFromHandle = win32api.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') + except: + pass + {{endif}} + {{if 'cuMemRetainAllocationHandle' in found_functions}} + try: + global __cuMemRetainAllocationHandle + __cuMemRetainAllocationHandle = win32api.GetProcAddress(handle, 'cuMemRetainAllocationHandle') + except: + pass + {{endif}} + {{if 'cuMemPoolTrimTo' in found_functions}} + try: + global __cuMemPoolTrimTo + __cuMemPoolTrimTo = win32api.GetProcAddress(handle, 'cuMemPoolTrimTo') + except: + pass + {{endif}} + {{if 'cuMemPoolSetAttribute' in found_functions}} + try: + global __cuMemPoolSetAttribute + __cuMemPoolSetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolSetAttribute') + except: + pass + {{endif}} + {{if 'cuMemPoolGetAttribute' in found_functions}} + try: + global __cuMemPoolGetAttribute + __cuMemPoolGetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolGetAttribute') + except: + pass + {{endif}} + {{if 'cuMemPoolSetAccess' in found_functions}} + try: + global __cuMemPoolSetAccess + __cuMemPoolSetAccess = win32api.GetProcAddress(handle, 'cuMemPoolSetAccess') + except: + pass + {{endif}} + {{if 'cuMemPoolGetAccess' in found_functions}} + try: + global __cuMemPoolGetAccess + __cuMemPoolGetAccess = win32api.GetProcAddress(handle, 'cuMemPoolGetAccess') + except: + pass + {{endif}} + {{if 'cuMemPoolCreate' in found_functions}} + try: + global __cuMemPoolCreate + __cuMemPoolCreate = win32api.GetProcAddress(handle, 'cuMemPoolCreate') + except: + pass + {{endif}} + {{if 'cuMemPoolDestroy' in found_functions}} + try: + global __cuMemPoolDestroy + __cuMemPoolDestroy = win32api.GetProcAddress(handle, 'cuMemPoolDestroy') + except: + pass + {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + try: + global __cuMemGetDefaultMemPool + __cuMemGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuMemGetDefaultMemPool') + except: + pass + {{endif}} + {{if 'cuMemGetMemPool' in found_functions}} + try: + global __cuMemGetMemPool + __cuMemGetMemPool = win32api.GetProcAddress(handle, 'cuMemGetMemPool') + except: + pass + {{endif}} + {{if 'cuMemSetMemPool' in found_functions}} + try: + global __cuMemSetMemPool + __cuMemSetMemPool = win32api.GetProcAddress(handle, 'cuMemSetMemPool') + except: + pass + {{endif}} + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + try: + global __cuMemPoolExportToShareableHandle + __cuMemPoolExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') + except: + pass + {{endif}} + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + try: + global __cuMemPoolImportFromShareableHandle + __cuMemPoolImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') + except: + pass + {{endif}} + {{if 'cuMemPoolExportPointer' in found_functions}} + try: + global __cuMemPoolExportPointer + __cuMemPoolExportPointer = win32api.GetProcAddress(handle, 'cuMemPoolExportPointer') + except: + pass + {{endif}} + {{if 'cuMemPoolImportPointer' in found_functions}} + try: + global __cuMemPoolImportPointer + __cuMemPoolImportPointer = win32api.GetProcAddress(handle, 'cuMemPoolImportPointer') + except: + pass + {{endif}} + {{if 'cuMulticastCreate' in found_functions}} + try: + global __cuMulticastCreate + __cuMulticastCreate = win32api.GetProcAddress(handle, 'cuMulticastCreate') + except: + pass + {{endif}} + {{if 'cuMulticastAddDevice' in found_functions}} + try: + global __cuMulticastAddDevice + __cuMulticastAddDevice = win32api.GetProcAddress(handle, 'cuMulticastAddDevice') + except: + pass + {{endif}} + {{if 'cuMulticastBindMem' in found_functions}} + try: + global __cuMulticastBindMem + __cuMulticastBindMem = win32api.GetProcAddress(handle, 'cuMulticastBindMem') + except: + pass + {{endif}} + {{if 'cuMulticastBindAddr' in found_functions}} + try: + global __cuMulticastBindAddr + __cuMulticastBindAddr = win32api.GetProcAddress(handle, 'cuMulticastBindAddr') + except: + pass + {{endif}} + {{if 'cuMulticastUnbind' in found_functions}} + try: + global __cuMulticastUnbind + __cuMulticastUnbind = win32api.GetProcAddress(handle, 'cuMulticastUnbind') + except: + pass + {{endif}} + {{if 'cuMulticastGetGranularity' in found_functions}} + try: + global __cuMulticastGetGranularity + __cuMulticastGetGranularity = win32api.GetProcAddress(handle, 'cuMulticastGetGranularity') + except: + pass + {{endif}} + {{if 'cuPointerGetAttribute' in found_functions}} + try: + global __cuPointerGetAttribute + __cuPointerGetAttribute = win32api.GetProcAddress(handle, 'cuPointerGetAttribute') + except: + pass + {{endif}} + {{if 'cuMemAdvise_v2' in found_functions}} + try: + global __cuMemAdvise_v2 + __cuMemAdvise_v2 = win32api.GetProcAddress(handle, 'cuMemAdvise_v2') + except: + pass + {{endif}} + {{if 'cuMemRangeGetAttribute' in found_functions}} + try: + global __cuMemRangeGetAttribute + __cuMemRangeGetAttribute = win32api.GetProcAddress(handle, 'cuMemRangeGetAttribute') + except: + pass + {{endif}} + {{if 'cuMemRangeGetAttributes' in found_functions}} + try: + global __cuMemRangeGetAttributes + __cuMemRangeGetAttributes = win32api.GetProcAddress(handle, 'cuMemRangeGetAttributes') + except: + pass + {{endif}} + {{if 'cuPointerSetAttribute' in found_functions}} + try: + global __cuPointerSetAttribute + __cuPointerSetAttribute = win32api.GetProcAddress(handle, 'cuPointerSetAttribute') + except: + pass + {{endif}} + {{if 'cuPointerGetAttributes' in found_functions}} + try: + global __cuPointerGetAttributes + __cuPointerGetAttributes = win32api.GetProcAddress(handle, 'cuPointerGetAttributes') + except: + pass + {{endif}} + {{if 'cuStreamCreate' in found_functions}} + try: + global __cuStreamCreate + __cuStreamCreate = win32api.GetProcAddress(handle, 'cuStreamCreate') + except: + pass + {{endif}} + {{if 'cuStreamCreateWithPriority' in found_functions}} + try: + global __cuStreamCreateWithPriority + __cuStreamCreateWithPriority = win32api.GetProcAddress(handle, 'cuStreamCreateWithPriority') + except: + pass + {{endif}} + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + try: + global __cuThreadExchangeStreamCaptureMode + __cuThreadExchangeStreamCaptureMode = win32api.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') + except: + pass + {{endif}} + {{if 'cuStreamDestroy_v2' in found_functions}} + try: + global __cuStreamDestroy_v2 + __cuStreamDestroy_v2 = win32api.GetProcAddress(handle, 'cuStreamDestroy_v2') + except: + pass + {{endif}} + {{if 'cuEventCreate' in found_functions}} + try: + global __cuEventCreate + __cuEventCreate = win32api.GetProcAddress(handle, 'cuEventCreate') + except: + pass + {{endif}} + {{if 'cuEventQuery' in found_functions}} + try: + global __cuEventQuery + __cuEventQuery = win32api.GetProcAddress(handle, 'cuEventQuery') + except: + pass + {{endif}} + {{if 'cuEventSynchronize' in found_functions}} + try: + global __cuEventSynchronize + __cuEventSynchronize = win32api.GetProcAddress(handle, 'cuEventSynchronize') + except: + pass + {{endif}} + {{if 'cuEventDestroy_v2' in found_functions}} + try: + global __cuEventDestroy_v2 + __cuEventDestroy_v2 = win32api.GetProcAddress(handle, 'cuEventDestroy_v2') + except: + pass + {{endif}} + {{if 'cuEventElapsedTime_v2' in found_functions}} + try: + global __cuEventElapsedTime_v2 + __cuEventElapsedTime_v2 = win32api.GetProcAddress(handle, 'cuEventElapsedTime_v2') + except: + pass + {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + try: + global __cuImportExternalMemory + __cuImportExternalMemory = win32api.GetProcAddress(handle, 'cuImportExternalMemory') + except: + pass + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + try: + global __cuExternalMemoryGetMappedBuffer + __cuExternalMemoryGetMappedBuffer = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') + except: + pass + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + try: + global __cuExternalMemoryGetMappedMipmappedArray + __cuExternalMemoryGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') + except: + pass + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + try: + global __cuDestroyExternalMemory + __cuDestroyExternalMemory = win32api.GetProcAddress(handle, 'cuDestroyExternalMemory') + except: + pass + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + try: + global __cuImportExternalSemaphore + __cuImportExternalSemaphore = win32api.GetProcAddress(handle, 'cuImportExternalSemaphore') + except: + pass + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + try: + global __cuDestroyExternalSemaphore + __cuDestroyExternalSemaphore = win32api.GetProcAddress(handle, 'cuDestroyExternalSemaphore') + except: + pass + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + try: + global __cuFuncGetAttribute + __cuFuncGetAttribute = win32api.GetProcAddress(handle, 'cuFuncGetAttribute') + except: + pass + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + try: + global __cuFuncSetAttribute + __cuFuncSetAttribute = win32api.GetProcAddress(handle, 'cuFuncSetAttribute') + except: + pass + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + try: + global __cuFuncSetCacheConfig + __cuFuncSetCacheConfig = win32api.GetProcAddress(handle, 'cuFuncSetCacheConfig') + except: + pass + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + try: + global __cuFuncGetModule + __cuFuncGetModule = win32api.GetProcAddress(handle, 'cuFuncGetModule') + except: + pass + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + try: + global __cuFuncGetName + __cuFuncGetName = win32api.GetProcAddress(handle, 'cuFuncGetName') + except: + pass + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + try: + global __cuFuncGetParamInfo + __cuFuncGetParamInfo = win32api.GetProcAddress(handle, 'cuFuncGetParamInfo') + except: + pass + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + try: + global __cuFuncIsLoaded + __cuFuncIsLoaded = win32api.GetProcAddress(handle, 'cuFuncIsLoaded') + except: + pass + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + try: + global __cuFuncLoad + __cuFuncLoad = win32api.GetProcAddress(handle, 'cuFuncLoad') + except: + pass + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + try: + global __cuLaunchCooperativeKernelMultiDevice + __cuLaunchCooperativeKernelMultiDevice = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') + except: + pass + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + try: + global __cuFuncSetBlockShape + __cuFuncSetBlockShape = win32api.GetProcAddress(handle, 'cuFuncSetBlockShape') + except: + pass + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + try: + global __cuFuncSetSharedSize + __cuFuncSetSharedSize = win32api.GetProcAddress(handle, 'cuFuncSetSharedSize') + except: + pass + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + try: + global __cuParamSetSize + __cuParamSetSize = win32api.GetProcAddress(handle, 'cuParamSetSize') + except: + pass + {{endif}} + {{if 'cuParamSeti' in found_functions}} + try: + global __cuParamSeti + __cuParamSeti = win32api.GetProcAddress(handle, 'cuParamSeti') + except: + pass + {{endif}} + {{if 'cuParamSetf' in found_functions}} + try: + global __cuParamSetf + __cuParamSetf = win32api.GetProcAddress(handle, 'cuParamSetf') + except: + pass + {{endif}} + {{if 'cuParamSetv' in found_functions}} + try: + global __cuParamSetv + __cuParamSetv = win32api.GetProcAddress(handle, 'cuParamSetv') + except: + pass + {{endif}} + {{if 'cuLaunch' in found_functions}} + try: + global __cuLaunch + __cuLaunch = win32api.GetProcAddress(handle, 'cuLaunch') + except: + pass + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + try: + global __cuLaunchGrid + __cuLaunchGrid = win32api.GetProcAddress(handle, 'cuLaunchGrid') + except: + pass + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + try: + global __cuLaunchGridAsync + __cuLaunchGridAsync = win32api.GetProcAddress(handle, 'cuLaunchGridAsync') + except: + pass + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + try: + global __cuParamSetTexRef + __cuParamSetTexRef = win32api.GetProcAddress(handle, 'cuParamSetTexRef') + except: + pass + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + try: + global __cuFuncSetSharedMemConfig + __cuFuncSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') + except: + pass + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + try: + global __cuGraphCreate + __cuGraphCreate = win32api.GetProcAddress(handle, 'cuGraphCreate') + except: + pass + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + try: + global __cuGraphAddKernelNode_v2 + __cuGraphAddKernelNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') + except: + pass + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + try: + global __cuGraphKernelNodeGetParams_v2 + __cuGraphKernelNodeGetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') + except: + pass + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + try: + global __cuGraphKernelNodeSetParams_v2 + __cuGraphKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') + except: + pass + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + try: + global __cuGraphAddMemcpyNode + __cuGraphAddMemcpyNode = win32api.GetProcAddress(handle, 'cuGraphAddMemcpyNode') + except: + pass + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + try: + global __cuGraphMemcpyNodeGetParams + __cuGraphMemcpyNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + try: + global __cuGraphMemcpyNodeSetParams + __cuGraphMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + try: + global __cuGraphAddMemsetNode + __cuGraphAddMemsetNode = win32api.GetProcAddress(handle, 'cuGraphAddMemsetNode') + except: + pass + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + try: + global __cuGraphMemsetNodeGetParams + __cuGraphMemsetNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + try: + global __cuGraphMemsetNodeSetParams + __cuGraphMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + try: + global __cuGraphAddHostNode + __cuGraphAddHostNode = win32api.GetProcAddress(handle, 'cuGraphAddHostNode') + except: + pass + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + try: + global __cuGraphHostNodeGetParams + __cuGraphHostNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + try: + global __cuGraphHostNodeSetParams + __cuGraphHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + try: + global __cuGraphAddChildGraphNode + __cuGraphAddChildGraphNode = win32api.GetProcAddress(handle, 'cuGraphAddChildGraphNode') + except: + pass + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + try: + global __cuGraphChildGraphNodeGetGraph + __cuGraphChildGraphNodeGetGraph = win32api.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') + except: + pass + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + try: + global __cuGraphAddEmptyNode + __cuGraphAddEmptyNode = win32api.GetProcAddress(handle, 'cuGraphAddEmptyNode') + except: + pass + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + try: + global __cuGraphAddEventRecordNode + __cuGraphAddEventRecordNode = win32api.GetProcAddress(handle, 'cuGraphAddEventRecordNode') + except: + pass + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + try: + global __cuGraphEventRecordNodeGetEvent + __cuGraphEventRecordNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') + except: + pass + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + try: + global __cuGraphEventRecordNodeSetEvent + __cuGraphEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') + except: + pass + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + try: + global __cuGraphAddEventWaitNode + __cuGraphAddEventWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddEventWaitNode') + except: + pass + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + try: + global __cuGraphEventWaitNodeGetEvent + __cuGraphEventWaitNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') + except: + pass + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + try: + global __cuGraphEventWaitNodeSetEvent + __cuGraphEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') + except: + pass + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + try: + global __cuGraphAddExternalSemaphoresSignalNode + __cuGraphAddExternalSemaphoresSignalNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') + except: + pass + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + try: + global __cuGraphExternalSemaphoresSignalNodeGetParams + __cuGraphExternalSemaphoresSignalNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + try: + global __cuGraphExternalSemaphoresSignalNodeSetParams + __cuGraphExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + try: + global __cuGraphAddExternalSemaphoresWaitNode + __cuGraphAddExternalSemaphoresWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') + except: + pass + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + try: + global __cuGraphExternalSemaphoresWaitNodeGetParams + __cuGraphExternalSemaphoresWaitNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + try: + global __cuGraphExternalSemaphoresWaitNodeSetParams + __cuGraphExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + try: + global __cuGraphAddBatchMemOpNode + __cuGraphAddBatchMemOpNode = win32api.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') + except: + pass + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + try: + global __cuGraphBatchMemOpNodeGetParams + __cuGraphBatchMemOpNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + try: + global __cuGraphBatchMemOpNodeSetParams + __cuGraphBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + try: + global __cuGraphExecBatchMemOpNodeSetParams + __cuGraphExecBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + try: + global __cuGraphAddMemAllocNode + __cuGraphAddMemAllocNode = win32api.GetProcAddress(handle, 'cuGraphAddMemAllocNode') + except: + pass + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + try: + global __cuGraphMemAllocNodeGetParams + __cuGraphMemAllocNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') + except: + pass + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + try: + global __cuGraphAddMemFreeNode + __cuGraphAddMemFreeNode = win32api.GetProcAddress(handle, 'cuGraphAddMemFreeNode') + except: + pass + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + try: + global __cuGraphMemFreeNodeGetParams + __cuGraphMemFreeNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') + except: + pass + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + try: + global __cuDeviceGraphMemTrim + __cuDeviceGraphMemTrim = win32api.GetProcAddress(handle, 'cuDeviceGraphMemTrim') + except: + pass + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + try: + global __cuDeviceGetGraphMemAttribute + __cuDeviceGetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') + except: + pass + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + try: + global __cuDeviceSetGraphMemAttribute + __cuDeviceSetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') + except: + pass + {{endif}} + {{if 'cuGraphClone' in found_functions}} + try: + global __cuGraphClone + __cuGraphClone = win32api.GetProcAddress(handle, 'cuGraphClone') + except: + pass + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + try: + global __cuGraphNodeFindInClone + __cuGraphNodeFindInClone = win32api.GetProcAddress(handle, 'cuGraphNodeFindInClone') + except: + pass + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + try: + global __cuGraphNodeGetType + __cuGraphNodeGetType = win32api.GetProcAddress(handle, 'cuGraphNodeGetType') + except: + pass + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + try: + global __cuGraphGetNodes + __cuGraphGetNodes = win32api.GetProcAddress(handle, 'cuGraphGetNodes') + except: + pass + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + try: + global __cuGraphGetRootNodes + __cuGraphGetRootNodes = win32api.GetProcAddress(handle, 'cuGraphGetRootNodes') + except: + pass + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + try: + global __cuGraphGetEdges_v2 + __cuGraphGetEdges_v2 = win32api.GetProcAddress(handle, 'cuGraphGetEdges_v2') + except: + pass + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + try: + global __cuGraphNodeGetDependencies_v2 + __cuGraphNodeGetDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') + except: + pass + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + try: + global __cuGraphNodeGetDependentNodes_v2 + __cuGraphNodeGetDependentNodes_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') + except: + pass + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + try: + global __cuGraphAddDependencies_v2 + __cuGraphAddDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphAddDependencies_v2') + except: + pass + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + try: + global __cuGraphRemoveDependencies_v2 + __cuGraphRemoveDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') + except: + pass + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + try: + global __cuGraphDestroyNode + __cuGraphDestroyNode = win32api.GetProcAddress(handle, 'cuGraphDestroyNode') + except: + pass + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + try: + global __cuGraphInstantiateWithFlags + __cuGraphInstantiateWithFlags = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') + except: + pass + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + try: + global __cuGraphExecGetFlags + __cuGraphExecGetFlags = win32api.GetProcAddress(handle, 'cuGraphExecGetFlags') + except: + pass + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + try: + global __cuGraphExecKernelNodeSetParams_v2 + __cuGraphExecKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') + except: + pass + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + try: + global __cuGraphExecMemcpyNodeSetParams + __cuGraphExecMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + try: + global __cuGraphExecMemsetNodeSetParams + __cuGraphExecMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + try: + global __cuGraphExecHostNodeSetParams + __cuGraphExecHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + try: + global __cuGraphExecChildGraphNodeSetParams + __cuGraphExecChildGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + try: + global __cuGraphExecEventRecordNodeSetEvent + __cuGraphExecEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') + except: + pass + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + try: + global __cuGraphExecEventWaitNodeSetEvent + __cuGraphExecEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') + except: + pass + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + try: + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + __cuGraphExecExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + try: + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + __cuGraphExecExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + try: + global __cuGraphNodeSetEnabled + __cuGraphNodeSetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeSetEnabled') + except: + pass + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + try: + global __cuGraphNodeGetEnabled + __cuGraphNodeGetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeGetEnabled') + except: + pass + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + try: + global __cuGraphExecDestroy + __cuGraphExecDestroy = win32api.GetProcAddress(handle, 'cuGraphExecDestroy') + except: + pass + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + try: + global __cuGraphDestroy + __cuGraphDestroy = win32api.GetProcAddress(handle, 'cuGraphDestroy') + except: + pass + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + try: + global __cuGraphExecUpdate_v2 + __cuGraphExecUpdate_v2 = win32api.GetProcAddress(handle, 'cuGraphExecUpdate_v2') + except: + pass + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + try: + global __cuGraphKernelNodeCopyAttributes + __cuGraphKernelNodeCopyAttributes = win32api.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') + except: + pass + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + try: + global __cuGraphKernelNodeGetAttribute + __cuGraphKernelNodeGetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') + except: + pass + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + try: + global __cuGraphKernelNodeSetAttribute + __cuGraphKernelNodeSetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') + except: + pass + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + try: + global __cuGraphDebugDotPrint + __cuGraphDebugDotPrint = win32api.GetProcAddress(handle, 'cuGraphDebugDotPrint') + except: + pass + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + try: + global __cuUserObjectCreate + __cuUserObjectCreate = win32api.GetProcAddress(handle, 'cuUserObjectCreate') + except: + pass + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + try: + global __cuUserObjectRetain + __cuUserObjectRetain = win32api.GetProcAddress(handle, 'cuUserObjectRetain') + except: + pass + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + try: + global __cuUserObjectRelease + __cuUserObjectRelease = win32api.GetProcAddress(handle, 'cuUserObjectRelease') + except: + pass + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + try: + global __cuGraphRetainUserObject + __cuGraphRetainUserObject = win32api.GetProcAddress(handle, 'cuGraphRetainUserObject') + except: + pass + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + try: + global __cuGraphReleaseUserObject + __cuGraphReleaseUserObject = win32api.GetProcAddress(handle, 'cuGraphReleaseUserObject') + except: + pass + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + try: + global __cuGraphAddNode_v2 + __cuGraphAddNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddNode_v2') + except: + pass + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + try: + global __cuGraphNodeSetParams + __cuGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + try: + global __cuGraphExecNodeSetParams + __cuGraphExecNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecNodeSetParams') + except: + pass + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + try: + global __cuGraphConditionalHandleCreate + __cuGraphConditionalHandleCreate = win32api.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + try: + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + __cuOccupancyMaxActiveBlocksPerMultiprocessor = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + try: + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + try: + global __cuOccupancyMaxPotentialBlockSize + __cuOccupancyMaxPotentialBlockSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + try: + global __cuOccupancyMaxPotentialBlockSizeWithFlags + __cuOccupancyMaxPotentialBlockSizeWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') + except: + pass + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + try: + global __cuOccupancyAvailableDynamicSMemPerBlock + __cuOccupancyAvailableDynamicSMemPerBlock = win32api.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + try: + global __cuOccupancyMaxPotentialClusterSize + __cuOccupancyMaxPotentialClusterSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') + except: + pass + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + try: + global __cuOccupancyMaxActiveClusters + __cuOccupancyMaxActiveClusters = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') + except: + pass + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + try: + global __cuTexRefSetArray + __cuTexRefSetArray = win32api.GetProcAddress(handle, 'cuTexRefSetArray') + except: + pass + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + try: + global __cuTexRefSetMipmappedArray + __cuTexRefSetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') + except: + pass + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + try: + global __cuTexRefSetAddress_v2 + __cuTexRefSetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress_v2') + except: + pass + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + try: + global __cuTexRefSetAddress2D_v3 + __cuTexRefSetAddress2D_v3 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') + except: + pass + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + try: + global __cuTexRefSetFormat + __cuTexRefSetFormat = win32api.GetProcAddress(handle, 'cuTexRefSetFormat') + except: + pass + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + try: + global __cuTexRefSetAddressMode + __cuTexRefSetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefSetAddressMode') + except: + pass + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + try: + global __cuTexRefSetFilterMode + __cuTexRefSetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetFilterMode') + except: + pass + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + try: + global __cuTexRefSetMipmapFilterMode + __cuTexRefSetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') + except: + pass + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + try: + global __cuTexRefSetMipmapLevelBias + __cuTexRefSetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') + except: + pass + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + try: + global __cuTexRefSetMipmapLevelClamp + __cuTexRefSetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') + except: + pass + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + try: + global __cuTexRefSetMaxAnisotropy + __cuTexRefSetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') + except: + pass + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + try: + global __cuTexRefSetBorderColor + __cuTexRefSetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefSetBorderColor') + except: + pass + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + try: + global __cuTexRefSetFlags + __cuTexRefSetFlags = win32api.GetProcAddress(handle, 'cuTexRefSetFlags') + except: + pass + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + try: + global __cuTexRefGetAddress_v2 + __cuTexRefGetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefGetAddress_v2') + except: + pass + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + try: + global __cuTexRefGetArray + __cuTexRefGetArray = win32api.GetProcAddress(handle, 'cuTexRefGetArray') + except: + pass + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + try: + global __cuTexRefGetMipmappedArray + __cuTexRefGetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') + except: + pass + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + try: + global __cuTexRefGetAddressMode + __cuTexRefGetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefGetAddressMode') + except: + pass + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + try: + global __cuTexRefGetFilterMode + __cuTexRefGetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetFilterMode') + except: + pass + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + try: + global __cuTexRefGetFormat + __cuTexRefGetFormat = win32api.GetProcAddress(handle, 'cuTexRefGetFormat') + except: + pass + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + try: + global __cuTexRefGetMipmapFilterMode + __cuTexRefGetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') + except: + pass + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + try: + global __cuTexRefGetMipmapLevelBias + __cuTexRefGetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') + except: + pass + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + try: + global __cuTexRefGetMipmapLevelClamp + __cuTexRefGetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') + except: + pass + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + try: + global __cuTexRefGetMaxAnisotropy + __cuTexRefGetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') + except: + pass + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + try: + global __cuTexRefGetBorderColor + __cuTexRefGetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefGetBorderColor') + except: + pass + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + try: + global __cuTexRefGetFlags + __cuTexRefGetFlags = win32api.GetProcAddress(handle, 'cuTexRefGetFlags') + except: + pass + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + try: + global __cuTexRefCreate + __cuTexRefCreate = win32api.GetProcAddress(handle, 'cuTexRefCreate') + except: + pass + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + try: + global __cuTexRefDestroy + __cuTexRefDestroy = win32api.GetProcAddress(handle, 'cuTexRefDestroy') + except: + pass + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + try: + global __cuSurfRefSetArray + __cuSurfRefSetArray = win32api.GetProcAddress(handle, 'cuSurfRefSetArray') + except: + pass + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + try: + global __cuSurfRefGetArray + __cuSurfRefGetArray = win32api.GetProcAddress(handle, 'cuSurfRefGetArray') + except: + pass + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + try: + global __cuTexObjectCreate + __cuTexObjectCreate = win32api.GetProcAddress(handle, 'cuTexObjectCreate') + except: + pass + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + try: + global __cuTexObjectDestroy + __cuTexObjectDestroy = win32api.GetProcAddress(handle, 'cuTexObjectDestroy') + except: + pass + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + try: + global __cuTexObjectGetResourceDesc + __cuTexObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') + except: + pass + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + try: + global __cuTexObjectGetTextureDesc + __cuTexObjectGetTextureDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') + except: + pass + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + try: + global __cuTexObjectGetResourceViewDesc + __cuTexObjectGetResourceViewDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') + except: + pass + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + try: + global __cuSurfObjectCreate + __cuSurfObjectCreate = win32api.GetProcAddress(handle, 'cuSurfObjectCreate') + except: + pass + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + try: + global __cuSurfObjectDestroy + __cuSurfObjectDestroy = win32api.GetProcAddress(handle, 'cuSurfObjectDestroy') + except: + pass + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + try: + global __cuSurfObjectGetResourceDesc + __cuSurfObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') + except: + pass + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + try: + global __cuTensorMapEncodeTiled + __cuTensorMapEncodeTiled = win32api.GetProcAddress(handle, 'cuTensorMapEncodeTiled') + except: + pass + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + try: + global __cuTensorMapEncodeIm2col + __cuTensorMapEncodeIm2col = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') + except: + pass + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + try: + global __cuTensorMapEncodeIm2colWide + __cuTensorMapEncodeIm2colWide = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') + except: + pass + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + try: + global __cuTensorMapReplaceAddress + __cuTensorMapReplaceAddress = win32api.GetProcAddress(handle, 'cuTensorMapReplaceAddress') + except: + pass + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + try: + global __cuDeviceCanAccessPeer + __cuDeviceCanAccessPeer = win32api.GetProcAddress(handle, 'cuDeviceCanAccessPeer') + except: + pass + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + try: + global __cuCtxEnablePeerAccess + __cuCtxEnablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxEnablePeerAccess') + except: + pass + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + try: + global __cuCtxDisablePeerAccess + __cuCtxDisablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxDisablePeerAccess') + except: + pass + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + try: + global __cuDeviceGetP2PAttribute + __cuDeviceGetP2PAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') + except: + pass + {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + try: + global __cuDeviceGetP2PAtomicCapabilities + __cuDeviceGetP2PAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') + except: + pass + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + try: + global __cuGraphicsUnregisterResource + __cuGraphicsUnregisterResource = win32api.GetProcAddress(handle, 'cuGraphicsUnregisterResource') + except: + pass + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + try: + global __cuGraphicsSubResourceGetMappedArray + __cuGraphicsSubResourceGetMappedArray = win32api.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') + except: + pass + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + try: + global __cuGraphicsResourceGetMappedMipmappedArray + __cuGraphicsResourceGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') + except: + pass + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + try: + global __cuGraphicsResourceGetMappedPointer_v2 + __cuGraphicsResourceGetMappedPointer_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') + except: + pass + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + try: + global __cuGraphicsResourceSetMapFlags_v2 + __cuGraphicsResourceSetMapFlags_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') + except: + pass + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + try: + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') + except: + pass + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + try: + global __cuCoredumpGetAttribute + __cuCoredumpGetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpGetAttribute') + except: + pass + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + try: + global __cuCoredumpGetAttributeGlobal + __cuCoredumpGetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') + except: + pass + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + try: + global __cuCoredumpSetAttribute + __cuCoredumpSetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpSetAttribute') + except: + pass + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + try: + global __cuCoredumpSetAttributeGlobal + __cuCoredumpSetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') + except: + pass + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + try: + global __cuGetExportTable + __cuGetExportTable = win32api.GetProcAddress(handle, 'cuGetExportTable') + except: + pass + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + try: + global __cuGreenCtxCreate + __cuGreenCtxCreate = win32api.GetProcAddress(handle, 'cuGreenCtxCreate') + except: + pass + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + try: + global __cuGreenCtxDestroy + __cuGreenCtxDestroy = win32api.GetProcAddress(handle, 'cuGreenCtxDestroy') + except: + pass + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + try: + global __cuCtxFromGreenCtx + __cuCtxFromGreenCtx = win32api.GetProcAddress(handle, 'cuCtxFromGreenCtx') + except: + pass + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + try: + global __cuDeviceGetDevResource + __cuDeviceGetDevResource = win32api.GetProcAddress(handle, 'cuDeviceGetDevResource') + except: + pass + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + try: + global __cuCtxGetDevResource + __cuCtxGetDevResource = win32api.GetProcAddress(handle, 'cuCtxGetDevResource') + except: + pass + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + try: + global __cuGreenCtxGetDevResource + __cuGreenCtxGetDevResource = win32api.GetProcAddress(handle, 'cuGreenCtxGetDevResource') + except: + pass + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + try: + global __cuDevSmResourceSplitByCount + __cuDevSmResourceSplitByCount = win32api.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') + except: + pass + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + try: + global __cuDevResourceGenerateDesc + __cuDevResourceGenerateDesc = win32api.GetProcAddress(handle, 'cuDevResourceGenerateDesc') + except: + pass + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + try: + global __cuGreenCtxRecordEvent + __cuGreenCtxRecordEvent = win32api.GetProcAddress(handle, 'cuGreenCtxRecordEvent') + except: + pass + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + try: + global __cuGreenCtxWaitEvent + __cuGreenCtxWaitEvent = win32api.GetProcAddress(handle, 'cuGreenCtxWaitEvent') + except: + pass + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + try: + global __cuStreamGetGreenCtx + __cuStreamGetGreenCtx = win32api.GetProcAddress(handle, 'cuStreamGetGreenCtx') + except: + pass + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + try: + global __cuGreenCtxStreamCreate + __cuGreenCtxStreamCreate = win32api.GetProcAddress(handle, 'cuGreenCtxStreamCreate') + except: + pass + {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + try: + global __cuGreenCtxGetId + __cuGreenCtxGetId = win32api.GetProcAddress(handle, 'cuGreenCtxGetId') + except: + pass + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + try: + global __cuLogsRegisterCallback + __cuLogsRegisterCallback = win32api.GetProcAddress(handle, 'cuLogsRegisterCallback') + except: + pass + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + try: + global __cuLogsUnregisterCallback + __cuLogsUnregisterCallback = win32api.GetProcAddress(handle, 'cuLogsUnregisterCallback') + except: + pass + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + try: + global __cuLogsCurrent + __cuLogsCurrent = win32api.GetProcAddress(handle, 'cuLogsCurrent') + except: + pass + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + try: + global __cuLogsDumpToFile + __cuLogsDumpToFile = win32api.GetProcAddress(handle, 'cuLogsDumpToFile') + except: + pass + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + try: + global __cuLogsDumpToMemory + __cuLogsDumpToMemory = win32api.GetProcAddress(handle, 'cuLogsDumpToMemory') + except: + pass + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + try: + global __cuCheckpointProcessGetRestoreThreadId + __cuCheckpointProcessGetRestoreThreadId = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') + except: + pass + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + try: + global __cuCheckpointProcessGetState + __cuCheckpointProcessGetState = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetState') + except: + pass + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + try: + global __cuCheckpointProcessLock + __cuCheckpointProcessLock = win32api.GetProcAddress(handle, 'cuCheckpointProcessLock') + except: + pass + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + try: + global __cuCheckpointProcessCheckpoint + __cuCheckpointProcessCheckpoint = win32api.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') + except: + pass + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + try: + global __cuCheckpointProcessUnlock + __cuCheckpointProcessUnlock = win32api.GetProcAddress(handle, 'cuCheckpointProcessUnlock') + except: + pass + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + try: + global __cuProfilerStart + __cuProfilerStart = win32api.GetProcAddress(handle, 'cuProfilerStart') + except: + pass + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + try: + global __cuProfilerStop + __cuProfilerStop = win32api.GetProcAddress(handle, 'cuProfilerStop') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsEGLRegisterImage + __cuGraphicsEGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamConsumerConnect + __cuEGLStreamConsumerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamConsumerConnectWithFlags + __cuEGLStreamConsumerConnectWithFlags = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamConsumerDisconnect + __cuEGLStreamConsumerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamConsumerAcquireFrame + __cuEGLStreamConsumerAcquireFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamConsumerReleaseFrame + __cuEGLStreamConsumerReleaseFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamProducerConnect + __cuEGLStreamProducerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerConnect') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamProducerDisconnect + __cuEGLStreamProducerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamProducerPresentFrame + __cuEGLStreamProducerPresentFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEGLStreamProducerReturnFrame + __cuEGLStreamProducerReturnFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsResourceGetMappedEglFrame + __cuGraphicsResourceGetMappedEglFrame = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') + except: + pass + {{endif}} + {{if True}} + try: + global __cuEventCreateFromEGLSync + __cuEventCreateFromEGLSync = win32api.GetProcAddress(handle, 'cuEventCreateFromEGLSync') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsGLRegisterBuffer + __cuGraphicsGLRegisterBuffer = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsGLRegisterImage + __cuGraphicsGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGLGetDevices_v2 + __cuGLGetDevices_v2 = win32api.GetProcAddress(handle, 'cuGLGetDevices_v2') + except: + pass + {{endif}} + {{if True}} + try: + global __cuVDPAUGetDevice + __cuVDPAUGetDevice = win32api.GetProcAddress(handle, 'cuVDPAUGetDevice') + except: + pass + {{endif}} + {{if True}} + try: + global __cuVDPAUCtxCreate_v2 + __cuVDPAUCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsVDPAURegisterVideoSurface + __cuGraphicsVDPAURegisterVideoSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') + except: + pass + {{endif}} + {{if True}} + try: + global __cuGraphicsVDPAURegisterOutputSurface + __cuGraphicsVDPAURegisterOutputSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') + except: + pass + {{endif}} + {{else}} + # Load using dlsym + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy_ptds') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer_ptds') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2_ptds') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2_ptds') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2_ptds') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer_ptds') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync_ptsz') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2_ptds') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2_ptds') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2_ptds') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async_ptsz') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async_ptsz') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async_ptsz') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync_ptsz') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync_ptsz') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync_ptsz') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync_ptsz') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz') + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync_ptsz') + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync_ptsz') + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice_ptsz') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags_ptsz') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId_ptsz') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx_ptsz') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent_ptsz') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback_ptsz') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2_ptsz') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph_ptsz') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture_ptsz') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync_ptsz') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery_ptsz') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize_ptsz') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes_ptsz') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute_ptsz') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute_ptsz') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord_ptsz') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags_ptsz') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2_ptsz') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel_ptsz') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx_ptsz') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel_ptsz') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc_ptsz') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams_ptsz') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload_ptsz') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch_ptsz') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources_ptsz') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources_ptsz') + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync') + {{endif}} + {{if 'cuMemcpyBatchAsync_v2' in found_functions}} + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_v2') + {{endif}} + {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_v2') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2') + {{endif}} + {{if 'cuMemPrefetchBatchAsync' in found_functions}} + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchBatchAsync') + {{endif}} + {{if 'cuMemDiscardBatchAsync' in found_functions}} + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardBatchAsync') + {{endif}} + {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = dlfcn.dlsym(handle, 'cuMemDiscardAndPrefetchBatchAsync') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources') + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + global __cuGetErrorString + __cuGetErrorString = dlfcn.dlsym(handle, 'cuGetErrorString') + {{endif}} + {{if 'cuGetErrorName' in found_functions}} + global __cuGetErrorName + __cuGetErrorName = dlfcn.dlsym(handle, 'cuGetErrorName') + {{endif}} + {{if 'cuInit' in found_functions}} + global __cuInit + __cuInit = dlfcn.dlsym(handle, 'cuInit') + {{endif}} + {{if 'cuDriverGetVersion' in found_functions}} + global __cuDriverGetVersion + __cuDriverGetVersion = dlfcn.dlsym(handle, 'cuDriverGetVersion') + {{endif}} + {{if 'cuDeviceGet' in found_functions}} + global __cuDeviceGet + __cuDeviceGet = dlfcn.dlsym(handle, 'cuDeviceGet') + {{endif}} + {{if 'cuDeviceGetCount' in found_functions}} + global __cuDeviceGetCount + __cuDeviceGetCount = dlfcn.dlsym(handle, 'cuDeviceGetCount') + {{endif}} + {{if 'cuDeviceGetName' in found_functions}} + global __cuDeviceGetName + __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName') + {{endif}} + {{if 'cuDeviceGetUuid_v2' in found_functions}} + global __cuDeviceGetUuid_v2 + __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2') + {{endif}} + {{if 'cuDeviceGetLuid' in found_functions}} + global __cuDeviceGetLuid + __cuDeviceGetLuid = dlfcn.dlsym(handle, 'cuDeviceGetLuid') + {{endif}} + {{if 'cuDeviceTotalMem_v2' in found_functions}} + global __cuDeviceTotalMem_v2 + __cuDeviceTotalMem_v2 = dlfcn.dlsym(handle, 'cuDeviceTotalMem_v2') + {{endif}} + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + global __cuDeviceGetTexture1DLinearMaxWidth + __cuDeviceGetTexture1DLinearMaxWidth = dlfcn.dlsym(handle, 'cuDeviceGetTexture1DLinearMaxWidth') + {{endif}} + {{if 'cuDeviceGetAttribute' in found_functions}} + global __cuDeviceGetAttribute + __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute') + {{endif}} + {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + global __cuDeviceGetHostAtomicCapabilities + __cuDeviceGetHostAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetHostAtomicCapabilities') + {{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + global __cuDeviceGetNvSciSyncAttributes + __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes') + {{endif}} + {{if 'cuDeviceSetMemPool' in found_functions}} + global __cuDeviceSetMemPool + __cuDeviceSetMemPool = dlfcn.dlsym(handle, 'cuDeviceSetMemPool') + {{endif}} + {{if 'cuDeviceGetMemPool' in found_functions}} + global __cuDeviceGetMemPool + __cuDeviceGetMemPool = dlfcn.dlsym(handle, 'cuDeviceGetMemPool') + {{endif}} + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + global __cuDeviceGetDefaultMemPool + __cuDeviceGetDefaultMemPool = dlfcn.dlsym(handle, 'cuDeviceGetDefaultMemPool') + {{endif}} + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + global __cuDeviceGetExecAffinitySupport + __cuDeviceGetExecAffinitySupport = dlfcn.dlsym(handle, 'cuDeviceGetExecAffinitySupport') + {{endif}} + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + global __cuFlushGPUDirectRDMAWrites + __cuFlushGPUDirectRDMAWrites = dlfcn.dlsym(handle, 'cuFlushGPUDirectRDMAWrites') + {{endif}} + {{if 'cuDeviceGetProperties' in found_functions}} + global __cuDeviceGetProperties + __cuDeviceGetProperties = dlfcn.dlsym(handle, 'cuDeviceGetProperties') + {{endif}} + {{if 'cuDeviceComputeCapability' in found_functions}} + global __cuDeviceComputeCapability + __cuDeviceComputeCapability = dlfcn.dlsym(handle, 'cuDeviceComputeCapability') + {{endif}} + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + global __cuDevicePrimaryCtxRetain + __cuDevicePrimaryCtxRetain = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRetain') + {{endif}} + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + global __cuDevicePrimaryCtxRelease_v2 + __cuDevicePrimaryCtxRelease_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRelease_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + global __cuDevicePrimaryCtxSetFlags_v2 + __cuDevicePrimaryCtxSetFlags_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxSetFlags_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + global __cuDevicePrimaryCtxGetState + __cuDevicePrimaryCtxGetState = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxGetState') + {{endif}} + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + global __cuDevicePrimaryCtxReset_v2 + __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2') + {{endif}} + {{if 'cuCtxCreate_v4' in found_functions}} + global __cuCtxCreate_v4 + __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4') + {{endif}} + {{if 'cuCtxDestroy_v2' in found_functions}} + global __cuCtxDestroy_v2 + __cuCtxDestroy_v2 = dlfcn.dlsym(handle, 'cuCtxDestroy_v2') + {{endif}} + {{if 'cuCtxPushCurrent_v2' in found_functions}} + global __cuCtxPushCurrent_v2 + __cuCtxPushCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPushCurrent_v2') + {{endif}} + {{if 'cuCtxPopCurrent_v2' in found_functions}} + global __cuCtxPopCurrent_v2 + __cuCtxPopCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPopCurrent_v2') + {{endif}} + {{if 'cuCtxSetCurrent' in found_functions}} + global __cuCtxSetCurrent + __cuCtxSetCurrent = dlfcn.dlsym(handle, 'cuCtxSetCurrent') + {{endif}} + {{if 'cuCtxGetCurrent' in found_functions}} + global __cuCtxGetCurrent + __cuCtxGetCurrent = dlfcn.dlsym(handle, 'cuCtxGetCurrent') + {{endif}} + {{if 'cuCtxGetDevice' in found_functions}} + global __cuCtxGetDevice + __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice') + {{endif}} + {{if 'cuCtxGetDevice_v2' in found_functions}} + global __cuCtxGetDevice_v2 + __cuCtxGetDevice_v2 = dlfcn.dlsym(handle, 'cuCtxGetDevice_v2') + {{endif}} + {{if 'cuCtxGetFlags' in found_functions}} + global __cuCtxGetFlags + __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags') + {{endif}} + {{if 'cuCtxSetFlags' in found_functions}} + global __cuCtxSetFlags + __cuCtxSetFlags = dlfcn.dlsym(handle, 'cuCtxSetFlags') + {{endif}} + {{if 'cuCtxGetId' in found_functions}} + global __cuCtxGetId + __cuCtxGetId = dlfcn.dlsym(handle, 'cuCtxGetId') + {{endif}} + {{if 'cuCtxSynchronize' in found_functions}} + global __cuCtxSynchronize + __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize') + {{endif}} + {{if 'cuCtxSynchronize_v2' in found_functions}} + global __cuCtxSynchronize_v2 + __cuCtxSynchronize_v2 = dlfcn.dlsym(handle, 'cuCtxSynchronize_v2') + {{endif}} + {{if 'cuCtxSetLimit' in found_functions}} + global __cuCtxSetLimit + __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit') + {{endif}} + {{if 'cuCtxGetLimit' in found_functions}} + global __cuCtxGetLimit + __cuCtxGetLimit = dlfcn.dlsym(handle, 'cuCtxGetLimit') + {{endif}} + {{if 'cuCtxGetCacheConfig' in found_functions}} + global __cuCtxGetCacheConfig + __cuCtxGetCacheConfig = dlfcn.dlsym(handle, 'cuCtxGetCacheConfig') + {{endif}} + {{if 'cuCtxSetCacheConfig' in found_functions}} + global __cuCtxSetCacheConfig + __cuCtxSetCacheConfig = dlfcn.dlsym(handle, 'cuCtxSetCacheConfig') + {{endif}} + {{if 'cuCtxGetApiVersion' in found_functions}} + global __cuCtxGetApiVersion + __cuCtxGetApiVersion = dlfcn.dlsym(handle, 'cuCtxGetApiVersion') + {{endif}} + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + global __cuCtxGetStreamPriorityRange + __cuCtxGetStreamPriorityRange = dlfcn.dlsym(handle, 'cuCtxGetStreamPriorityRange') + {{endif}} + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + global __cuCtxResetPersistingL2Cache + __cuCtxResetPersistingL2Cache = dlfcn.dlsym(handle, 'cuCtxResetPersistingL2Cache') + {{endif}} + {{if 'cuCtxGetExecAffinity' in found_functions}} + global __cuCtxGetExecAffinity + __cuCtxGetExecAffinity = dlfcn.dlsym(handle, 'cuCtxGetExecAffinity') + {{endif}} + {{if 'cuCtxRecordEvent' in found_functions}} + global __cuCtxRecordEvent + __cuCtxRecordEvent = dlfcn.dlsym(handle, 'cuCtxRecordEvent') + {{endif}} + {{if 'cuCtxWaitEvent' in found_functions}} + global __cuCtxWaitEvent + __cuCtxWaitEvent = dlfcn.dlsym(handle, 'cuCtxWaitEvent') + {{endif}} + {{if 'cuCtxAttach' in found_functions}} + global __cuCtxAttach + __cuCtxAttach = dlfcn.dlsym(handle, 'cuCtxAttach') + {{endif}} + {{if 'cuCtxDetach' in found_functions}} + global __cuCtxDetach + __cuCtxDetach = dlfcn.dlsym(handle, 'cuCtxDetach') + {{endif}} + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + global __cuCtxGetSharedMemConfig + __cuCtxGetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxGetSharedMemConfig') + {{endif}} + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + global __cuCtxSetSharedMemConfig + __cuCtxSetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxSetSharedMemConfig') + {{endif}} + {{if 'cuModuleLoad' in found_functions}} + global __cuModuleLoad + __cuModuleLoad = dlfcn.dlsym(handle, 'cuModuleLoad') + {{endif}} + {{if 'cuModuleLoadData' in found_functions}} + global __cuModuleLoadData + __cuModuleLoadData = dlfcn.dlsym(handle, 'cuModuleLoadData') + {{endif}} + {{if 'cuModuleLoadDataEx' in found_functions}} + global __cuModuleLoadDataEx + __cuModuleLoadDataEx = dlfcn.dlsym(handle, 'cuModuleLoadDataEx') + {{endif}} + {{if 'cuModuleLoadFatBinary' in found_functions}} + global __cuModuleLoadFatBinary + __cuModuleLoadFatBinary = dlfcn.dlsym(handle, 'cuModuleLoadFatBinary') + {{endif}} + {{if 'cuModuleUnload' in found_functions}} + global __cuModuleUnload + __cuModuleUnload = dlfcn.dlsym(handle, 'cuModuleUnload') + {{endif}} + {{if 'cuModuleGetLoadingMode' in found_functions}} + global __cuModuleGetLoadingMode + __cuModuleGetLoadingMode = dlfcn.dlsym(handle, 'cuModuleGetLoadingMode') + {{endif}} + {{if 'cuModuleGetFunction' in found_functions}} + global __cuModuleGetFunction + __cuModuleGetFunction = dlfcn.dlsym(handle, 'cuModuleGetFunction') + {{endif}} + {{if 'cuModuleGetFunctionCount' in found_functions}} + global __cuModuleGetFunctionCount + __cuModuleGetFunctionCount = dlfcn.dlsym(handle, 'cuModuleGetFunctionCount') + {{endif}} + {{if 'cuModuleEnumerateFunctions' in found_functions}} + global __cuModuleEnumerateFunctions + __cuModuleEnumerateFunctions = dlfcn.dlsym(handle, 'cuModuleEnumerateFunctions') + {{endif}} + {{if 'cuModuleGetGlobal_v2' in found_functions}} + global __cuModuleGetGlobal_v2 + __cuModuleGetGlobal_v2 = dlfcn.dlsym(handle, 'cuModuleGetGlobal_v2') + {{endif}} + {{if 'cuLinkCreate_v2' in found_functions}} + global __cuLinkCreate_v2 + __cuLinkCreate_v2 = dlfcn.dlsym(handle, 'cuLinkCreate_v2') + {{endif}} + {{if 'cuLinkAddData_v2' in found_functions}} + global __cuLinkAddData_v2 + __cuLinkAddData_v2 = dlfcn.dlsym(handle, 'cuLinkAddData_v2') + {{endif}} + {{if 'cuLinkAddFile_v2' in found_functions}} + global __cuLinkAddFile_v2 + __cuLinkAddFile_v2 = dlfcn.dlsym(handle, 'cuLinkAddFile_v2') + {{endif}} + {{if 'cuLinkComplete' in found_functions}} + global __cuLinkComplete + __cuLinkComplete = dlfcn.dlsym(handle, 'cuLinkComplete') + {{endif}} + {{if 'cuLinkDestroy' in found_functions}} + global __cuLinkDestroy + __cuLinkDestroy = dlfcn.dlsym(handle, 'cuLinkDestroy') + {{endif}} + {{if 'cuModuleGetTexRef' in found_functions}} + global __cuModuleGetTexRef + __cuModuleGetTexRef = dlfcn.dlsym(handle, 'cuModuleGetTexRef') + {{endif}} + {{if 'cuModuleGetSurfRef' in found_functions}} + global __cuModuleGetSurfRef + __cuModuleGetSurfRef = dlfcn.dlsym(handle, 'cuModuleGetSurfRef') + {{endif}} + {{if 'cuLibraryLoadData' in found_functions}} + global __cuLibraryLoadData + __cuLibraryLoadData = dlfcn.dlsym(handle, 'cuLibraryLoadData') + {{endif}} + {{if 'cuLibraryLoadFromFile' in found_functions}} + global __cuLibraryLoadFromFile + __cuLibraryLoadFromFile = dlfcn.dlsym(handle, 'cuLibraryLoadFromFile') + {{endif}} + {{if 'cuLibraryUnload' in found_functions}} + global __cuLibraryUnload + __cuLibraryUnload = dlfcn.dlsym(handle, 'cuLibraryUnload') + {{endif}} + {{if 'cuLibraryGetKernel' in found_functions}} + global __cuLibraryGetKernel + __cuLibraryGetKernel = dlfcn.dlsym(handle, 'cuLibraryGetKernel') + {{endif}} + {{if 'cuLibraryGetKernelCount' in found_functions}} + global __cuLibraryGetKernelCount + __cuLibraryGetKernelCount = dlfcn.dlsym(handle, 'cuLibraryGetKernelCount') + {{endif}} + {{if 'cuLibraryEnumerateKernels' in found_functions}} + global __cuLibraryEnumerateKernels + __cuLibraryEnumerateKernels = dlfcn.dlsym(handle, 'cuLibraryEnumerateKernels') + {{endif}} + {{if 'cuLibraryGetModule' in found_functions}} + global __cuLibraryGetModule + __cuLibraryGetModule = dlfcn.dlsym(handle, 'cuLibraryGetModule') + {{endif}} + {{if 'cuKernelGetFunction' in found_functions}} + global __cuKernelGetFunction + __cuKernelGetFunction = dlfcn.dlsym(handle, 'cuKernelGetFunction') + {{endif}} + {{if 'cuKernelGetLibrary' in found_functions}} + global __cuKernelGetLibrary + __cuKernelGetLibrary = dlfcn.dlsym(handle, 'cuKernelGetLibrary') + {{endif}} + {{if 'cuLibraryGetGlobal' in found_functions}} + global __cuLibraryGetGlobal + __cuLibraryGetGlobal = dlfcn.dlsym(handle, 'cuLibraryGetGlobal') + {{endif}} + {{if 'cuLibraryGetManaged' in found_functions}} + global __cuLibraryGetManaged + __cuLibraryGetManaged = dlfcn.dlsym(handle, 'cuLibraryGetManaged') + {{endif}} + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + global __cuLibraryGetUnifiedFunction + __cuLibraryGetUnifiedFunction = dlfcn.dlsym(handle, 'cuLibraryGetUnifiedFunction') + {{endif}} + {{if 'cuKernelGetAttribute' in found_functions}} + global __cuKernelGetAttribute + __cuKernelGetAttribute = dlfcn.dlsym(handle, 'cuKernelGetAttribute') + {{endif}} + {{if 'cuKernelSetAttribute' in found_functions}} + global __cuKernelSetAttribute + __cuKernelSetAttribute = dlfcn.dlsym(handle, 'cuKernelSetAttribute') + {{endif}} + {{if 'cuKernelSetCacheConfig' in found_functions}} + global __cuKernelSetCacheConfig + __cuKernelSetCacheConfig = dlfcn.dlsym(handle, 'cuKernelSetCacheConfig') + {{endif}} + {{if 'cuKernelGetName' in found_functions}} + global __cuKernelGetName + __cuKernelGetName = dlfcn.dlsym(handle, 'cuKernelGetName') + {{endif}} + {{if 'cuKernelGetParamInfo' in found_functions}} + global __cuKernelGetParamInfo + __cuKernelGetParamInfo = dlfcn.dlsym(handle, 'cuKernelGetParamInfo') + {{endif}} + {{if 'cuMemGetInfo_v2' in found_functions}} + global __cuMemGetInfo_v2 + __cuMemGetInfo_v2 = dlfcn.dlsym(handle, 'cuMemGetInfo_v2') + {{endif}} + {{if 'cuMemAlloc_v2' in found_functions}} + global __cuMemAlloc_v2 + __cuMemAlloc_v2 = dlfcn.dlsym(handle, 'cuMemAlloc_v2') + {{endif}} + {{if 'cuMemAllocPitch_v2' in found_functions}} + global __cuMemAllocPitch_v2 + __cuMemAllocPitch_v2 = dlfcn.dlsym(handle, 'cuMemAllocPitch_v2') + {{endif}} + {{if 'cuMemFree_v2' in found_functions}} + global __cuMemFree_v2 + __cuMemFree_v2 = dlfcn.dlsym(handle, 'cuMemFree_v2') + {{endif}} + {{if 'cuMemGetAddressRange_v2' in found_functions}} + global __cuMemGetAddressRange_v2 + __cuMemGetAddressRange_v2 = dlfcn.dlsym(handle, 'cuMemGetAddressRange_v2') + {{endif}} + {{if 'cuMemAllocHost_v2' in found_functions}} + global __cuMemAllocHost_v2 + __cuMemAllocHost_v2 = dlfcn.dlsym(handle, 'cuMemAllocHost_v2') + {{endif}} + {{if 'cuMemFreeHost' in found_functions}} + global __cuMemFreeHost + __cuMemFreeHost = dlfcn.dlsym(handle, 'cuMemFreeHost') + {{endif}} + {{if 'cuMemHostAlloc' in found_functions}} + global __cuMemHostAlloc + __cuMemHostAlloc = dlfcn.dlsym(handle, 'cuMemHostAlloc') + {{endif}} + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + global __cuMemHostGetDevicePointer_v2 + __cuMemHostGetDevicePointer_v2 = dlfcn.dlsym(handle, 'cuMemHostGetDevicePointer_v2') + {{endif}} + {{if 'cuMemHostGetFlags' in found_functions}} + global __cuMemHostGetFlags + __cuMemHostGetFlags = dlfcn.dlsym(handle, 'cuMemHostGetFlags') + {{endif}} + {{if 'cuMemAllocManaged' in found_functions}} + global __cuMemAllocManaged + __cuMemAllocManaged = dlfcn.dlsym(handle, 'cuMemAllocManaged') + {{endif}} + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + global __cuDeviceRegisterAsyncNotification + __cuDeviceRegisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceRegisterAsyncNotification') + {{endif}} + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + global __cuDeviceUnregisterAsyncNotification + __cuDeviceUnregisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceUnregisterAsyncNotification') + {{endif}} + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + global __cuDeviceGetByPCIBusId + __cuDeviceGetByPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetByPCIBusId') + {{endif}} + {{if 'cuDeviceGetPCIBusId' in found_functions}} + global __cuDeviceGetPCIBusId + __cuDeviceGetPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetPCIBusId') + {{endif}} + {{if 'cuIpcGetEventHandle' in found_functions}} + global __cuIpcGetEventHandle + __cuIpcGetEventHandle = dlfcn.dlsym(handle, 'cuIpcGetEventHandle') + {{endif}} + {{if 'cuIpcOpenEventHandle' in found_functions}} + global __cuIpcOpenEventHandle + __cuIpcOpenEventHandle = dlfcn.dlsym(handle, 'cuIpcOpenEventHandle') + {{endif}} + {{if 'cuIpcGetMemHandle' in found_functions}} + global __cuIpcGetMemHandle + __cuIpcGetMemHandle = dlfcn.dlsym(handle, 'cuIpcGetMemHandle') + {{endif}} + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + global __cuIpcOpenMemHandle_v2 + __cuIpcOpenMemHandle_v2 = dlfcn.dlsym(handle, 'cuIpcOpenMemHandle_v2') + {{endif}} + {{if 'cuIpcCloseMemHandle' in found_functions}} + global __cuIpcCloseMemHandle + __cuIpcCloseMemHandle = dlfcn.dlsym(handle, 'cuIpcCloseMemHandle') + {{endif}} + {{if 'cuMemHostRegister_v2' in found_functions}} + global __cuMemHostRegister_v2 + __cuMemHostRegister_v2 = dlfcn.dlsym(handle, 'cuMemHostRegister_v2') + {{endif}} + {{if 'cuMemHostUnregister' in found_functions}} + global __cuMemHostUnregister + __cuMemHostUnregister = dlfcn.dlsym(handle, 'cuMemHostUnregister') + {{endif}} + {{if 'cuArrayCreate_v2' in found_functions}} + global __cuArrayCreate_v2 + __cuArrayCreate_v2 = dlfcn.dlsym(handle, 'cuArrayCreate_v2') + {{endif}} + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + global __cuArrayGetDescriptor_v2 + __cuArrayGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArrayGetDescriptor_v2') + {{endif}} + {{if 'cuArrayGetSparseProperties' in found_functions}} + global __cuArrayGetSparseProperties + __cuArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuArrayGetSparseProperties') + {{endif}} + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + global __cuMipmappedArrayGetSparseProperties + __cuMipmappedArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuMipmappedArrayGetSparseProperties') + {{endif}} + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + global __cuArrayGetMemoryRequirements + __cuArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuArrayGetMemoryRequirements') + {{endif}} + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + global __cuMipmappedArrayGetMemoryRequirements + __cuMipmappedArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuMipmappedArrayGetMemoryRequirements') + {{endif}} + {{if 'cuArrayGetPlane' in found_functions}} + global __cuArrayGetPlane + __cuArrayGetPlane = dlfcn.dlsym(handle, 'cuArrayGetPlane') + {{endif}} + {{if 'cuArrayDestroy' in found_functions}} + global __cuArrayDestroy + __cuArrayDestroy = dlfcn.dlsym(handle, 'cuArrayDestroy') + {{endif}} + {{if 'cuArray3DCreate_v2' in found_functions}} + global __cuArray3DCreate_v2 + __cuArray3DCreate_v2 = dlfcn.dlsym(handle, 'cuArray3DCreate_v2') + {{endif}} + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + global __cuArray3DGetDescriptor_v2 + __cuArray3DGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArray3DGetDescriptor_v2') + {{endif}} + {{if 'cuMipmappedArrayCreate' in found_functions}} + global __cuMipmappedArrayCreate + __cuMipmappedArrayCreate = dlfcn.dlsym(handle, 'cuMipmappedArrayCreate') + {{endif}} + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + global __cuMipmappedArrayGetLevel + __cuMipmappedArrayGetLevel = dlfcn.dlsym(handle, 'cuMipmappedArrayGetLevel') + {{endif}} + {{if 'cuMipmappedArrayDestroy' in found_functions}} + global __cuMipmappedArrayDestroy + __cuMipmappedArrayDestroy = dlfcn.dlsym(handle, 'cuMipmappedArrayDestroy') + {{endif}} + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + global __cuMemGetHandleForAddressRange + __cuMemGetHandleForAddressRange = dlfcn.dlsym(handle, 'cuMemGetHandleForAddressRange') + {{endif}} + {{if 'cuMemAddressReserve' in found_functions}} + global __cuMemAddressReserve + __cuMemAddressReserve = dlfcn.dlsym(handle, 'cuMemAddressReserve') + {{endif}} + {{if 'cuMemAddressFree' in found_functions}} + global __cuMemAddressFree + __cuMemAddressFree = dlfcn.dlsym(handle, 'cuMemAddressFree') + {{endif}} + {{if 'cuMemCreate' in found_functions}} + global __cuMemCreate + __cuMemCreate = dlfcn.dlsym(handle, 'cuMemCreate') + {{endif}} + {{if 'cuMemRelease' in found_functions}} + global __cuMemRelease + __cuMemRelease = dlfcn.dlsym(handle, 'cuMemRelease') + {{endif}} + {{if 'cuMemMap' in found_functions}} + global __cuMemMap + __cuMemMap = dlfcn.dlsym(handle, 'cuMemMap') + {{endif}} + {{if 'cuMemUnmap' in found_functions}} + global __cuMemUnmap + __cuMemUnmap = dlfcn.dlsym(handle, 'cuMemUnmap') + {{endif}} + {{if 'cuMemSetAccess' in found_functions}} + global __cuMemSetAccess + __cuMemSetAccess = dlfcn.dlsym(handle, 'cuMemSetAccess') + {{endif}} + {{if 'cuMemGetAccess' in found_functions}} + global __cuMemGetAccess + __cuMemGetAccess = dlfcn.dlsym(handle, 'cuMemGetAccess') + {{endif}} + {{if 'cuMemExportToShareableHandle' in found_functions}} + global __cuMemExportToShareableHandle + __cuMemExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemExportToShareableHandle') + {{endif}} + {{if 'cuMemImportFromShareableHandle' in found_functions}} + global __cuMemImportFromShareableHandle + __cuMemImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemImportFromShareableHandle') + {{endif}} + {{if 'cuMemGetAllocationGranularity' in found_functions}} + global __cuMemGetAllocationGranularity + __cuMemGetAllocationGranularity = dlfcn.dlsym(handle, 'cuMemGetAllocationGranularity') + {{endif}} + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + global __cuMemGetAllocationPropertiesFromHandle + __cuMemGetAllocationPropertiesFromHandle = dlfcn.dlsym(handle, 'cuMemGetAllocationPropertiesFromHandle') + {{endif}} + {{if 'cuMemRetainAllocationHandle' in found_functions}} + global __cuMemRetainAllocationHandle + __cuMemRetainAllocationHandle = dlfcn.dlsym(handle, 'cuMemRetainAllocationHandle') + {{endif}} + {{if 'cuMemPoolTrimTo' in found_functions}} + global __cuMemPoolTrimTo + __cuMemPoolTrimTo = dlfcn.dlsym(handle, 'cuMemPoolTrimTo') + {{endif}} + {{if 'cuMemPoolSetAttribute' in found_functions}} + global __cuMemPoolSetAttribute + __cuMemPoolSetAttribute = dlfcn.dlsym(handle, 'cuMemPoolSetAttribute') + {{endif}} + {{if 'cuMemPoolGetAttribute' in found_functions}} + global __cuMemPoolGetAttribute + __cuMemPoolGetAttribute = dlfcn.dlsym(handle, 'cuMemPoolGetAttribute') + {{endif}} + {{if 'cuMemPoolSetAccess' in found_functions}} + global __cuMemPoolSetAccess + __cuMemPoolSetAccess = dlfcn.dlsym(handle, 'cuMemPoolSetAccess') + {{endif}} + {{if 'cuMemPoolGetAccess' in found_functions}} + global __cuMemPoolGetAccess + __cuMemPoolGetAccess = dlfcn.dlsym(handle, 'cuMemPoolGetAccess') + {{endif}} + {{if 'cuMemPoolCreate' in found_functions}} + global __cuMemPoolCreate + __cuMemPoolCreate = dlfcn.dlsym(handle, 'cuMemPoolCreate') + {{endif}} + {{if 'cuMemPoolDestroy' in found_functions}} + global __cuMemPoolDestroy + __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy') + {{endif}} + {{if 'cuMemGetDefaultMemPool' in found_functions}} + global __cuMemGetDefaultMemPool + __cuMemGetDefaultMemPool = dlfcn.dlsym(handle, 'cuMemGetDefaultMemPool') + {{endif}} + {{if 'cuMemGetMemPool' in found_functions}} + global __cuMemGetMemPool + __cuMemGetMemPool = dlfcn.dlsym(handle, 'cuMemGetMemPool') + {{endif}} + {{if 'cuMemSetMemPool' in found_functions}} + global __cuMemSetMemPool + __cuMemSetMemPool = dlfcn.dlsym(handle, 'cuMemSetMemPool') + {{endif}} + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + global __cuMemPoolExportToShareableHandle + __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle') + {{endif}} + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + global __cuMemPoolImportFromShareableHandle + __cuMemPoolImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolImportFromShareableHandle') + {{endif}} + {{if 'cuMemPoolExportPointer' in found_functions}} + global __cuMemPoolExportPointer + __cuMemPoolExportPointer = dlfcn.dlsym(handle, 'cuMemPoolExportPointer') + {{endif}} + {{if 'cuMemPoolImportPointer' in found_functions}} + global __cuMemPoolImportPointer + __cuMemPoolImportPointer = dlfcn.dlsym(handle, 'cuMemPoolImportPointer') + {{endif}} + {{if 'cuMulticastCreate' in found_functions}} + global __cuMulticastCreate + __cuMulticastCreate = dlfcn.dlsym(handle, 'cuMulticastCreate') + {{endif}} + {{if 'cuMulticastAddDevice' in found_functions}} + global __cuMulticastAddDevice + __cuMulticastAddDevice = dlfcn.dlsym(handle, 'cuMulticastAddDevice') + {{endif}} + {{if 'cuMulticastBindMem' in found_functions}} + global __cuMulticastBindMem + __cuMulticastBindMem = dlfcn.dlsym(handle, 'cuMulticastBindMem') + {{endif}} + {{if 'cuMulticastBindAddr' in found_functions}} + global __cuMulticastBindAddr + __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr') + {{endif}} + {{if 'cuMulticastUnbind' in found_functions}} + global __cuMulticastUnbind + __cuMulticastUnbind = dlfcn.dlsym(handle, 'cuMulticastUnbind') + {{endif}} + {{if 'cuMulticastGetGranularity' in found_functions}} + global __cuMulticastGetGranularity + __cuMulticastGetGranularity = dlfcn.dlsym(handle, 'cuMulticastGetGranularity') + {{endif}} + {{if 'cuPointerGetAttribute' in found_functions}} + global __cuPointerGetAttribute + __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute') + {{endif}} + {{if 'cuMemAdvise_v2' in found_functions}} + global __cuMemAdvise_v2 + __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2') + {{endif}} + {{if 'cuMemRangeGetAttribute' in found_functions}} + global __cuMemRangeGetAttribute + __cuMemRangeGetAttribute = dlfcn.dlsym(handle, 'cuMemRangeGetAttribute') + {{endif}} + {{if 'cuMemRangeGetAttributes' in found_functions}} + global __cuMemRangeGetAttributes + __cuMemRangeGetAttributes = dlfcn.dlsym(handle, 'cuMemRangeGetAttributes') + {{endif}} + {{if 'cuPointerSetAttribute' in found_functions}} + global __cuPointerSetAttribute + __cuPointerSetAttribute = dlfcn.dlsym(handle, 'cuPointerSetAttribute') + {{endif}} + {{if 'cuPointerGetAttributes' in found_functions}} + global __cuPointerGetAttributes + __cuPointerGetAttributes = dlfcn.dlsym(handle, 'cuPointerGetAttributes') + {{endif}} + {{if 'cuStreamCreate' in found_functions}} + global __cuStreamCreate + __cuStreamCreate = dlfcn.dlsym(handle, 'cuStreamCreate') + {{endif}} + {{if 'cuStreamCreateWithPriority' in found_functions}} + global __cuStreamCreateWithPriority + __cuStreamCreateWithPriority = dlfcn.dlsym(handle, 'cuStreamCreateWithPriority') + {{endif}} + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + global __cuThreadExchangeStreamCaptureMode + __cuThreadExchangeStreamCaptureMode = dlfcn.dlsym(handle, 'cuThreadExchangeStreamCaptureMode') + {{endif}} + {{if 'cuStreamDestroy_v2' in found_functions}} + global __cuStreamDestroy_v2 + __cuStreamDestroy_v2 = dlfcn.dlsym(handle, 'cuStreamDestroy_v2') + {{endif}} + {{if 'cuEventCreate' in found_functions}} + global __cuEventCreate + __cuEventCreate = dlfcn.dlsym(handle, 'cuEventCreate') + {{endif}} + {{if 'cuEventQuery' in found_functions}} + global __cuEventQuery + __cuEventQuery = dlfcn.dlsym(handle, 'cuEventQuery') + {{endif}} + {{if 'cuEventSynchronize' in found_functions}} + global __cuEventSynchronize + __cuEventSynchronize = dlfcn.dlsym(handle, 'cuEventSynchronize') + {{endif}} + {{if 'cuEventDestroy_v2' in found_functions}} + global __cuEventDestroy_v2 + __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2') + {{endif}} + {{if 'cuEventElapsedTime_v2' in found_functions}} + global __cuEventElapsedTime_v2 + __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2') + {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + global __cuImportExternalMemory + __cuImportExternalMemory = dlfcn.dlsym(handle, 'cuImportExternalMemory') + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + global __cuExternalMemoryGetMappedBuffer + __cuExternalMemoryGetMappedBuffer = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedBuffer') + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + global __cuExternalMemoryGetMappedMipmappedArray + __cuExternalMemoryGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedMipmappedArray') + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + global __cuDestroyExternalMemory + __cuDestroyExternalMemory = dlfcn.dlsym(handle, 'cuDestroyExternalMemory') + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + global __cuImportExternalSemaphore + __cuImportExternalSemaphore = dlfcn.dlsym(handle, 'cuImportExternalSemaphore') + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + global __cuDestroyExternalSemaphore + __cuDestroyExternalSemaphore = dlfcn.dlsym(handle, 'cuDestroyExternalSemaphore') + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + global __cuFuncGetAttribute + __cuFuncGetAttribute = dlfcn.dlsym(handle, 'cuFuncGetAttribute') + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + global __cuFuncSetAttribute + __cuFuncSetAttribute = dlfcn.dlsym(handle, 'cuFuncSetAttribute') + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + global __cuFuncSetCacheConfig + __cuFuncSetCacheConfig = dlfcn.dlsym(handle, 'cuFuncSetCacheConfig') + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + global __cuFuncGetModule + __cuFuncGetModule = dlfcn.dlsym(handle, 'cuFuncGetModule') + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + global __cuFuncGetName + __cuFuncGetName = dlfcn.dlsym(handle, 'cuFuncGetName') + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + global __cuFuncGetParamInfo + __cuFuncGetParamInfo = dlfcn.dlsym(handle, 'cuFuncGetParamInfo') + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + global __cuFuncIsLoaded + __cuFuncIsLoaded = dlfcn.dlsym(handle, 'cuFuncIsLoaded') + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + global __cuFuncLoad + __cuFuncLoad = dlfcn.dlsym(handle, 'cuFuncLoad') + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + global __cuLaunchCooperativeKernelMultiDevice + __cuLaunchCooperativeKernelMultiDevice = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernelMultiDevice') + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + global __cuFuncSetBlockShape + __cuFuncSetBlockShape = dlfcn.dlsym(handle, 'cuFuncSetBlockShape') + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + global __cuFuncSetSharedSize + __cuFuncSetSharedSize = dlfcn.dlsym(handle, 'cuFuncSetSharedSize') + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + global __cuParamSetSize + __cuParamSetSize = dlfcn.dlsym(handle, 'cuParamSetSize') + {{endif}} + {{if 'cuParamSeti' in found_functions}} + global __cuParamSeti + __cuParamSeti = dlfcn.dlsym(handle, 'cuParamSeti') + {{endif}} + {{if 'cuParamSetf' in found_functions}} + global __cuParamSetf + __cuParamSetf = dlfcn.dlsym(handle, 'cuParamSetf') + {{endif}} + {{if 'cuParamSetv' in found_functions}} + global __cuParamSetv + __cuParamSetv = dlfcn.dlsym(handle, 'cuParamSetv') + {{endif}} + {{if 'cuLaunch' in found_functions}} + global __cuLaunch + __cuLaunch = dlfcn.dlsym(handle, 'cuLaunch') + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + global __cuLaunchGrid + __cuLaunchGrid = dlfcn.dlsym(handle, 'cuLaunchGrid') + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + global __cuLaunchGridAsync + __cuLaunchGridAsync = dlfcn.dlsym(handle, 'cuLaunchGridAsync') + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + global __cuParamSetTexRef + __cuParamSetTexRef = dlfcn.dlsym(handle, 'cuParamSetTexRef') + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + global __cuFuncSetSharedMemConfig + __cuFuncSetSharedMemConfig = dlfcn.dlsym(handle, 'cuFuncSetSharedMemConfig') + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + global __cuGraphCreate + __cuGraphCreate = dlfcn.dlsym(handle, 'cuGraphCreate') + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + global __cuGraphAddKernelNode_v2 + __cuGraphAddKernelNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddKernelNode_v2') + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + global __cuGraphKernelNodeGetParams_v2 + __cuGraphKernelNodeGetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetParams_v2') + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + global __cuGraphKernelNodeSetParams_v2 + __cuGraphKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + global __cuGraphAddMemcpyNode + __cuGraphAddMemcpyNode = dlfcn.dlsym(handle, 'cuGraphAddMemcpyNode') + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + global __cuGraphMemcpyNodeGetParams + __cuGraphMemcpyNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeGetParams') + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + global __cuGraphMemcpyNodeSetParams + __cuGraphMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + global __cuGraphAddMemsetNode + __cuGraphAddMemsetNode = dlfcn.dlsym(handle, 'cuGraphAddMemsetNode') + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + global __cuGraphMemsetNodeGetParams + __cuGraphMemsetNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeGetParams') + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + global __cuGraphMemsetNodeSetParams + __cuGraphMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + global __cuGraphAddHostNode + __cuGraphAddHostNode = dlfcn.dlsym(handle, 'cuGraphAddHostNode') + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + global __cuGraphHostNodeGetParams + __cuGraphHostNodeGetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeGetParams') + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + global __cuGraphHostNodeSetParams + __cuGraphHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeSetParams') + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + global __cuGraphAddChildGraphNode + __cuGraphAddChildGraphNode = dlfcn.dlsym(handle, 'cuGraphAddChildGraphNode') + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + global __cuGraphChildGraphNodeGetGraph + __cuGraphChildGraphNodeGetGraph = dlfcn.dlsym(handle, 'cuGraphChildGraphNodeGetGraph') + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + global __cuGraphAddEmptyNode + __cuGraphAddEmptyNode = dlfcn.dlsym(handle, 'cuGraphAddEmptyNode') + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + __cuGraphAddEventRecordNode = dlfcn.dlsym(handle, 'cuGraphAddEventRecordNode') + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + global __cuGraphEventRecordNodeGetEvent + __cuGraphEventRecordNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeGetEvent') + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + global __cuGraphEventRecordNodeSetEvent + __cuGraphEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + global __cuGraphAddEventWaitNode + __cuGraphAddEventWaitNode = dlfcn.dlsym(handle, 'cuGraphAddEventWaitNode') + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + global __cuGraphEventWaitNodeGetEvent + __cuGraphEventWaitNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeGetEvent') + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + global __cuGraphEventWaitNodeSetEvent + __cuGraphEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + global __cuGraphAddExternalSemaphoresSignalNode + __cuGraphAddExternalSemaphoresSignalNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresSignalNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeGetParams + __cuGraphExternalSemaphoresSignalNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeSetParams + __cuGraphExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + global __cuGraphAddExternalSemaphoresWaitNode + __cuGraphAddExternalSemaphoresWaitNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresWaitNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeGetParams + __cuGraphExternalSemaphoresWaitNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeSetParams + __cuGraphExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + global __cuGraphAddBatchMemOpNode + __cuGraphAddBatchMemOpNode = dlfcn.dlsym(handle, 'cuGraphAddBatchMemOpNode') + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + global __cuGraphBatchMemOpNodeGetParams + __cuGraphBatchMemOpNodeGetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeGetParams') + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphBatchMemOpNodeSetParams + __cuGraphBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphExecBatchMemOpNodeSetParams + __cuGraphExecBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + global __cuGraphAddMemAllocNode + __cuGraphAddMemAllocNode = dlfcn.dlsym(handle, 'cuGraphAddMemAllocNode') + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + global __cuGraphMemAllocNodeGetParams + __cuGraphMemAllocNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemAllocNodeGetParams') + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + global __cuGraphAddMemFreeNode + __cuGraphAddMemFreeNode = dlfcn.dlsym(handle, 'cuGraphAddMemFreeNode') + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + global __cuGraphMemFreeNodeGetParams + __cuGraphMemFreeNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemFreeNodeGetParams') + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + global __cuDeviceGraphMemTrim + __cuDeviceGraphMemTrim = dlfcn.dlsym(handle, 'cuDeviceGraphMemTrim') + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + global __cuDeviceGetGraphMemAttribute + __cuDeviceGetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceGetGraphMemAttribute') + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + global __cuDeviceSetGraphMemAttribute + __cuDeviceSetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceSetGraphMemAttribute') + {{endif}} + {{if 'cuGraphClone' in found_functions}} + global __cuGraphClone + __cuGraphClone = dlfcn.dlsym(handle, 'cuGraphClone') + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + global __cuGraphNodeFindInClone + __cuGraphNodeFindInClone = dlfcn.dlsym(handle, 'cuGraphNodeFindInClone') + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + global __cuGraphNodeGetType + __cuGraphNodeGetType = dlfcn.dlsym(handle, 'cuGraphNodeGetType') + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + global __cuGraphGetNodes + __cuGraphGetNodes = dlfcn.dlsym(handle, 'cuGraphGetNodes') + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + global __cuGraphGetRootNodes + __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes') + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + global __cuGraphGetEdges_v2 + __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2') + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + global __cuGraphNodeGetDependencies_v2 + __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2') + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + global __cuGraphNodeGetDependentNodes_v2 + __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2') + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + global __cuGraphAddDependencies_v2 + __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2') + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + global __cuGraphRemoveDependencies_v2 + __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2') + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + global __cuGraphDestroyNode + __cuGraphDestroyNode = dlfcn.dlsym(handle, 'cuGraphDestroyNode') + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + global __cuGraphInstantiateWithFlags + __cuGraphInstantiateWithFlags = dlfcn.dlsym(handle, 'cuGraphInstantiateWithFlags') + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + global __cuGraphExecGetFlags + __cuGraphExecGetFlags = dlfcn.dlsym(handle, 'cuGraphExecGetFlags') + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + global __cuGraphExecKernelNodeSetParams_v2 + __cuGraphExecKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphExecKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + global __cuGraphExecMemcpyNodeSetParams + __cuGraphExecMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + global __cuGraphExecMemsetNodeSetParams + __cuGraphExecMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + global __cuGraphExecHostNodeSetParams + __cuGraphExecHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecHostNodeSetParams') + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + global __cuGraphExecChildGraphNodeSetParams + __cuGraphExecChildGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecChildGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + global __cuGraphExecEventRecordNodeSetEvent + __cuGraphExecEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + global __cuGraphExecEventWaitNodeSetEvent + __cuGraphExecEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + __cuGraphExecExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + __cuGraphExecExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + global __cuGraphNodeSetEnabled + __cuGraphNodeSetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeSetEnabled') + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + global __cuGraphNodeGetEnabled + __cuGraphNodeGetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeGetEnabled') + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + global __cuGraphExecDestroy + __cuGraphExecDestroy = dlfcn.dlsym(handle, 'cuGraphExecDestroy') + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + global __cuGraphDestroy + __cuGraphDestroy = dlfcn.dlsym(handle, 'cuGraphDestroy') + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + global __cuGraphExecUpdate_v2 + __cuGraphExecUpdate_v2 = dlfcn.dlsym(handle, 'cuGraphExecUpdate_v2') + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + global __cuGraphKernelNodeCopyAttributes + __cuGraphKernelNodeCopyAttributes = dlfcn.dlsym(handle, 'cuGraphKernelNodeCopyAttributes') + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + global __cuGraphKernelNodeGetAttribute + __cuGraphKernelNodeGetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetAttribute') + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + global __cuGraphKernelNodeSetAttribute + __cuGraphKernelNodeSetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetAttribute') + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + global __cuGraphDebugDotPrint + __cuGraphDebugDotPrint = dlfcn.dlsym(handle, 'cuGraphDebugDotPrint') + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + global __cuUserObjectCreate + __cuUserObjectCreate = dlfcn.dlsym(handle, 'cuUserObjectCreate') + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + global __cuUserObjectRetain + __cuUserObjectRetain = dlfcn.dlsym(handle, 'cuUserObjectRetain') + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + global __cuUserObjectRelease + __cuUserObjectRelease = dlfcn.dlsym(handle, 'cuUserObjectRelease') + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + global __cuGraphRetainUserObject + __cuGraphRetainUserObject = dlfcn.dlsym(handle, 'cuGraphRetainUserObject') + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + global __cuGraphReleaseUserObject + __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject') + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + global __cuGraphAddNode_v2 + __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2') + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + global __cuGraphNodeSetParams + __cuGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + global __cuGraphExecNodeSetParams + __cuGraphExecNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecNodeSetParams') + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + global __cuGraphConditionalHandleCreate + __cuGraphConditionalHandleCreate = dlfcn.dlsym(handle, 'cuGraphConditionalHandleCreate') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + __cuOccupancyMaxActiveBlocksPerMultiprocessor = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + global __cuOccupancyMaxPotentialBlockSize + __cuOccupancyMaxPotentialBlockSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSize') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + global __cuOccupancyMaxPotentialBlockSizeWithFlags + __cuOccupancyMaxPotentialBlockSizeWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + global __cuOccupancyAvailableDynamicSMemPerBlock + __cuOccupancyAvailableDynamicSMemPerBlock = dlfcn.dlsym(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + global __cuOccupancyMaxPotentialClusterSize + __cuOccupancyMaxPotentialClusterSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialClusterSize') + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + global __cuOccupancyMaxActiveClusters + __cuOccupancyMaxActiveClusters = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveClusters') + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + global __cuTexRefSetArray + __cuTexRefSetArray = dlfcn.dlsym(handle, 'cuTexRefSetArray') + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + global __cuTexRefSetMipmappedArray + __cuTexRefSetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefSetMipmappedArray') + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + global __cuTexRefSetAddress_v2 + __cuTexRefSetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefSetAddress_v2') + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + global __cuTexRefSetAddress2D_v3 + __cuTexRefSetAddress2D_v3 = dlfcn.dlsym(handle, 'cuTexRefSetAddress2D_v3') + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + global __cuTexRefSetFormat + __cuTexRefSetFormat = dlfcn.dlsym(handle, 'cuTexRefSetFormat') + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + global __cuTexRefSetAddressMode + __cuTexRefSetAddressMode = dlfcn.dlsym(handle, 'cuTexRefSetAddressMode') + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + global __cuTexRefSetFilterMode + __cuTexRefSetFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + global __cuTexRefSetMipmapFilterMode + __cuTexRefSetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + global __cuTexRefSetMipmapLevelBias + __cuTexRefSetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + global __cuTexRefSetMipmapLevelClamp + __cuTexRefSetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + global __cuTexRefSetMaxAnisotropy + __cuTexRefSetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefSetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + global __cuTexRefSetBorderColor + __cuTexRefSetBorderColor = dlfcn.dlsym(handle, 'cuTexRefSetBorderColor') + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + global __cuTexRefSetFlags + __cuTexRefSetFlags = dlfcn.dlsym(handle, 'cuTexRefSetFlags') + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + global __cuTexRefGetAddress_v2 + __cuTexRefGetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefGetAddress_v2') + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + global __cuTexRefGetArray + __cuTexRefGetArray = dlfcn.dlsym(handle, 'cuTexRefGetArray') + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + global __cuTexRefGetMipmappedArray + __cuTexRefGetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefGetMipmappedArray') + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + global __cuTexRefGetAddressMode + __cuTexRefGetAddressMode = dlfcn.dlsym(handle, 'cuTexRefGetAddressMode') + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + global __cuTexRefGetFilterMode + __cuTexRefGetFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetFilterMode') + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + global __cuTexRefGetFormat + __cuTexRefGetFormat = dlfcn.dlsym(handle, 'cuTexRefGetFormat') + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + global __cuTexRefGetMipmapFilterMode + __cuTexRefGetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + global __cuTexRefGetMipmapLevelBias + __cuTexRefGetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + global __cuTexRefGetMipmapLevelClamp + __cuTexRefGetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + global __cuTexRefGetMaxAnisotropy + __cuTexRefGetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefGetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + global __cuTexRefGetBorderColor + __cuTexRefGetBorderColor = dlfcn.dlsym(handle, 'cuTexRefGetBorderColor') + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + global __cuTexRefGetFlags + __cuTexRefGetFlags = dlfcn.dlsym(handle, 'cuTexRefGetFlags') + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + global __cuTexRefCreate + __cuTexRefCreate = dlfcn.dlsym(handle, 'cuTexRefCreate') + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + global __cuTexRefDestroy + __cuTexRefDestroy = dlfcn.dlsym(handle, 'cuTexRefDestroy') + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + global __cuSurfRefSetArray + __cuSurfRefSetArray = dlfcn.dlsym(handle, 'cuSurfRefSetArray') + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + global __cuSurfRefGetArray + __cuSurfRefGetArray = dlfcn.dlsym(handle, 'cuSurfRefGetArray') + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + global __cuTexObjectCreate + __cuTexObjectCreate = dlfcn.dlsym(handle, 'cuTexObjectCreate') + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + global __cuTexObjectDestroy + __cuTexObjectDestroy = dlfcn.dlsym(handle, 'cuTexObjectDestroy') + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + global __cuTexObjectGetResourceDesc + __cuTexObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceDesc') + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + global __cuTexObjectGetTextureDesc + __cuTexObjectGetTextureDesc = dlfcn.dlsym(handle, 'cuTexObjectGetTextureDesc') + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + global __cuTexObjectGetResourceViewDesc + __cuTexObjectGetResourceViewDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceViewDesc') + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + global __cuSurfObjectCreate + __cuSurfObjectCreate = dlfcn.dlsym(handle, 'cuSurfObjectCreate') + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + global __cuSurfObjectDestroy + __cuSurfObjectDestroy = dlfcn.dlsym(handle, 'cuSurfObjectDestroy') + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + global __cuSurfObjectGetResourceDesc + __cuSurfObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuSurfObjectGetResourceDesc') + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + global __cuTensorMapEncodeTiled + __cuTensorMapEncodeTiled = dlfcn.dlsym(handle, 'cuTensorMapEncodeTiled') + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + global __cuTensorMapEncodeIm2col + __cuTensorMapEncodeIm2col = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2col') + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + global __cuTensorMapEncodeIm2colWide + __cuTensorMapEncodeIm2colWide = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2colWide') + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + global __cuTensorMapReplaceAddress + __cuTensorMapReplaceAddress = dlfcn.dlsym(handle, 'cuTensorMapReplaceAddress') + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + global __cuDeviceCanAccessPeer + __cuDeviceCanAccessPeer = dlfcn.dlsym(handle, 'cuDeviceCanAccessPeer') + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + global __cuCtxEnablePeerAccess + __cuCtxEnablePeerAccess = dlfcn.dlsym(handle, 'cuCtxEnablePeerAccess') + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + global __cuCtxDisablePeerAccess + __cuCtxDisablePeerAccess = dlfcn.dlsym(handle, 'cuCtxDisablePeerAccess') + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + global __cuDeviceGetP2PAttribute + __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute') + {{endif}} + {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} + global __cuDeviceGetP2PAtomicCapabilities + __cuDeviceGetP2PAtomicCapabilities = dlfcn.dlsym(handle, 'cuDeviceGetP2PAtomicCapabilities') + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + global __cuGraphicsUnregisterResource + __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource') + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + global __cuGraphicsSubResourceGetMappedArray + __cuGraphicsSubResourceGetMappedArray = dlfcn.dlsym(handle, 'cuGraphicsSubResourceGetMappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + global __cuGraphicsResourceGetMappedMipmappedArray + __cuGraphicsResourceGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedMipmappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + global __cuGraphicsResourceGetMappedPointer_v2 + __cuGraphicsResourceGetMappedPointer_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedPointer_v2') + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + global __cuGraphicsResourceSetMapFlags_v2 + __cuGraphicsResourceSetMapFlags_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceSetMapFlags_v2') + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + global __cuCoredumpGetAttribute + __cuCoredumpGetAttribute = dlfcn.dlsym(handle, 'cuCoredumpGetAttribute') + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + global __cuCoredumpGetAttributeGlobal + __cuCoredumpGetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpGetAttributeGlobal') + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + global __cuCoredumpSetAttribute + __cuCoredumpSetAttribute = dlfcn.dlsym(handle, 'cuCoredumpSetAttribute') + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + global __cuCoredumpSetAttributeGlobal + __cuCoredumpSetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpSetAttributeGlobal') + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + global __cuGetExportTable + __cuGetExportTable = dlfcn.dlsym(handle, 'cuGetExportTable') + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + global __cuGreenCtxCreate + __cuGreenCtxCreate = dlfcn.dlsym(handle, 'cuGreenCtxCreate') + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + global __cuGreenCtxDestroy + __cuGreenCtxDestroy = dlfcn.dlsym(handle, 'cuGreenCtxDestroy') + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + global __cuCtxFromGreenCtx + __cuCtxFromGreenCtx = dlfcn.dlsym(handle, 'cuCtxFromGreenCtx') + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + global __cuDeviceGetDevResource + __cuDeviceGetDevResource = dlfcn.dlsym(handle, 'cuDeviceGetDevResource') + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + global __cuCtxGetDevResource + __cuCtxGetDevResource = dlfcn.dlsym(handle, 'cuCtxGetDevResource') + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + global __cuGreenCtxGetDevResource + __cuGreenCtxGetDevResource = dlfcn.dlsym(handle, 'cuGreenCtxGetDevResource') + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + global __cuDevSmResourceSplitByCount + __cuDevSmResourceSplitByCount = dlfcn.dlsym(handle, 'cuDevSmResourceSplitByCount') + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + global __cuDevResourceGenerateDesc + __cuDevResourceGenerateDesc = dlfcn.dlsym(handle, 'cuDevResourceGenerateDesc') + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + global __cuGreenCtxRecordEvent + __cuGreenCtxRecordEvent = dlfcn.dlsym(handle, 'cuGreenCtxRecordEvent') + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + global __cuGreenCtxWaitEvent + __cuGreenCtxWaitEvent = dlfcn.dlsym(handle, 'cuGreenCtxWaitEvent') + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + global __cuStreamGetGreenCtx + __cuStreamGetGreenCtx = dlfcn.dlsym(handle, 'cuStreamGetGreenCtx') + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + global __cuGreenCtxStreamCreate + __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate') + {{endif}} + {{if 'cuGreenCtxGetId' in found_functions}} + global __cuGreenCtxGetId + __cuGreenCtxGetId = dlfcn.dlsym(handle, 'cuGreenCtxGetId') + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + global __cuLogsRegisterCallback + __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback') + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + global __cuLogsUnregisterCallback + __cuLogsUnregisterCallback = dlfcn.dlsym(handle, 'cuLogsUnregisterCallback') + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + global __cuLogsCurrent + __cuLogsCurrent = dlfcn.dlsym(handle, 'cuLogsCurrent') + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + global __cuLogsDumpToFile + __cuLogsDumpToFile = dlfcn.dlsym(handle, 'cuLogsDumpToFile') + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + global __cuLogsDumpToMemory + __cuLogsDumpToMemory = dlfcn.dlsym(handle, 'cuLogsDumpToMemory') + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + global __cuCheckpointProcessGetRestoreThreadId + __cuCheckpointProcessGetRestoreThreadId = dlfcn.dlsym(handle, 'cuCheckpointProcessGetRestoreThreadId') + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + global __cuCheckpointProcessGetState + __cuCheckpointProcessGetState = dlfcn.dlsym(handle, 'cuCheckpointProcessGetState') + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + global __cuCheckpointProcessLock + __cuCheckpointProcessLock = dlfcn.dlsym(handle, 'cuCheckpointProcessLock') + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + global __cuCheckpointProcessCheckpoint + __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + global __cuCheckpointProcessUnlock + __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + global __cuProfilerStart + __cuProfilerStart = dlfcn.dlsym(handle, 'cuProfilerStart') + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + global __cuProfilerStop + __cuProfilerStop = dlfcn.dlsym(handle, 'cuProfilerStop') + {{endif}} + {{if True}} + global __cuGraphicsEGLRegisterImage + __cuGraphicsEGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsEGLRegisterImage') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnect + __cuEGLStreamConsumerConnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnectWithFlags + __cuEGLStreamConsumerConnectWithFlags = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnectWithFlags') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerDisconnect + __cuEGLStreamConsumerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerAcquireFrame + __cuEGLStreamConsumerAcquireFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerAcquireFrame') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerReleaseFrame + __cuEGLStreamConsumerReleaseFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerReleaseFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerConnect + __cuEGLStreamProducerConnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerDisconnect + __cuEGLStreamProducerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerPresentFrame + __cuEGLStreamProducerPresentFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerPresentFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerReturnFrame + __cuEGLStreamProducerReturnFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerReturnFrame') + {{endif}} + {{if True}} + global __cuGraphicsResourceGetMappedEglFrame + __cuGraphicsResourceGetMappedEglFrame = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedEglFrame') + {{endif}} + {{if True}} + global __cuEventCreateFromEGLSync + __cuEventCreateFromEGLSync = dlfcn.dlsym(handle, 'cuEventCreateFromEGLSync') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterBuffer + __cuGraphicsGLRegisterBuffer = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterBuffer') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterImage + __cuGraphicsGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterImage') + {{endif}} + {{if True}} + global __cuGLGetDevices_v2 + __cuGLGetDevices_v2 = dlfcn.dlsym(handle, 'cuGLGetDevices_v2') + {{endif}} + {{if True}} + global __cuVDPAUGetDevice + __cuVDPAUGetDevice = dlfcn.dlsym(handle, 'cuVDPAUGetDevice') + {{endif}} + {{if True}} + global __cuVDPAUCtxCreate_v2 + __cuVDPAUCtxCreate_v2 = dlfcn.dlsym(handle, 'cuVDPAUCtxCreate_v2') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterVideoSurface + __cuGraphicsVDPAURegisterVideoSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterVideoSurface') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterOutputSurface + __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface') + {{endif}} + {{endif}} + + __cuPythonInit = True + return 0 {{if 'cuGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index 965c61055..16068f641 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -11,7 +11,9 @@ from libc.stdint cimport uintptr_t {{endif}} from cuda.pathfinder import load_nvidia_dynamic_lib from libc.stdint cimport intptr_t +import threading +cdef object __symbol_lock = threading.Lock() cdef bint __cuPythonInit = False {{if 'nvrtcGetErrorString' in found_functions}}cdef void *__nvrtcGetErrorString = NULL{{endif}} {{if 'nvrtcVersion' in found_functions}}cdef void *__nvrtcVersion = NULL{{endif}} @@ -42,21 +44,12 @@ cdef int cuPythonInit() except -1 nogil: global __cuPythonInit if __cuPythonInit: return 0 - __cuPythonInit = True - # Load library - {{if 'Windows' == platform.system()}} - with gil: + with gil, __symbol_lock: + {{if 'Windows' == platform.system()}} handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint - {{else}} - with gil: - handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint - {{endif}} - - # Load function - {{if 'Windows' == platform.system()}} - with gil: + # Load function {{if 'nvrtcGetErrorString' in found_functions}} try: global __nvrtcGetErrorString @@ -226,105 +219,110 @@ cdef int cuPythonInit() except -1 nogil: pass {{endif}} - {{else}} - {{if 'nvrtcGetErrorString' in found_functions}} - global __nvrtcGetErrorString - __nvrtcGetErrorString = dlfcn.dlsym(handle, 'nvrtcGetErrorString') - {{endif}} - {{if 'nvrtcVersion' in found_functions}} - global __nvrtcVersion - __nvrtcVersion = dlfcn.dlsym(handle, 'nvrtcVersion') - {{endif}} - {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - global __nvrtcGetNumSupportedArchs - __nvrtcGetNumSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetNumSupportedArchs') - {{endif}} - {{if 'nvrtcGetSupportedArchs' in found_functions}} - global __nvrtcGetSupportedArchs - __nvrtcGetSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetSupportedArchs') - {{endif}} - {{if 'nvrtcCreateProgram' in found_functions}} - global __nvrtcCreateProgram - __nvrtcCreateProgram = dlfcn.dlsym(handle, 'nvrtcCreateProgram') - {{endif}} - {{if 'nvrtcDestroyProgram' in found_functions}} - global __nvrtcDestroyProgram - __nvrtcDestroyProgram = dlfcn.dlsym(handle, 'nvrtcDestroyProgram') - {{endif}} - {{if 'nvrtcCompileProgram' in found_functions}} - global __nvrtcCompileProgram - __nvrtcCompileProgram = dlfcn.dlsym(handle, 'nvrtcCompileProgram') - {{endif}} - {{if 'nvrtcGetPTXSize' in found_functions}} - global __nvrtcGetPTXSize - __nvrtcGetPTXSize = dlfcn.dlsym(handle, 'nvrtcGetPTXSize') - {{endif}} - {{if 'nvrtcGetPTX' in found_functions}} - global __nvrtcGetPTX - __nvrtcGetPTX = dlfcn.dlsym(handle, 'nvrtcGetPTX') - {{endif}} - {{if 'nvrtcGetCUBINSize' in found_functions}} - global __nvrtcGetCUBINSize - __nvrtcGetCUBINSize = dlfcn.dlsym(handle, 'nvrtcGetCUBINSize') - {{endif}} - {{if 'nvrtcGetCUBIN' in found_functions}} - global __nvrtcGetCUBIN - __nvrtcGetCUBIN = dlfcn.dlsym(handle, 'nvrtcGetCUBIN') - {{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} - global __nvrtcGetLTOIRSize - __nvrtcGetLTOIRSize = dlfcn.dlsym(handle, 'nvrtcGetLTOIRSize') - {{endif}} - {{if 'nvrtcGetLTOIR' in found_functions}} - global __nvrtcGetLTOIR - __nvrtcGetLTOIR = dlfcn.dlsym(handle, 'nvrtcGetLTOIR') - {{endif}} - {{if 'nvrtcGetOptiXIRSize' in found_functions}} - global __nvrtcGetOptiXIRSize - __nvrtcGetOptiXIRSize = dlfcn.dlsym(handle, 'nvrtcGetOptiXIRSize') - {{endif}} - {{if 'nvrtcGetOptiXIR' in found_functions}} - global __nvrtcGetOptiXIR - __nvrtcGetOptiXIR = dlfcn.dlsym(handle, 'nvrtcGetOptiXIR') - {{endif}} - {{if 'nvrtcGetProgramLogSize' in found_functions}} - global __nvrtcGetProgramLogSize - __nvrtcGetProgramLogSize = dlfcn.dlsym(handle, 'nvrtcGetProgramLogSize') - {{endif}} - {{if 'nvrtcGetProgramLog' in found_functions}} - global __nvrtcGetProgramLog - __nvrtcGetProgramLog = dlfcn.dlsym(handle, 'nvrtcGetProgramLog') - {{endif}} - {{if 'nvrtcAddNameExpression' in found_functions}} - global __nvrtcAddNameExpression - __nvrtcAddNameExpression = dlfcn.dlsym(handle, 'nvrtcAddNameExpression') - {{endif}} - {{if 'nvrtcGetLoweredName' in found_functions}} - global __nvrtcGetLoweredName - __nvrtcGetLoweredName = dlfcn.dlsym(handle, 'nvrtcGetLoweredName') - {{endif}} - {{if 'nvrtcGetPCHHeapSize' in found_functions}} - global __nvrtcGetPCHHeapSize - __nvrtcGetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSize') - {{endif}} - {{if 'nvrtcSetPCHHeapSize' in found_functions}} - global __nvrtcSetPCHHeapSize - __nvrtcSetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcSetPCHHeapSize') - {{endif}} - {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - global __nvrtcGetPCHCreateStatus - __nvrtcGetPCHCreateStatus = dlfcn.dlsym(handle, 'nvrtcGetPCHCreateStatus') - {{endif}} - {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - global __nvrtcGetPCHHeapSizeRequired - __nvrtcGetPCHHeapSizeRequired = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') - {{endif}} - {{if 'nvrtcSetFlowCallback' in found_functions}} - global __nvrtcSetFlowCallback - __nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback') - {{endif}} + {{else}} + handle = (load_nvidia_dynamic_lib("nvrtc")._handle_uint) - {{endif}} + # Load function + {{if 'nvrtcGetErrorString' in found_functions}} + global __nvrtcGetErrorString + __nvrtcGetErrorString = dlfcn.dlsym(handle, 'nvrtcGetErrorString') + {{endif}} + {{if 'nvrtcVersion' in found_functions}} + global __nvrtcVersion + __nvrtcVersion = dlfcn.dlsym(handle, 'nvrtcVersion') + {{endif}} + {{if 'nvrtcGetNumSupportedArchs' in found_functions}} + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetNumSupportedArchs') + {{endif}} + {{if 'nvrtcGetSupportedArchs' in found_functions}} + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetSupportedArchs') + {{endif}} + {{if 'nvrtcCreateProgram' in found_functions}} + global __nvrtcCreateProgram + __nvrtcCreateProgram = dlfcn.dlsym(handle, 'nvrtcCreateProgram') + {{endif}} + {{if 'nvrtcDestroyProgram' in found_functions}} + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = dlfcn.dlsym(handle, 'nvrtcDestroyProgram') + {{endif}} + {{if 'nvrtcCompileProgram' in found_functions}} + global __nvrtcCompileProgram + __nvrtcCompileProgram = dlfcn.dlsym(handle, 'nvrtcCompileProgram') + {{endif}} + {{if 'nvrtcGetPTXSize' in found_functions}} + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = dlfcn.dlsym(handle, 'nvrtcGetPTXSize') + {{endif}} + {{if 'nvrtcGetPTX' in found_functions}} + global __nvrtcGetPTX + __nvrtcGetPTX = dlfcn.dlsym(handle, 'nvrtcGetPTX') + {{endif}} + {{if 'nvrtcGetCUBINSize' in found_functions}} + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = dlfcn.dlsym(handle, 'nvrtcGetCUBINSize') + {{endif}} + {{if 'nvrtcGetCUBIN' in found_functions}} + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = dlfcn.dlsym(handle, 'nvrtcGetCUBIN') + {{endif}} + {{if 'nvrtcGetLTOIRSize' in found_functions}} + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = dlfcn.dlsym(handle, 'nvrtcGetLTOIRSize') + {{endif}} + {{if 'nvrtcGetLTOIR' in found_functions}} + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = dlfcn.dlsym(handle, 'nvrtcGetLTOIR') + {{endif}} + {{if 'nvrtcGetOptiXIRSize' in found_functions}} + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = dlfcn.dlsym(handle, 'nvrtcGetOptiXIRSize') + {{endif}} + {{if 'nvrtcGetOptiXIR' in found_functions}} + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = dlfcn.dlsym(handle, 'nvrtcGetOptiXIR') + {{endif}} + {{if 'nvrtcGetProgramLogSize' in found_functions}} + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = dlfcn.dlsym(handle, 'nvrtcGetProgramLogSize') + {{endif}} + {{if 'nvrtcGetProgramLog' in found_functions}} + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = dlfcn.dlsym(handle, 'nvrtcGetProgramLog') + {{endif}} + {{if 'nvrtcAddNameExpression' in found_functions}} + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = dlfcn.dlsym(handle, 'nvrtcAddNameExpression') + {{endif}} + {{if 'nvrtcGetLoweredName' in found_functions}} + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = dlfcn.dlsym(handle, 'nvrtcGetLoweredName') + {{endif}} + {{if 'nvrtcGetPCHHeapSize' in found_functions}} + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSize') + {{endif}} + {{if 'nvrtcSetPCHHeapSize' in found_functions}} + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcSetPCHHeapSize') + {{endif}} + {{if 'nvrtcGetPCHCreateStatus' in found_functions}} + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = dlfcn.dlsym(handle, 'nvrtcGetPCHCreateStatus') + {{endif}} + {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') + {{endif}} + {{if 'nvrtcSetFlowCallback' in found_functions}} + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback') + {{endif}} + {{endif}} + + __cuPythonInit = True + return 0 {{if 'nvrtcGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index d175b23e7..744540be5 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -5,6 +5,7 @@ # This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError @@ -35,6 +36,7 @@ cdef extern from "" nogil: # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_cufile_init = False cdef void* __cuDriverGetVersion = NULL @@ -93,331 +95,330 @@ cdef int _check_or_init_cufile() except -1 nogil: if __py_cufile_init: return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: + cdef int err, driver_ver = 0 + + with gil, __symbol_lock: + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: err_msg = dlerror() raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: + global __cuDriverGetVersion + if __cuDriverGetVersion == NULL: + __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if __cuDriverGetVersion == NULL: raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: + err = (__cuDriverGetVersion)(&driver_ver) + if err != 0: raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - - # Load function - global __cuFileHandleRegister - __cuFileHandleRegister = dlsym(RTLD_DEFAULT, 'cuFileHandleRegister') - if __cuFileHandleRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileHandleRegister = dlsym(handle, 'cuFileHandleRegister') - - global __cuFileHandleDeregister - __cuFileHandleDeregister = dlsym(RTLD_DEFAULT, 'cuFileHandleDeregister') - if __cuFileHandleDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileHandleDeregister = dlsym(handle, 'cuFileHandleDeregister') - - global __cuFileBufRegister - __cuFileBufRegister = dlsym(RTLD_DEFAULT, 'cuFileBufRegister') - if __cuFileBufRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBufRegister = dlsym(handle, 'cuFileBufRegister') - - global __cuFileBufDeregister - __cuFileBufDeregister = dlsym(RTLD_DEFAULT, 'cuFileBufDeregister') - if __cuFileBufDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBufDeregister = dlsym(handle, 'cuFileBufDeregister') - - global __cuFileRead - __cuFileRead = dlsym(RTLD_DEFAULT, 'cuFileRead') - if __cuFileRead == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileRead = dlsym(handle, 'cuFileRead') - - global __cuFileWrite - __cuFileWrite = dlsym(RTLD_DEFAULT, 'cuFileWrite') - if __cuFileWrite == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileWrite = dlsym(handle, 'cuFileWrite') - - global __cuFileDriverOpen - __cuFileDriverOpen = dlsym(RTLD_DEFAULT, 'cuFileDriverOpen') - if __cuFileDriverOpen == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverOpen = dlsym(handle, 'cuFileDriverOpen') - - global __cuFileDriverClose_v2 - __cuFileDriverClose_v2 = dlsym(RTLD_DEFAULT, 'cuFileDriverClose_v2') - if __cuFileDriverClose_v2 == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverClose_v2 = dlsym(handle, 'cuFileDriverClose_v2') - - global __cuFileUseCount - __cuFileUseCount = dlsym(RTLD_DEFAULT, 'cuFileUseCount') - if __cuFileUseCount == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileUseCount = dlsym(handle, 'cuFileUseCount') - - global __cuFileDriverGetProperties - __cuFileDriverGetProperties = dlsym(RTLD_DEFAULT, 'cuFileDriverGetProperties') - if __cuFileDriverGetProperties == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverGetProperties = dlsym(handle, 'cuFileDriverGetProperties') - - global __cuFileDriverSetPollMode - __cuFileDriverSetPollMode = dlsym(RTLD_DEFAULT, 'cuFileDriverSetPollMode') - if __cuFileDriverSetPollMode == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetPollMode = dlsym(handle, 'cuFileDriverSetPollMode') - - global __cuFileDriverSetMaxDirectIOSize - __cuFileDriverSetMaxDirectIOSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') - if __cuFileDriverSetMaxDirectIOSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxDirectIOSize = dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') - - global __cuFileDriverSetMaxCacheSize - __cuFileDriverSetMaxCacheSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') - if __cuFileDriverSetMaxCacheSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxCacheSize = dlsym(handle, 'cuFileDriverSetMaxCacheSize') - - global __cuFileDriverSetMaxPinnedMemSize - __cuFileDriverSetMaxPinnedMemSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') - if __cuFileDriverSetMaxPinnedMemSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxPinnedMemSize = dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') - - global __cuFileBatchIOSetUp - __cuFileBatchIOSetUp = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSetUp') - if __cuFileBatchIOSetUp == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOSetUp = dlsym(handle, 'cuFileBatchIOSetUp') - - global __cuFileBatchIOSubmit - __cuFileBatchIOSubmit = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSubmit') - if __cuFileBatchIOSubmit == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOSubmit = dlsym(handle, 'cuFileBatchIOSubmit') - - global __cuFileBatchIOGetStatus - __cuFileBatchIOGetStatus = dlsym(RTLD_DEFAULT, 'cuFileBatchIOGetStatus') - if __cuFileBatchIOGetStatus == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOGetStatus = dlsym(handle, 'cuFileBatchIOGetStatus') - - global __cuFileBatchIOCancel - __cuFileBatchIOCancel = dlsym(RTLD_DEFAULT, 'cuFileBatchIOCancel') - if __cuFileBatchIOCancel == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOCancel = dlsym(handle, 'cuFileBatchIOCancel') - - global __cuFileBatchIODestroy - __cuFileBatchIODestroy = dlsym(RTLD_DEFAULT, 'cuFileBatchIODestroy') - if __cuFileBatchIODestroy == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIODestroy = dlsym(handle, 'cuFileBatchIODestroy') - - global __cuFileReadAsync - __cuFileReadAsync = dlsym(RTLD_DEFAULT, 'cuFileReadAsync') - if __cuFileReadAsync == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileReadAsync = dlsym(handle, 'cuFileReadAsync') - - global __cuFileWriteAsync - __cuFileWriteAsync = dlsym(RTLD_DEFAULT, 'cuFileWriteAsync') - if __cuFileWriteAsync == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileWriteAsync = dlsym(handle, 'cuFileWriteAsync') - - global __cuFileStreamRegister - __cuFileStreamRegister = dlsym(RTLD_DEFAULT, 'cuFileStreamRegister') - if __cuFileStreamRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStreamRegister = dlsym(handle, 'cuFileStreamRegister') - - global __cuFileStreamDeregister - __cuFileStreamDeregister = dlsym(RTLD_DEFAULT, 'cuFileStreamDeregister') - if __cuFileStreamDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStreamDeregister = dlsym(handle, 'cuFileStreamDeregister') - - global __cuFileGetVersion - __cuFileGetVersion = dlsym(RTLD_DEFAULT, 'cuFileGetVersion') - if __cuFileGetVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetVersion = dlsym(handle, 'cuFileGetVersion') - - global __cuFileGetParameterSizeT - __cuFileGetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileGetParameterSizeT') - if __cuFileGetParameterSizeT == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterSizeT = dlsym(handle, 'cuFileGetParameterSizeT') - - global __cuFileGetParameterBool - __cuFileGetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileGetParameterBool') - if __cuFileGetParameterBool == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterBool = dlsym(handle, 'cuFileGetParameterBool') - - global __cuFileGetParameterString - __cuFileGetParameterString = dlsym(RTLD_DEFAULT, 'cuFileGetParameterString') - if __cuFileGetParameterString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterString = dlsym(handle, 'cuFileGetParameterString') - - global __cuFileSetParameterSizeT - __cuFileSetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileSetParameterSizeT') - if __cuFileSetParameterSizeT == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterSizeT = dlsym(handle, 'cuFileSetParameterSizeT') - - global __cuFileSetParameterBool - __cuFileSetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileSetParameterBool') - if __cuFileSetParameterBool == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterBool = dlsym(handle, 'cuFileSetParameterBool') - - global __cuFileSetParameterString - __cuFileSetParameterString = dlsym(RTLD_DEFAULT, 'cuFileSetParameterString') - if __cuFileSetParameterString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') - - global __cuFileDriverClose - __cuFileDriverClose = dlsym(RTLD_DEFAULT, 'cuFileDriverClose') - if __cuFileDriverClose == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverClose = dlsym(handle, 'cuFileDriverClose') - - global __cuFileGetParameterMinMaxValue - __cuFileGetParameterMinMaxValue = dlsym(RTLD_DEFAULT, 'cuFileGetParameterMinMaxValue') - if __cuFileGetParameterMinMaxValue == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterMinMaxValue = dlsym(handle, 'cuFileGetParameterMinMaxValue') - - global __cuFileSetStatsLevel - __cuFileSetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileSetStatsLevel') - if __cuFileSetStatsLevel == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetStatsLevel = dlsym(handle, 'cuFileSetStatsLevel') - - global __cuFileGetStatsLevel - __cuFileGetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileGetStatsLevel') - if __cuFileGetStatsLevel == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetStatsLevel = dlsym(handle, 'cuFileGetStatsLevel') - - global __cuFileStatsStart - __cuFileStatsStart = dlsym(RTLD_DEFAULT, 'cuFileStatsStart') - if __cuFileStatsStart == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStatsStart = dlsym(handle, 'cuFileStatsStart') - - global __cuFileStatsStop - __cuFileStatsStop = dlsym(RTLD_DEFAULT, 'cuFileStatsStop') - if __cuFileStatsStop == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStatsStop = dlsym(handle, 'cuFileStatsStop') - - global __cuFileStatsReset - __cuFileStatsReset = dlsym(RTLD_DEFAULT, 'cuFileStatsReset') - if __cuFileStatsReset == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStatsReset = dlsym(handle, 'cuFileStatsReset') - - global __cuFileGetStatsL1 - __cuFileGetStatsL1 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL1') - if __cuFileGetStatsL1 == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetStatsL1 = dlsym(handle, 'cuFileGetStatsL1') - - global __cuFileGetStatsL2 - __cuFileGetStatsL2 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL2') - if __cuFileGetStatsL2 == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetStatsL2 = dlsym(handle, 'cuFileGetStatsL2') - - global __cuFileGetStatsL3 - __cuFileGetStatsL3 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL3') - if __cuFileGetStatsL3 == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetStatsL3 = dlsym(handle, 'cuFileGetStatsL3') - - global __cuFileGetBARSizeInKB - __cuFileGetBARSizeInKB = dlsym(RTLD_DEFAULT, 'cuFileGetBARSizeInKB') - if __cuFileGetBARSizeInKB == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetBARSizeInKB = dlsym(handle, 'cuFileGetBARSizeInKB') - - global __cuFileSetParameterPosixPoolSlabArray - __cuFileSetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileSetParameterPosixPoolSlabArray') - if __cuFileSetParameterPosixPoolSlabArray == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileSetParameterPosixPoolSlabArray') - - global __cuFileGetParameterPosixPoolSlabArray - __cuFileGetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileGetParameterPosixPoolSlabArray') - if __cuFileGetParameterPosixPoolSlabArray == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileGetParameterPosixPoolSlabArray') - - __py_cufile_init = True - return 0 + #dlclose(handle) + handle = NULL + + # Load function + global __cuFileHandleRegister + __cuFileHandleRegister = dlsym(RTLD_DEFAULT, 'cuFileHandleRegister') + if __cuFileHandleRegister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileHandleRegister = dlsym(handle, 'cuFileHandleRegister') + + global __cuFileHandleDeregister + __cuFileHandleDeregister = dlsym(RTLD_DEFAULT, 'cuFileHandleDeregister') + if __cuFileHandleDeregister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileHandleDeregister = dlsym(handle, 'cuFileHandleDeregister') + + global __cuFileBufRegister + __cuFileBufRegister = dlsym(RTLD_DEFAULT, 'cuFileBufRegister') + if __cuFileBufRegister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBufRegister = dlsym(handle, 'cuFileBufRegister') + + global __cuFileBufDeregister + __cuFileBufDeregister = dlsym(RTLD_DEFAULT, 'cuFileBufDeregister') + if __cuFileBufDeregister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBufDeregister = dlsym(handle, 'cuFileBufDeregister') + + global __cuFileRead + __cuFileRead = dlsym(RTLD_DEFAULT, 'cuFileRead') + if __cuFileRead == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileRead = dlsym(handle, 'cuFileRead') + + global __cuFileWrite + __cuFileWrite = dlsym(RTLD_DEFAULT, 'cuFileWrite') + if __cuFileWrite == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileWrite = dlsym(handle, 'cuFileWrite') + + global __cuFileDriverOpen + __cuFileDriverOpen = dlsym(RTLD_DEFAULT, 'cuFileDriverOpen') + if __cuFileDriverOpen == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverOpen = dlsym(handle, 'cuFileDriverOpen') + + global __cuFileDriverClose_v2 + __cuFileDriverClose_v2 = dlsym(RTLD_DEFAULT, 'cuFileDriverClose_v2') + if __cuFileDriverClose_v2 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverClose_v2 = dlsym(handle, 'cuFileDriverClose_v2') + + global __cuFileUseCount + __cuFileUseCount = dlsym(RTLD_DEFAULT, 'cuFileUseCount') + if __cuFileUseCount == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileUseCount = dlsym(handle, 'cuFileUseCount') + + global __cuFileDriverGetProperties + __cuFileDriverGetProperties = dlsym(RTLD_DEFAULT, 'cuFileDriverGetProperties') + if __cuFileDriverGetProperties == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverGetProperties = dlsym(handle, 'cuFileDriverGetProperties') + + global __cuFileDriverSetPollMode + __cuFileDriverSetPollMode = dlsym(RTLD_DEFAULT, 'cuFileDriverSetPollMode') + if __cuFileDriverSetPollMode == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverSetPollMode = dlsym(handle, 'cuFileDriverSetPollMode') + + global __cuFileDriverSetMaxDirectIOSize + __cuFileDriverSetMaxDirectIOSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') + if __cuFileDriverSetMaxDirectIOSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverSetMaxDirectIOSize = dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') + + global __cuFileDriverSetMaxCacheSize + __cuFileDriverSetMaxCacheSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') + if __cuFileDriverSetMaxCacheSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverSetMaxCacheSize = dlsym(handle, 'cuFileDriverSetMaxCacheSize') + + global __cuFileDriverSetMaxPinnedMemSize + __cuFileDriverSetMaxPinnedMemSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') + if __cuFileDriverSetMaxPinnedMemSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverSetMaxPinnedMemSize = dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') + + global __cuFileBatchIOSetUp + __cuFileBatchIOSetUp = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSetUp') + if __cuFileBatchIOSetUp == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBatchIOSetUp = dlsym(handle, 'cuFileBatchIOSetUp') + + global __cuFileBatchIOSubmit + __cuFileBatchIOSubmit = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSubmit') + if __cuFileBatchIOSubmit == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBatchIOSubmit = dlsym(handle, 'cuFileBatchIOSubmit') + + global __cuFileBatchIOGetStatus + __cuFileBatchIOGetStatus = dlsym(RTLD_DEFAULT, 'cuFileBatchIOGetStatus') + if __cuFileBatchIOGetStatus == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBatchIOGetStatus = dlsym(handle, 'cuFileBatchIOGetStatus') + + global __cuFileBatchIOCancel + __cuFileBatchIOCancel = dlsym(RTLD_DEFAULT, 'cuFileBatchIOCancel') + if __cuFileBatchIOCancel == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBatchIOCancel = dlsym(handle, 'cuFileBatchIOCancel') + + global __cuFileBatchIODestroy + __cuFileBatchIODestroy = dlsym(RTLD_DEFAULT, 'cuFileBatchIODestroy') + if __cuFileBatchIODestroy == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileBatchIODestroy = dlsym(handle, 'cuFileBatchIODestroy') + + global __cuFileReadAsync + __cuFileReadAsync = dlsym(RTLD_DEFAULT, 'cuFileReadAsync') + if __cuFileReadAsync == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileReadAsync = dlsym(handle, 'cuFileReadAsync') + + global __cuFileWriteAsync + __cuFileWriteAsync = dlsym(RTLD_DEFAULT, 'cuFileWriteAsync') + if __cuFileWriteAsync == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileWriteAsync = dlsym(handle, 'cuFileWriteAsync') + + global __cuFileStreamRegister + __cuFileStreamRegister = dlsym(RTLD_DEFAULT, 'cuFileStreamRegister') + if __cuFileStreamRegister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStreamRegister = dlsym(handle, 'cuFileStreamRegister') + + global __cuFileStreamDeregister + __cuFileStreamDeregister = dlsym(RTLD_DEFAULT, 'cuFileStreamDeregister') + if __cuFileStreamDeregister == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStreamDeregister = dlsym(handle, 'cuFileStreamDeregister') + + global __cuFileGetVersion + __cuFileGetVersion = dlsym(RTLD_DEFAULT, 'cuFileGetVersion') + if __cuFileGetVersion == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetVersion = dlsym(handle, 'cuFileGetVersion') + + global __cuFileGetParameterSizeT + __cuFileGetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileGetParameterSizeT') + if __cuFileGetParameterSizeT == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterSizeT = dlsym(handle, 'cuFileGetParameterSizeT') + + global __cuFileGetParameterBool + __cuFileGetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileGetParameterBool') + if __cuFileGetParameterBool == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterBool = dlsym(handle, 'cuFileGetParameterBool') + + global __cuFileGetParameterString + __cuFileGetParameterString = dlsym(RTLD_DEFAULT, 'cuFileGetParameterString') + if __cuFileGetParameterString == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterString = dlsym(handle, 'cuFileGetParameterString') + + global __cuFileSetParameterSizeT + __cuFileSetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileSetParameterSizeT') + if __cuFileSetParameterSizeT == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetParameterSizeT = dlsym(handle, 'cuFileSetParameterSizeT') + + global __cuFileSetParameterBool + __cuFileSetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileSetParameterBool') + if __cuFileSetParameterBool == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetParameterBool = dlsym(handle, 'cuFileSetParameterBool') + + global __cuFileSetParameterString + __cuFileSetParameterString = dlsym(RTLD_DEFAULT, 'cuFileSetParameterString') + if __cuFileSetParameterString == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') + + global __cuFileDriverClose + __cuFileDriverClose = dlsym(RTLD_DEFAULT, 'cuFileDriverClose') + if __cuFileDriverClose == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileDriverClose = dlsym(handle, 'cuFileDriverClose') + + global __cuFileGetParameterMinMaxValue + __cuFileGetParameterMinMaxValue = dlsym(RTLD_DEFAULT, 'cuFileGetParameterMinMaxValue') + if __cuFileGetParameterMinMaxValue == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterMinMaxValue = dlsym(handle, 'cuFileGetParameterMinMaxValue') + + global __cuFileSetStatsLevel + __cuFileSetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileSetStatsLevel') + if __cuFileSetStatsLevel == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetStatsLevel = dlsym(handle, 'cuFileSetStatsLevel') + + global __cuFileGetStatsLevel + __cuFileGetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileGetStatsLevel') + if __cuFileGetStatsLevel == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsLevel = dlsym(handle, 'cuFileGetStatsLevel') + + global __cuFileStatsStart + __cuFileStatsStart = dlsym(RTLD_DEFAULT, 'cuFileStatsStart') + if __cuFileStatsStart == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsStart = dlsym(handle, 'cuFileStatsStart') + + global __cuFileStatsStop + __cuFileStatsStop = dlsym(RTLD_DEFAULT, 'cuFileStatsStop') + if __cuFileStatsStop == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsStop = dlsym(handle, 'cuFileStatsStop') + + global __cuFileStatsReset + __cuFileStatsReset = dlsym(RTLD_DEFAULT, 'cuFileStatsReset') + if __cuFileStatsReset == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileStatsReset = dlsym(handle, 'cuFileStatsReset') + + global __cuFileGetStatsL1 + __cuFileGetStatsL1 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL1') + if __cuFileGetStatsL1 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL1 = dlsym(handle, 'cuFileGetStatsL1') + + global __cuFileGetStatsL2 + __cuFileGetStatsL2 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL2') + if __cuFileGetStatsL2 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL2 = dlsym(handle, 'cuFileGetStatsL2') + + global __cuFileGetStatsL3 + __cuFileGetStatsL3 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL3') + if __cuFileGetStatsL3 == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetStatsL3 = dlsym(handle, 'cuFileGetStatsL3') + + global __cuFileGetBARSizeInKB + __cuFileGetBARSizeInKB = dlsym(RTLD_DEFAULT, 'cuFileGetBARSizeInKB') + if __cuFileGetBARSizeInKB == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetBARSizeInKB = dlsym(handle, 'cuFileGetBARSizeInKB') + + global __cuFileSetParameterPosixPoolSlabArray + __cuFileSetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileSetParameterPosixPoolSlabArray') + if __cuFileSetParameterPosixPoolSlabArray == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileSetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileSetParameterPosixPoolSlabArray') + + global __cuFileGetParameterPosixPoolSlabArray + __cuFileGetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileGetParameterPosixPoolSlabArray') + if __cuFileGetParameterPosixPoolSlabArray == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __cuFileGetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileGetParameterPosixPoolSlabArray') + + __py_cufile_init = True + return 0 cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index be773bdf2..32ec53489 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -5,11 +5,13 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib + ############################################################################### # Extern ############################################################################### @@ -33,6 +35,7 @@ cdef extern from "" nogil: # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False cdef void* __cuDriverGetVersion = NULL @@ -62,128 +65,127 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: if __py_nvjitlink_init: return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: + cdef int err, driver_ver = 0 + + with gil, __symbol_lock: + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: err_msg = dlerror() raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: + global __cuDriverGetVersion + if __cuDriverGetVersion == NULL: + __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if __cuDriverGetVersion == NULL: raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: + err = (__cuDriverGetVersion)(&driver_ver) + if err != 0: raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - - # Load function - global __nvJitLinkCreate - __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') - if __nvJitLinkCreate == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkCreate = dlsym(handle, 'nvJitLinkCreate') - - global __nvJitLinkDestroy - __nvJitLinkDestroy = dlsym(RTLD_DEFAULT, 'nvJitLinkDestroy') - if __nvJitLinkDestroy == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkDestroy = dlsym(handle, 'nvJitLinkDestroy') - - global __nvJitLinkAddData - __nvJitLinkAddData = dlsym(RTLD_DEFAULT, 'nvJitLinkAddData') - if __nvJitLinkAddData == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkAddData = dlsym(handle, 'nvJitLinkAddData') - - global __nvJitLinkAddFile - __nvJitLinkAddFile = dlsym(RTLD_DEFAULT, 'nvJitLinkAddFile') - if __nvJitLinkAddFile == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkAddFile = dlsym(handle, 'nvJitLinkAddFile') - - global __nvJitLinkComplete - __nvJitLinkComplete = dlsym(RTLD_DEFAULT, 'nvJitLinkComplete') - if __nvJitLinkComplete == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkComplete = dlsym(handle, 'nvJitLinkComplete') - - global __nvJitLinkGetLinkedCubinSize - __nvJitLinkGetLinkedCubinSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') - if __nvJitLinkGetLinkedCubinSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedCubinSize = dlsym(handle, 'nvJitLinkGetLinkedCubinSize') - - global __nvJitLinkGetLinkedCubin - __nvJitLinkGetLinkedCubin = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') - if __nvJitLinkGetLinkedCubin == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedCubin = dlsym(handle, 'nvJitLinkGetLinkedCubin') - - global __nvJitLinkGetLinkedPtxSize - __nvJitLinkGetLinkedPtxSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') - if __nvJitLinkGetLinkedPtxSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedPtxSize = dlsym(handle, 'nvJitLinkGetLinkedPtxSize') - - global __nvJitLinkGetLinkedPtx - __nvJitLinkGetLinkedPtx = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') - if __nvJitLinkGetLinkedPtx == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedPtx = dlsym(handle, 'nvJitLinkGetLinkedPtx') - - global __nvJitLinkGetErrorLogSize - __nvJitLinkGetErrorLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') - if __nvJitLinkGetErrorLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetErrorLogSize = dlsym(handle, 'nvJitLinkGetErrorLogSize') - - global __nvJitLinkGetErrorLog - __nvJitLinkGetErrorLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLog') - if __nvJitLinkGetErrorLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetErrorLog = dlsym(handle, 'nvJitLinkGetErrorLog') - - global __nvJitLinkGetInfoLogSize - __nvJitLinkGetInfoLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') - if __nvJitLinkGetInfoLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetInfoLogSize = dlsym(handle, 'nvJitLinkGetInfoLogSize') - - global __nvJitLinkGetInfoLog - __nvJitLinkGetInfoLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLog') - if __nvJitLinkGetInfoLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetInfoLog = dlsym(handle, 'nvJitLinkGetInfoLog') - - global __nvJitLinkVersion - __nvJitLinkVersion = dlsym(RTLD_DEFAULT, 'nvJitLinkVersion') - if __nvJitLinkVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') - - __py_nvjitlink_init = True - return 0 + #dlclose(handle) + handle = NULL + + # Load function + global __nvJitLinkCreate + __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') + if __nvJitLinkCreate == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkCreate = dlsym(handle, 'nvJitLinkCreate') + + global __nvJitLinkDestroy + __nvJitLinkDestroy = dlsym(RTLD_DEFAULT, 'nvJitLinkDestroy') + if __nvJitLinkDestroy == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkDestroy = dlsym(handle, 'nvJitLinkDestroy') + + global __nvJitLinkAddData + __nvJitLinkAddData = dlsym(RTLD_DEFAULT, 'nvJitLinkAddData') + if __nvJitLinkAddData == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkAddData = dlsym(handle, 'nvJitLinkAddData') + + global __nvJitLinkAddFile + __nvJitLinkAddFile = dlsym(RTLD_DEFAULT, 'nvJitLinkAddFile') + if __nvJitLinkAddFile == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkAddFile = dlsym(handle, 'nvJitLinkAddFile') + + global __nvJitLinkComplete + __nvJitLinkComplete = dlsym(RTLD_DEFAULT, 'nvJitLinkComplete') + if __nvJitLinkComplete == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkComplete = dlsym(handle, 'nvJitLinkComplete') + + global __nvJitLinkGetLinkedCubinSize + __nvJitLinkGetLinkedCubinSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') + if __nvJitLinkGetLinkedCubinSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetLinkedCubinSize = dlsym(handle, 'nvJitLinkGetLinkedCubinSize') + + global __nvJitLinkGetLinkedCubin + __nvJitLinkGetLinkedCubin = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') + if __nvJitLinkGetLinkedCubin == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetLinkedCubin = dlsym(handle, 'nvJitLinkGetLinkedCubin') + + global __nvJitLinkGetLinkedPtxSize + __nvJitLinkGetLinkedPtxSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') + if __nvJitLinkGetLinkedPtxSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetLinkedPtxSize = dlsym(handle, 'nvJitLinkGetLinkedPtxSize') + + global __nvJitLinkGetLinkedPtx + __nvJitLinkGetLinkedPtx = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') + if __nvJitLinkGetLinkedPtx == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetLinkedPtx = dlsym(handle, 'nvJitLinkGetLinkedPtx') + + global __nvJitLinkGetErrorLogSize + __nvJitLinkGetErrorLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') + if __nvJitLinkGetErrorLogSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetErrorLogSize = dlsym(handle, 'nvJitLinkGetErrorLogSize') + + global __nvJitLinkGetErrorLog + __nvJitLinkGetErrorLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLog') + if __nvJitLinkGetErrorLog == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetErrorLog = dlsym(handle, 'nvJitLinkGetErrorLog') + + global __nvJitLinkGetInfoLogSize + __nvJitLinkGetInfoLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') + if __nvJitLinkGetInfoLogSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetInfoLogSize = dlsym(handle, 'nvJitLinkGetInfoLogSize') + + global __nvJitLinkGetInfoLog + __nvJitLinkGetInfoLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLog') + if __nvJitLinkGetInfoLog == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkGetInfoLog = dlsym(handle, 'nvJitLinkGetInfoLog') + + global __nvJitLinkVersion + __nvJitLinkVersion = dlsym(RTLD_DEFAULT, 'nvJitLinkVersion') + if __nvJitLinkVersion == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') + + __py_nvjitlink_init = True + return 0 cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 88489448b..272fb67fe 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -5,6 +5,7 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError @@ -20,6 +21,7 @@ import win32api LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False cdef void* __cuDriverGetVersion = NULL @@ -44,8 +46,9 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: if __py_nvjitlink_init: return 0 - cdef int err, driver_ver - with gil: + cdef int err, driver_ver = 0 + + with gil, __symbol_lock: # Load driver to check version try: handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) @@ -148,8 +151,8 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: except: pass - __py_nvjitlink_init = True - return 0 + __py_nvjitlink_init = True + return 0 cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index e07e94a5a..33c25d4aa 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -5,11 +5,13 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib + ############################################################################### # Extern ############################################################################### @@ -33,6 +35,7 @@ cdef extern from "" nogil: # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False cdef void* __cuDriverGetVersion = NULL @@ -61,121 +64,120 @@ cdef int _check_or_init_nvvm() except -1 nogil: if __py_nvvm_init: return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: + cdef int err, driver_ver = 0 + + with gil, __symbol_lock: + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: err_msg = dlerror() raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: + global __cuDriverGetVersion + if __cuDriverGetVersion == NULL: + __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if __cuDriverGetVersion == NULL: raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: + err = (__cuDriverGetVersion)(&driver_ver) + if err != 0: raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - - # Load function - global __nvvmGetErrorString - __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') - if __nvvmGetErrorString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetErrorString = dlsym(handle, 'nvvmGetErrorString') - - global __nvvmVersion - __nvvmVersion = dlsym(RTLD_DEFAULT, 'nvvmVersion') - if __nvvmVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmVersion = dlsym(handle, 'nvvmVersion') - - global __nvvmIRVersion - __nvvmIRVersion = dlsym(RTLD_DEFAULT, 'nvvmIRVersion') - if __nvvmIRVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmIRVersion = dlsym(handle, 'nvvmIRVersion') - - global __nvvmCreateProgram - __nvvmCreateProgram = dlsym(RTLD_DEFAULT, 'nvvmCreateProgram') - if __nvvmCreateProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmCreateProgram = dlsym(handle, 'nvvmCreateProgram') - - global __nvvmDestroyProgram - __nvvmDestroyProgram = dlsym(RTLD_DEFAULT, 'nvvmDestroyProgram') - if __nvvmDestroyProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmDestroyProgram = dlsym(handle, 'nvvmDestroyProgram') - - global __nvvmAddModuleToProgram - __nvvmAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmAddModuleToProgram') - if __nvvmAddModuleToProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmAddModuleToProgram = dlsym(handle, 'nvvmAddModuleToProgram') - - global __nvvmLazyAddModuleToProgram - __nvvmLazyAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') - if __nvvmLazyAddModuleToProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmLazyAddModuleToProgram = dlsym(handle, 'nvvmLazyAddModuleToProgram') - - global __nvvmCompileProgram - __nvvmCompileProgram = dlsym(RTLD_DEFAULT, 'nvvmCompileProgram') - if __nvvmCompileProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmCompileProgram = dlsym(handle, 'nvvmCompileProgram') - - global __nvvmVerifyProgram - __nvvmVerifyProgram = dlsym(RTLD_DEFAULT, 'nvvmVerifyProgram') - if __nvvmVerifyProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmVerifyProgram = dlsym(handle, 'nvvmVerifyProgram') - - global __nvvmGetCompiledResultSize - __nvvmGetCompiledResultSize = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResultSize') - if __nvvmGetCompiledResultSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetCompiledResultSize = dlsym(handle, 'nvvmGetCompiledResultSize') - - global __nvvmGetCompiledResult - __nvvmGetCompiledResult = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResult') - if __nvvmGetCompiledResult == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetCompiledResult = dlsym(handle, 'nvvmGetCompiledResult') - - global __nvvmGetProgramLogSize - __nvvmGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLogSize') - if __nvvmGetProgramLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetProgramLogSize = dlsym(handle, 'nvvmGetProgramLogSize') - - global __nvvmGetProgramLog - __nvvmGetProgramLog = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLog') - if __nvvmGetProgramLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') - - __py_nvvm_init = True - return 0 + #dlclose(handle) + handle = NULL + + # Load function + global __nvvmGetErrorString + __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') + if __nvvmGetErrorString == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmGetErrorString = dlsym(handle, 'nvvmGetErrorString') + + global __nvvmVersion + __nvvmVersion = dlsym(RTLD_DEFAULT, 'nvvmVersion') + if __nvvmVersion == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmVersion = dlsym(handle, 'nvvmVersion') + + global __nvvmIRVersion + __nvvmIRVersion = dlsym(RTLD_DEFAULT, 'nvvmIRVersion') + if __nvvmIRVersion == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmIRVersion = dlsym(handle, 'nvvmIRVersion') + + global __nvvmCreateProgram + __nvvmCreateProgram = dlsym(RTLD_DEFAULT, 'nvvmCreateProgram') + if __nvvmCreateProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmCreateProgram = dlsym(handle, 'nvvmCreateProgram') + + global __nvvmDestroyProgram + __nvvmDestroyProgram = dlsym(RTLD_DEFAULT, 'nvvmDestroyProgram') + if __nvvmDestroyProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmDestroyProgram = dlsym(handle, 'nvvmDestroyProgram') + + global __nvvmAddModuleToProgram + __nvvmAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmAddModuleToProgram') + if __nvvmAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmAddModuleToProgram = dlsym(handle, 'nvvmAddModuleToProgram') + + global __nvvmLazyAddModuleToProgram + __nvvmLazyAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') + if __nvvmLazyAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmLazyAddModuleToProgram = dlsym(handle, 'nvvmLazyAddModuleToProgram') + + global __nvvmCompileProgram + __nvvmCompileProgram = dlsym(RTLD_DEFAULT, 'nvvmCompileProgram') + if __nvvmCompileProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmCompileProgram = dlsym(handle, 'nvvmCompileProgram') + + global __nvvmVerifyProgram + __nvvmVerifyProgram = dlsym(RTLD_DEFAULT, 'nvvmVerifyProgram') + if __nvvmVerifyProgram == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmVerifyProgram = dlsym(handle, 'nvvmVerifyProgram') + + global __nvvmGetCompiledResultSize + __nvvmGetCompiledResultSize = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResultSize') + if __nvvmGetCompiledResultSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmGetCompiledResultSize = dlsym(handle, 'nvvmGetCompiledResultSize') + + global __nvvmGetCompiledResult + __nvvmGetCompiledResult = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResult') + if __nvvmGetCompiledResult == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmGetCompiledResult = dlsym(handle, 'nvvmGetCompiledResult') + + global __nvvmGetProgramLogSize + __nvvmGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLogSize') + if __nvvmGetProgramLogSize == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmGetProgramLogSize = dlsym(handle, 'nvvmGetProgramLogSize') + + global __nvvmGetProgramLog + __nvvmGetProgramLog = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLog') + if __nvvmGetProgramLog == NULL: + if handle == NULL: + handle = load_library(driver_ver) + __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') + + __py_nvvm_init = True + return 0 cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index ecf704324..9a88b4dce 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -5,6 +5,7 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError @@ -20,6 +21,7 @@ import win32api LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False cdef void* __cuDriverGetVersion = NULL @@ -43,8 +45,9 @@ cdef int _check_or_init_nvvm() except -1 nogil: if __py_nvvm_init: return 0 - cdef int err, driver_ver - with gil: + cdef int err, driver_ver = 0 + + with gil, __symbol_lock: # Load driver to check version try: handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) @@ -141,8 +144,8 @@ cdef int _check_or_init_nvvm() except -1 nogil: except: pass - __py_nvvm_init = True - return 0 + __py_nvvm_init = True + return 0 cdef dict func_ptrs = None From 0932878e41e99e89dcfbb0e33c564d711a925bf2 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 18 Aug 2025 09:56:06 -0400 Subject: [PATCH 027/113] Bump version and add release notes (#841) * bump version and add release notes * complete doc changes * fix typo in hyperlink --- cuda_bindings/cuda/bindings/_version.py | 2 +- cuda_bindings/docs/source/release.rst | 2 ++ .../docs/source/release/12.9.2-notes.rst | 21 +++++++++++++++++++ .../docs/source/release/13.0.1-notes.rst | 21 +++++++++++++++++++ cuda_bindings/docs/versions.json | 1 + cuda_python/docs/source/index.rst | 2 +- cuda_python/docs/source/release.md | 2 ++ .../docs/source/release/12.9.2-notes.rst | 20 ++++++++++++++++++ .../docs/source/release/13.0.1-notes.rst | 20 ++++++++++++++++++ cuda_python/docs/versions.json | 1 + 10 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 cuda_bindings/docs/source/release/12.9.2-notes.rst create mode 100644 cuda_bindings/docs/source/release/13.0.1-notes.rst create mode 100644 cuda_python/docs/source/release/12.9.2-notes.rst create mode 100644 cuda_python/docs/source/release/13.0.1-notes.rst diff --git a/cuda_bindings/cuda/bindings/_version.py b/cuda_bindings/cuda/bindings/_version.py index e695b83a8..00adf6d46 100644 --- a/cuda_bindings/cuda/bindings/_version.py +++ b/cuda_bindings/cuda/bindings/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -__version__ = "13.0.1a0" +__version__ = "13.0.1" diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst index 057a1c666..7cc3471d0 100644 --- a/cuda_bindings/docs/source/release.rst +++ b/cuda_bindings/docs/source/release.rst @@ -7,7 +7,9 @@ Release Notes .. toctree:: :maxdepth: 3 + 13.0.1 13.0.0 + 12.9.2 12.9.1 12.9.0 12.8.0 diff --git a/cuda_bindings/docs/source/release/12.9.2-notes.rst b/cuda_bindings/docs/source/release/12.9.2-notes.rst new file mode 100644 index 000000000..b22bdb394 --- /dev/null +++ b/cuda_bindings/docs/source/release/12.9.2-notes.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.2 Release notes +====================================== + +Released on Aug 18, 2025 + + +Highlights +---------- + +* Make populating the internal symbol table thread-safe. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/docs/source/release/13.0.1-notes.rst b/cuda_bindings/docs/source/release/13.0.1-notes.rst new file mode 100644 index 000000000..1280de460 --- /dev/null +++ b/cuda_bindings/docs/source/release/13.0.1-notes.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +.. module:: cuda.bindings + +``cuda-bindings`` 13.0.1 Release notes +====================================== + +Released on Aug 18, 2025 + + +Highlights +---------- + +* Make populating the internal symbol table thread-safe. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/docs/versions.json b/cuda_bindings/docs/versions.json index c174c4eee..76c66eca8 100644 --- a/cuda_bindings/docs/versions.json +++ b/cuda_bindings/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", + "13.0.1" : "13.0.1", "13.0.0" : "13.0.0", "12.9.0" : "12.9.0", "12.8.0" : "12.8.0", diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index f0ed6f52d..49a53b649 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -9,7 +9,7 @@ multiple components: - `cuda.core`_: Pythonic access to CUDA runtime and other core functionalities - `cuda.bindings`_: Low-level Python bindings to CUDA C APIs -- `cuda.pathfinder_`: Utilities for locating CUDA components installed in the user's Python environment +- `cuda.pathfinder`_: Utilities for locating CUDA components installed in the user's Python environment - `cuda.cccl.cooperative`_: A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels - `cuda.cccl.parallel`_: A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like ``sort``, ``scan``, ``reduce``, ``transform``, etc, that are callable on the *host* - `numba.cuda`_: Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. diff --git a/cuda_python/docs/source/release.md b/cuda_python/docs/source/release.md index e7e264bd1..c73f21ef4 100644 --- a/cuda_python/docs/source/release.md +++ b/cuda_python/docs/source/release.md @@ -5,7 +5,9 @@ maxdepth: 3 --- + 13.0.1 13.0.0 + 12.9.2 12.9.1 12.9.0 12.8.0 diff --git a/cuda_python/docs/source/release/12.9.2-notes.rst b/cuda_python/docs/source/release/12.9.2-notes.rst new file mode 100644 index 000000000..b013200d3 --- /dev/null +++ b/cuda_python/docs/source/release/12.9.2-notes.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.9.2 Release notes +================================ + +Released on Aug 18, 2025. + + +Included components +------------------- + +* `cuda.bindings 12.9.2 `_ +* `cuda.pathfinder 1.1.0 `_ + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_python/docs/source/release/13.0.1-notes.rst b/cuda_python/docs/source/release/13.0.1-notes.rst new file mode 100644 index 000000000..bda13e9c6 --- /dev/null +++ b/cuda_python/docs/source/release/13.0.1-notes.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 13.0.1 Release notes +================================ + +Released on Aug 18, 2025. + + +Included components +------------------- + +* `cuda.bindings 13.0.1 `_ +* `cuda.pathfinder 1.1.0 `_ + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_python/docs/versions.json b/cuda_python/docs/versions.json index c174c4eee..76c66eca8 100644 --- a/cuda_python/docs/versions.json +++ b/cuda_python/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", + "13.0.1" : "13.0.1", "13.0.0" : "13.0.0", "12.9.0" : "12.9.0", "12.8.0" : "12.8.0", From 127f798970608951162504ad44d18f11e9324b8f Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 18 Aug 2025 09:17:47 -0700 Subject: [PATCH 028/113] [pathfinder] `RTLD_DI_LINKMAP`-based new implementation of `abs_path_for_dynamic_library()` (#834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use RTLD_DI_LINKMAP in abs_path_for_dynamic_library(), to eliminate need for EXPECTED_LIB_SYMBOLS * load_dl_linux.py: factor out get_candidate_sonames() and also use from check_if_already_loaded_from_elsewhere(), for consistency with load_with_system_search() * load_dl_windows.py: avoid unnecessary function-level imports (this was just an oversight) * Bump cuda-pathfinder version to `1.1.1a1` * Harden/polish the new abs_path_for_dynamic_library() implementation. * Eliminate `class LinkMap(ctypes.Structure)` and rely purely on pointer arithmetic instead. Use `os.fsdecode()` instead of `l_name.decode()` to avoid `UnicodeDecodeError` * Ensure `_dl_last_error()` does not raise `UnicodeDecodeError` * Add `validate_abs_path()` in test_load_nvidia_dynamic_lib.py * Change back to more intutive approach, using `_LinkMapLNameView` as name. Explain safety constraints in depth. * l_origin + basename(l_name) → abs_path --- .../pathfinder/_dynamic_libs/load_dl_linux.py | 142 +++++++++++++----- .../_dynamic_libs/load_dl_windows.py | 11 +- .../_dynamic_libs/supported_nvidia_libs.py | 37 ----- cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- .../tests/test_load_nvidia_dynamic_lib.py | 14 +- 5 files changed, 117 insertions(+), 89 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index 29192ec4c..a71019d1a 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -5,57 +5,126 @@ import ctypes import ctypes.util import os -from typing import Optional +from typing import Optional, cast from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import SUPPORTED_LINUX_SONAMES CDLL_MODE = os.RTLD_NOW | os.RTLD_GLOBAL -LIBDL_PATH = ctypes.util.find_library("dl") or "libdl.so.2" -LIBDL = ctypes.CDLL(LIBDL_PATH) -LIBDL.dladdr.argtypes = [ctypes.c_void_p, ctypes.c_void_p] -LIBDL.dladdr.restype = ctypes.c_int +def _load_libdl() -> ctypes.CDLL: + # In normal glibc-based Linux environments, find_library("dl") should return + # something like "libdl.so.2". In minimal or stripped-down environments + # (no ldconfig/gcc, incomplete linker cache), this can return None even + # though libdl is present. In that case, we fall back to the stable SONAME. + name = ctypes.util.find_library("dl") or "libdl.so.2" + try: + return ctypes.CDLL(name) + except OSError as e: + raise RuntimeError(f"Could not load {name!r} (required for dlinfo/dlerror on Linux)") from e + + +LIBDL = _load_libdl() + +# dlinfo +LIBDL.dlinfo.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p] +LIBDL.dlinfo.restype = ctypes.c_int + +# dlerror (thread-local error string; cleared after read) +LIBDL.dlerror.argtypes = [] +LIBDL.dlerror.restype = ctypes.c_char_p + +# First appeared in 2004-era glibc. Universally correct on Linux for all practical purposes. +RTLD_DI_LINKMAP = 2 +RTLD_DI_ORIGIN = 6 -class DlInfo(ctypes.Structure): - """Structure used by dladdr to return information about a loaded symbol.""" + +class _LinkMapLNameView(ctypes.Structure): + """ + Prefix-only view of glibc's `struct link_map` used **solely** to read `l_name`. + + Background: + - `dlinfo(handle, RTLD_DI_LINKMAP, ...)` returns a `struct link_map*`. + - The first few members of `struct link_map` (including `l_name`) have been + stable on glibc for decades and are documented as debugger-visible. + - We only need the offset/layout of `l_name`, not the full struct. + + Safety constraints: + - This is a **partial** definition (prefix). It must only be used via a pointer + returned by `dlinfo(...)`. + - Do **not** instantiate it or pass it **by value** to any C function. + - Do **not** access any members beyond those declared here. + - Do **not** rely on `ctypes.sizeof(LinkMapPrefix)` for allocation. + + Rationale: + - Defining only the leading fields avoids depending on internal/unstable + tail members while keeping code more readable than raw pointer arithmetic. + """ _fields_ = ( - ("dli_fname", ctypes.c_char_p), # path to .so - ("dli_fbase", ctypes.c_void_p), - ("dli_sname", ctypes.c_char_p), - ("dli_saddr", ctypes.c_void_p), + ("l_addr", ctypes.c_void_p), # ElfW(Addr) + ("l_name", ctypes.c_char_p), # char* ) -def abs_path_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> Optional[str]: - """Get the absolute path of a loaded dynamic library on Linux. +# Defensive assertions, mainly to document the invariants we depend on +assert _LinkMapLNameView.l_addr.offset == 0 +assert _LinkMapLNameView.l_name.offset == ctypes.sizeof(ctypes.c_void_p) - Args: - libname: The name of the library - handle: The library handle - Returns: - The absolute path to the library file, or None if no expected symbol is found +def _dl_last_error() -> Optional[str]: + msg_bytes = cast(Optional[bytes], LIBDL.dlerror()) + if not msg_bytes: + return None # no pending error + # Never raises; undecodable bytes are mapped to U+DC80..U+DCFF + return msg_bytes.decode("utf-8", "surrogateescape") - Raises: - OSError: If dladdr fails to get information about the symbol - """ - from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import EXPECTED_LIB_SYMBOLS - for symbol_name in EXPECTED_LIB_SYMBOLS[libname]: - symbol = getattr(handle, symbol_name, None) - if symbol is not None: - break - else: - return None +def l_name_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + lm_view = ctypes.POINTER(_LinkMapLNameView)() + rc = LIBDL.dlinfo(ctypes.c_void_p(handle._handle), RTLD_DI_LINKMAP, ctypes.byref(lm_view)) + if rc != 0: + err = _dl_last_error() + raise OSError(f"dlinfo failed for {libname=!r} (rc={rc})" + (f": {err}" if err else "")) + if not lm_view: # NULL link_map** + raise OSError(f"dlinfo returned NULL link_map pointer for {libname=!r}") - addr = ctypes.cast(symbol, ctypes.c_void_p) - info = DlInfo() - if LIBDL.dladdr(addr, ctypes.byref(info)) == 0: - raise OSError(f"dladdr failed for {libname=!r}") - return info.dli_fname.decode() # type: ignore[no-any-return] + l_name_bytes = lm_view.contents.l_name + if not l_name_bytes: + raise OSError(f"dlinfo returned empty link_map->l_name for {libname=!r}") + + path = os.fsdecode(l_name_bytes) + if not path: + raise OSError(f"dlinfo returned empty l_name string for {libname=!r}") + + return path + + +def l_origin_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + l_origin_buf = ctypes.create_string_buffer(4096) + rc = LIBDL.dlinfo(ctypes.c_void_p(handle._handle), RTLD_DI_ORIGIN, l_origin_buf) + if rc != 0: + err = _dl_last_error() + raise OSError(f"dlinfo failed for {libname=!r} (rc={rc})" + (f": {err}" if err else "")) + + path = os.fsdecode(l_origin_buf.value) + if not path: + raise OSError(f"dlinfo returned empty l_origin string for {libname=!r}") + + return path + + +def abs_path_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + l_name = l_name_for_dynamic_library(libname, handle) + l_origin = l_origin_for_dynamic_library(libname, handle) + return os.path.join(l_origin, os.path.basename(l_name)) + + +def get_candidate_sonames(libname: str) -> list[str]: + candidate_sonames = list(SUPPORTED_LINUX_SONAMES.get(libname, ())) + candidate_sonames.append(f"lib{libname}.so") + return candidate_sonames def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]: @@ -72,9 +141,8 @@ def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]: >>> if loaded is not None: ... print(f"Library already loaded from {loaded.abs_path}") """ - from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import SUPPORTED_LINUX_SONAMES - for soname in SUPPORTED_LINUX_SONAMES.get(libname, ()): + for soname in get_candidate_sonames(libname): try: handle = ctypes.CDLL(soname, mode=os.RTLD_NOLOAD) except OSError: @@ -96,9 +164,7 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: Raises: RuntimeError: If the library is loaded but no expected symbol is found """ - candidate_sonames = list(SUPPORTED_LINUX_SONAMES.get(libname, ())) - candidate_sonames.append(f"lib{libname}.so") - for soname in candidate_sonames: + for soname in get_candidate_sonames(libname): try: handle = ctypes.CDLL(soname, CDLL_MODE) abs_path = abs_path_for_dynamic_library(libname, handle) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py index c3fc11fd6..d8e1e3d51 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py @@ -8,6 +8,10 @@ from typing import Optional from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( + LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY, + SUPPORTED_WINDOWS_DLLS, +) # Mirrors WinBase.h (unfortunately not defined already elsewhere) WINBASE_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 @@ -110,7 +114,6 @@ def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]: >>> if loaded is not None: ... print(f"Library already loaded from {loaded.abs_path}") """ - from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import SUPPORTED_WINDOWS_DLLS for dll_name in SUPPORTED_WINDOWS_DLLS.get(libname, ()): handle = kernel32.GetModuleHandleW(dll_name) @@ -129,8 +132,6 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: Returns: A LoadedDL object if successful, None if the library cannot be loaded """ - from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import SUPPORTED_WINDOWS_DLLS - for dll_name in SUPPORTED_WINDOWS_DLLS.get(libname, ()): handle = kernel32.LoadLibraryExW(dll_name, None, 0) if handle: @@ -153,10 +154,6 @@ def load_with_abs_path(libname: str, found_path: str) -> LoadedDL: Raises: RuntimeError: If the DLL cannot be loaded """ - from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( - LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY, - ) - if libname in LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY: add_dll_directory(found_path) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index 14901c3e1..ee41a48b4 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -6,7 +6,6 @@ # SUPPORTED_LIBNAMES # SUPPORTED_WINDOWS_DLLS # SUPPORTED_LINUX_SONAMES -# EXPECTED_LIB_SYMBOLS import sys @@ -401,39 +400,3 @@ def is_suppressed_dll_file(path_basename: str) -> bool: # nvrtc64_120_0.dll return path_basename.endswith(".alt.dll") or "-builtins" in path_basename return path_basename.startswith(("cudart32_", "nvvm32")) - - -# Based on `nm -D --defined-only` output for Linux x86_64 distributions. -EXPECTED_LIB_SYMBOLS = { - "nvJitLink": ( - "__nvJitLinkCreate_12_0", # 12.0 through 12.9 - "nvJitLinkVersion", # 12.3 and up - ), - "nvrtc": ("nvrtcVersion",), - "nvvm": ("nvvmVersion",), - "cudart": ("cudaRuntimeGetVersion",), - "nvfatbin": ("nvFatbinVersion",), - "cublas": ("cublasGetVersion",), - "cublasLt": ("cublasLtGetVersion",), - "cufft": ("cufftGetVersion",), - "cufftw": ("fftwf_malloc",), - "curand": ("curandGetVersion",), - "cusolver": ("cusolverGetVersion",), - "cusolverMg": ("cusolverMgCreate",), - "cusparse": ("cusparseGetVersion",), - "nppc": ("nppGetLibVersion",), - "nppial": ("nppiAdd_32f_C1R_Ctx",), - "nppicc": ("nppiColorToGray_8u_C3C1R_Ctx",), - "nppidei": ("nppiCopy_8u_C1R_Ctx",), - "nppif": ("nppiFilterSobelHorizBorder_8u_C1R_Ctx",), - "nppig": ("nppiResize_8u_C1R_Ctx",), - "nppim": ("nppiErode_8u_C1R_Ctx",), - "nppist": ("nppiMean_8u_C1R_Ctx",), - "nppisu": ("nppiFree",), - "nppitc": ("nppiThreshold_8u_C1R_Ctx",), - "npps": ("nppsAdd_32f_Ctx",), - "nvblas": ("dgemm",), - "cufile": ("cuFileGetVersion",), - # "cufile_rdma": ("rdma_buffer_reg",), - "nvjpeg": ("nvjpegCreate",), -} diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index c2de46d74..f543585a5 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.1.1a0" +__version__ = "1.1.1a1" diff --git a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py index 26d8eabec..6b8302c15 100644 --- a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py @@ -46,12 +46,6 @@ def test_supported_libnames_windows_libnames_requiring_os_add_dll_directory_cons ) -def test_supported_libnames_all_expected_lib_symbols_consistency(): - assert tuple(sorted(supported_nvidia_libs.SUPPORTED_LIBNAMES_ALL)) == tuple( - sorted(supported_nvidia_libs.EXPECTED_LIB_SYMBOLS.keys()) - ) - - def test_runtime_error_on_non_64bit_python(): with ( patch("struct.calcsize", return_value=3), # fake 24-bit pointer @@ -68,6 +62,12 @@ def build_child_process_failed_for_libname_message(libname, result): ) +def validate_abs_path(abs_path): + assert abs_path, f"empty path: {abs_path=!r}" + assert os.path.isabs(abs_path), f"not absolute: {abs_path=!r}" + assert os.path.isfile(abs_path), f"not a file: {abs_path=!r}" + + def child_process_func(libname): import os @@ -76,6 +76,7 @@ def child_process_func(libname): loaded_dl_fresh = load_nvidia_dynamic_lib(libname) if loaded_dl_fresh.was_already_loaded_from_elsewhere: raise RuntimeError("loaded_dl_fresh.was_already_loaded_from_elsewhere") + validate_abs_path(loaded_dl_fresh.abs_path) loaded_dl_from_cache = load_nvidia_dynamic_lib(libname) if loaded_dl_from_cache is not loaded_dl_fresh: @@ -86,6 +87,7 @@ def child_process_func(libname): raise RuntimeError("loaded_dl_no_cache.was_already_loaded_from_elsewhere") if not os.path.samefile(loaded_dl_no_cache.abs_path, loaded_dl_fresh.abs_path): raise RuntimeError(f"not os.path.samefile({loaded_dl_no_cache.abs_path=!r}, {loaded_dl_fresh.abs_path=!r})") + validate_abs_path(loaded_dl_no_cache.abs_path) sys.stdout.write(f"{loaded_dl_fresh.abs_path!r}\n") From 229e8933d9e715c9ca122b06724b2acea31d8910 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 18 Aug 2025 22:18:22 -0400 Subject: [PATCH 029/113] Improve #789: Remove cyclical dependency between cuda.bindings.{driver|runtime} and c.b.utils (#840) * Improve #789: Remove cyclical dependency between {driver|runtime} and utils Rather than having bindings.utils._get_handle.pyx depend on driver and runtime and define the getters there, this flips things so driver and runtime register their own handlers. * Defer imports * cdef on _add_cuda_native_handlers --------- Co-authored-by: Leo Fang --- cuda_bindings/cuda/bindings/driver.pyx.in | 122 +++++++++ cuda_bindings/cuda/bindings/runtime.pyx.in | 102 ++++++++ cuda_bindings/cuda/bindings/utils/__init__.py | 28 ++- .../cuda/bindings/utils/_get_handle.pyx.in | 234 ------------------ 4 files changed, 251 insertions(+), 235 deletions(-) delete mode 100644 cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index e045e1ee3..196c5365e 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -53948,3 +53948,125 @@ def sizeof(objType): if objType == VdpOutputSurface: return sizeof(cydriver.VdpOutputSurface){{endif}} raise TypeError("Unknown type: " + str(objType)) + +cdef int _add_native_handle_getters() except?-1: + from cuda.bindings.utils import _add_cuda_native_handle_getter + {{if 'CUcontext' in found_types}} + def CUcontext_getter(CUcontext x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUcontext, CUcontext_getter) + {{endif}} + {{if 'CUmodule' in found_types}} + def CUmodule_getter(CUmodule x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmodule, CUmodule_getter) + {{endif}} + {{if 'CUfunction' in found_types}} + def CUfunction_getter(CUfunction x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUfunction, CUfunction_getter) + {{endif}} + {{if 'CUlibrary' in found_types}} + def CUlibrary_getter(CUlibrary x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlibrary, CUlibrary_getter) + {{endif}} + {{if 'CUkernel' in found_types}} + def CUkernel_getter(CUkernel x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUkernel, CUkernel_getter) + {{endif}} + {{if 'CUarray' in found_types}} + def CUarray_getter(CUarray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUarray, CUarray_getter) + {{endif}} + {{if 'CUmipmappedArray' in found_types}} + def CUmipmappedArray_getter(CUmipmappedArray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmipmappedArray, CUmipmappedArray_getter) + {{endif}} + {{if 'CUtexref' in found_types}} + def CUtexref_getter(CUtexref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUtexref, CUtexref_getter) + {{endif}} + {{if 'CUsurfref' in found_types}} + def CUsurfref_getter(CUsurfref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUsurfref, CUsurfref_getter) + {{endif}} + {{if 'CUevent' in found_types}} + def CUevent_getter(CUevent x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUevent, CUevent_getter) + {{endif}} + {{if 'CUstream' in found_types}} + def CUstream_getter(CUstream x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUstream, CUstream_getter) + {{endif}} + {{if 'CUgraphicsResource' in found_types}} + def CUgraphicsResource_getter(CUgraphicsResource x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphicsResource, CUgraphicsResource_getter) + {{endif}} + {{if 'CUexternalMemory' in found_types}} + def CUexternalMemory_getter(CUexternalMemory x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalMemory, CUexternalMemory_getter) + {{endif}} + {{if 'CUexternalSemaphore' in found_types}} + def CUexternalSemaphore_getter(CUexternalSemaphore x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalSemaphore, CUexternalSemaphore_getter) + {{endif}} + {{if 'CUgraph' in found_types}} + def CUgraph_getter(CUgraph x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraph, CUgraph_getter) + {{endif}} + {{if 'CUgraphNode' in found_types}} + def CUgraphNode_getter(CUgraphNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphNode, CUgraphNode_getter) + {{endif}} + {{if 'CUgraphExec' in found_types}} + def CUgraphExec_getter(CUgraphExec x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphExec, CUgraphExec_getter) + {{endif}} + {{if 'CUmemoryPool' in found_types}} + def CUmemoryPool_getter(CUmemoryPool x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmemoryPool, CUmemoryPool_getter) + {{endif}} + {{if 'CUuserObject' in found_types}} + def CUuserObject_getter(CUuserObject x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUuserObject, CUuserObject_getter) + {{endif}} + {{if 'CUgraphDeviceNode' in found_types}} + def CUgraphDeviceNode_getter(CUgraphDeviceNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphDeviceNode, CUgraphDeviceNode_getter) + {{endif}} + {{if 'CUasyncCallbackHandle' in found_types}} + def CUasyncCallbackHandle_getter(CUasyncCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUasyncCallbackHandle, CUasyncCallbackHandle_getter) + {{endif}} + {{if 'CUgreenCtx' in found_types}} + def CUgreenCtx_getter(CUgreenCtx x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgreenCtx, CUgreenCtx_getter) + {{endif}} + {{if 'CUlinkState' in found_types}} + def CUlinkState_getter(CUlinkState x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlinkState, CUlinkState_getter) + {{endif}} + {{if 'CUdevResourceDesc' in found_types}} + def CUdevResourceDesc_getter(CUdevResourceDesc x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUdevResourceDesc, CUdevResourceDesc_getter) + {{endif}} + {{if 'CUlogsCallbackHandle' in found_types}} + def CUlogsCallbackHandle_getter(CUlogsCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlogsCallbackHandle, CUlogsCallbackHandle_getter) + {{endif}} + {{if True}} + def CUeglStreamConnection_getter(CUeglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUeglStreamConnection, CUeglStreamConnection_getter) + {{endif}} + {{if True}} + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + {{endif}} + {{if True}} + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + {{endif}} + {{if True}} + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + {{endif}} + return 0 +_add_native_handle_getters() + diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 43ce11ee8..ced5d39a6 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -37912,3 +37912,105 @@ def sizeof(objType): if objType == cudaEglStreamConnection: return sizeof(cyruntime.cudaEglStreamConnection){{endif}} raise TypeError("Unknown type: " + str(objType)) + +cdef int _add_native_handle_getters() except?-1: + from cuda.bindings.utils import _add_cuda_native_handle_getter + {{if 'cudaArray_t' in found_types}} + def cudaArray_t_getter(cudaArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_t, cudaArray_t_getter) + {{endif}} + {{if 'cudaArray_const_t' in found_types}} + def cudaArray_const_t_getter(cudaArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_const_t, cudaArray_const_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_t' in found_types}} + def cudaMipmappedArray_t_getter(cudaMipmappedArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_t, cudaMipmappedArray_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_const_t' in found_types}} + def cudaMipmappedArray_const_t_getter(cudaMipmappedArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_const_t, cudaMipmappedArray_const_t_getter) + {{endif}} + {{if 'cudaStream_t' in found_types}} + def cudaStream_t_getter(cudaStream_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaStream_t, cudaStream_t_getter) + {{endif}} + {{if 'cudaEvent_t' in found_types}} + def cudaEvent_t_getter(cudaEvent_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEvent_t, cudaEvent_t_getter) + {{endif}} + {{if 'cudaGraphicsResource_t' in found_types}} + def cudaGraphicsResource_t_getter(cudaGraphicsResource_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphicsResource_t, cudaGraphicsResource_t_getter) + {{endif}} + {{if 'cudaExternalMemory_t' in found_types}} + def cudaExternalMemory_t_getter(cudaExternalMemory_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalMemory_t, cudaExternalMemory_t_getter) + {{endif}} + {{if 'cudaExternalSemaphore_t' in found_types}} + def cudaExternalSemaphore_t_getter(cudaExternalSemaphore_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalSemaphore_t, cudaExternalSemaphore_t_getter) + {{endif}} + {{if 'cudaGraph_t' in found_types}} + def cudaGraph_t_getter(cudaGraph_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraph_t, cudaGraph_t_getter) + {{endif}} + {{if 'cudaGraphNode_t' in found_types}} + def cudaGraphNode_t_getter(cudaGraphNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphNode_t, cudaGraphNode_t_getter) + {{endif}} + {{if 'cudaUserObject_t' in found_types}} + def cudaUserObject_t_getter(cudaUserObject_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaUserObject_t, cudaUserObject_t_getter) + {{endif}} + {{if 'cudaFunction_t' in found_types}} + def cudaFunction_t_getter(cudaFunction_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaFunction_t, cudaFunction_t_getter) + {{endif}} + {{if 'cudaKernel_t' in found_types}} + def cudaKernel_t_getter(cudaKernel_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaKernel_t, cudaKernel_t_getter) + {{endif}} + {{if 'cudaLibrary_t' in found_types}} + def cudaLibrary_t_getter(cudaLibrary_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaLibrary_t, cudaLibrary_t_getter) + {{endif}} + {{if 'cudaMemPool_t' in found_types}} + def cudaMemPool_t_getter(cudaMemPool_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMemPool_t, cudaMemPool_t_getter) + {{endif}} + {{if 'cudaGraphExec_t' in found_types}} + def cudaGraphExec_t_getter(cudaGraphExec_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphExec_t, cudaGraphExec_t_getter) + {{endif}} + {{if 'cudaGraphDeviceNode_t' in found_types}} + def cudaGraphDeviceNode_t_getter(cudaGraphDeviceNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphDeviceNode_t, cudaGraphDeviceNode_t_getter) + {{endif}} + {{if 'cudaAsyncCallbackHandle_t' in found_types}} + def cudaAsyncCallbackHandle_t_getter(cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaAsyncCallbackHandle_t, cudaAsyncCallbackHandle_t_getter) + {{endif}} + {{if 'cudaLogsCallbackHandle' in found_types}} + def cudaLogsCallbackHandle_getter(cudaLogsCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaLogsCallbackHandle, cudaLogsCallbackHandle_getter) + {{endif}} + {{if True}} + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + {{endif}} + {{if True}} + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + {{endif}} + {{if True}} + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + {{endif}} + {{if True}} + def cudaEglStreamConnection_getter(cudaEglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEglStreamConnection, cudaEglStreamConnection_getter) + {{endif}} + return 0 +_add_native_handle_getters() + diff --git a/cuda_bindings/cuda/bindings/utils/__init__.py b/cuda_bindings/cuda/bindings/utils/__init__.py index ab13d004c..5f9288b81 100644 --- a/cuda_bindings/cuda/bindings/utils/__init__.py +++ b/cuda_bindings/cuda/bindings/utils/__init__.py @@ -1,5 +1,31 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -from ._get_handle import get_cuda_native_handle +from typing import Any, Callable + from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver + +_handle_getters: dict[type, Callable[[Any], int]] = {} + + +def _add_cuda_native_handle_getter(t: type, getter: Callable[[Any], int]) -> None: + _handle_getters[t] = getter + + +def get_cuda_native_handle(obj: Any) -> int: + """Returns the address of the provided CUDA Python object as a Python int. + + Parameters + ---------- + obj : Any + CUDA Python object + + Returns + ------- + int : The object address. + """ + obj_type = type(obj) + try: + return _handle_getters[obj_type](obj) + except KeyError: + raise TypeError("Unknown type: " + str(obj_type)) from None diff --git a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in b/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in deleted file mode 100644 index 30718591e..000000000 --- a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in +++ /dev/null @@ -1,234 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.0.0. Do not modify it directly. - -from libc.stdint cimport uintptr_t -cimport cython - -from cuda.bindings cimport driver, runtime, cydriver, cyruntime - - -cdef dict _handle_getters = None - -@cython.embedsignature(True) -def get_cuda_native_handle(obj) -> int: - """ Returns the address of the provided CUDA Python object as Python int. - - Parameters - ---------- - obj : Any - CUDA Python object - - Returns - ------- - int : The object address. - """ - global _handle_getters - obj_type = type(obj) - if _handle_getters is None: - _handle_getters = dict() - {{if 'CUcontext' in found_types}} - def CUcontext_getter(driver.CUcontext x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUcontext] = CUcontext_getter - {{endif}} - {{if 'CUmodule' in found_types}} - def CUmodule_getter(driver.CUmodule x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmodule] = CUmodule_getter - {{endif}} - {{if 'CUfunction' in found_types}} - def CUfunction_getter(driver.CUfunction x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUfunction] = CUfunction_getter - {{endif}} - {{if 'CUlibrary' in found_types}} - def CUlibrary_getter(driver.CUlibrary x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlibrary] = CUlibrary_getter - {{endif}} - {{if 'CUkernel' in found_types}} - def CUkernel_getter(driver.CUkernel x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUkernel] = CUkernel_getter - {{endif}} - {{if 'CUarray' in found_types}} - def CUarray_getter(driver.CUarray x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUarray] = CUarray_getter - {{endif}} - {{if 'CUmipmappedArray' in found_types}} - def CUmipmappedArray_getter(driver.CUmipmappedArray x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmipmappedArray] = CUmipmappedArray_getter - {{endif}} - {{if 'CUtexref' in found_types}} - def CUtexref_getter(driver.CUtexref x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUtexref] = CUtexref_getter - {{endif}} - {{if 'CUsurfref' in found_types}} - def CUsurfref_getter(driver.CUsurfref x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUsurfref] = CUsurfref_getter - {{endif}} - {{if 'CUevent' in found_types}} - def CUevent_getter(driver.CUevent x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUevent] = CUevent_getter - {{endif}} - {{if 'CUstream' in found_types}} - def CUstream_getter(driver.CUstream x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUstream] = CUstream_getter - {{endif}} - {{if 'CUgraphicsResource' in found_types}} - def CUgraphicsResource_getter(driver.CUgraphicsResource x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphicsResource] = CUgraphicsResource_getter - {{endif}} - {{if 'CUexternalMemory' in found_types}} - def CUexternalMemory_getter(driver.CUexternalMemory x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUexternalMemory] = CUexternalMemory_getter - {{endif}} - {{if 'CUexternalSemaphore' in found_types}} - def CUexternalSemaphore_getter(driver.CUexternalSemaphore x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUexternalSemaphore] = CUexternalSemaphore_getter - {{endif}} - {{if 'CUgraph' in found_types}} - def CUgraph_getter(driver.CUgraph x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraph] = CUgraph_getter - {{endif}} - {{if 'CUgraphNode' in found_types}} - def CUgraphNode_getter(driver.CUgraphNode x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphNode] = CUgraphNode_getter - {{endif}} - {{if 'CUgraphExec' in found_types}} - def CUgraphExec_getter(driver.CUgraphExec x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphExec] = CUgraphExec_getter - {{endif}} - {{if 'CUmemoryPool' in found_types}} - def CUmemoryPool_getter(driver.CUmemoryPool x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmemoryPool] = CUmemoryPool_getter - {{endif}} - {{if 'CUuserObject' in found_types}} - def CUuserObject_getter(driver.CUuserObject x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUuserObject] = CUuserObject_getter - {{endif}} - {{if 'CUgraphDeviceNode' in found_types}} - def CUgraphDeviceNode_getter(driver.CUgraphDeviceNode x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphDeviceNode] = CUgraphDeviceNode_getter - {{endif}} - {{if 'CUasyncCallbackHandle' in found_types}} - def CUasyncCallbackHandle_getter(driver.CUasyncCallbackHandle x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUasyncCallbackHandle] = CUasyncCallbackHandle_getter - {{endif}} - {{if 'CUgreenCtx' in found_types}} - def CUgreenCtx_getter(driver.CUgreenCtx x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgreenCtx] = CUgreenCtx_getter - {{endif}} - {{if 'CUlinkState' in found_types}} - def CUlinkState_getter(driver.CUlinkState x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlinkState] = CUlinkState_getter - {{endif}} - {{if 'CUdevResourceDesc' in found_types}} - def CUdevResourceDesc_getter(driver.CUdevResourceDesc x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUdevResourceDesc] = CUdevResourceDesc_getter - {{endif}} - {{if 'CUlogsCallbackHandle' in found_types}} - def CUlogsCallbackHandle_getter(driver.CUlogsCallbackHandle x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlogsCallbackHandle] = CUlogsCallbackHandle_getter - {{endif}} - {{if True}} - def CUeglStreamConnection_getter(driver.CUeglStreamConnection x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUeglStreamConnection] = CUeglStreamConnection_getter - {{endif}} - {{if True}} - def EGLImageKHR_getter(runtime.EGLImageKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLImageKHR] = EGLImageKHR_getter - {{endif}} - {{if True}} - def EGLStreamKHR_getter(runtime.EGLStreamKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLStreamKHR] = EGLStreamKHR_getter - {{endif}} - {{if True}} - def EGLSyncKHR_getter(runtime.EGLSyncKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLSyncKHR] = EGLSyncKHR_getter - {{endif}} - {{if 'cudaArray_t' in found_types}} - def cudaArray_t_getter(runtime.cudaArray_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaArray_t] = cudaArray_t_getter - {{endif}} - {{if 'cudaArray_const_t' in found_types}} - def cudaArray_const_t_getter(runtime.cudaArray_const_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaArray_const_t] = cudaArray_const_t_getter - {{endif}} - {{if 'cudaMipmappedArray_t' in found_types}} - def cudaMipmappedArray_t_getter(runtime.cudaMipmappedArray_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMipmappedArray_t] = cudaMipmappedArray_t_getter - {{endif}} - {{if 'cudaMipmappedArray_const_t' in found_types}} - def cudaMipmappedArray_const_t_getter(runtime.cudaMipmappedArray_const_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMipmappedArray_const_t] = cudaMipmappedArray_const_t_getter - {{endif}} - {{if 'cudaStream_t' in found_types}} - def cudaStream_t_getter(runtime.cudaStream_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaStream_t] = cudaStream_t_getter - {{endif}} - {{if 'cudaEvent_t' in found_types}} - def cudaEvent_t_getter(runtime.cudaEvent_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaEvent_t] = cudaEvent_t_getter - {{endif}} - {{if 'cudaGraphicsResource_t' in found_types}} - def cudaGraphicsResource_t_getter(runtime.cudaGraphicsResource_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphicsResource_t] = cudaGraphicsResource_t_getter - {{endif}} - {{if 'cudaExternalMemory_t' in found_types}} - def cudaExternalMemory_t_getter(runtime.cudaExternalMemory_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaExternalMemory_t] = cudaExternalMemory_t_getter - {{endif}} - {{if 'cudaExternalSemaphore_t' in found_types}} - def cudaExternalSemaphore_t_getter(runtime.cudaExternalSemaphore_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaExternalSemaphore_t] = cudaExternalSemaphore_t_getter - {{endif}} - {{if 'cudaGraph_t' in found_types}} - def cudaGraph_t_getter(runtime.cudaGraph_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraph_t] = cudaGraph_t_getter - {{endif}} - {{if 'cudaGraphNode_t' in found_types}} - def cudaGraphNode_t_getter(runtime.cudaGraphNode_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphNode_t] = cudaGraphNode_t_getter - {{endif}} - {{if 'cudaUserObject_t' in found_types}} - def cudaUserObject_t_getter(runtime.cudaUserObject_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaUserObject_t] = cudaUserObject_t_getter - {{endif}} - {{if 'cudaFunction_t' in found_types}} - def cudaFunction_t_getter(runtime.cudaFunction_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaFunction_t] = cudaFunction_t_getter - {{endif}} - {{if 'cudaKernel_t' in found_types}} - def cudaKernel_t_getter(runtime.cudaKernel_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaKernel_t] = cudaKernel_t_getter - {{endif}} - {{if 'cudaLibrary_t' in found_types}} - def cudaLibrary_t_getter(runtime.cudaLibrary_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaLibrary_t] = cudaLibrary_t_getter - {{endif}} - {{if 'cudaMemPool_t' in found_types}} - def cudaMemPool_t_getter(runtime.cudaMemPool_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMemPool_t] = cudaMemPool_t_getter - {{endif}} - {{if 'cudaGraphExec_t' in found_types}} - def cudaGraphExec_t_getter(runtime.cudaGraphExec_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphExec_t] = cudaGraphExec_t_getter - {{endif}} - {{if 'cudaGraphDeviceNode_t' in found_types}} - def cudaGraphDeviceNode_t_getter(runtime.cudaGraphDeviceNode_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphDeviceNode_t] = cudaGraphDeviceNode_t_getter - {{endif}} - {{if 'cudaAsyncCallbackHandle_t' in found_types}} - def cudaAsyncCallbackHandle_t_getter(runtime.cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaAsyncCallbackHandle_t] = cudaAsyncCallbackHandle_t_getter - {{endif}} - {{if 'cudaLogsCallbackHandle' in found_types}} - def cudaLogsCallbackHandle_getter(runtime.cudaLogsCallbackHandle x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaLogsCallbackHandle] = cudaLogsCallbackHandle_getter - {{endif}} - {{if True}} - def cudaEglStreamConnection_getter(runtime.cudaEglStreamConnection x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaEglStreamConnection] = cudaEglStreamConnection_getter - {{endif}} - try: - return _handle_getters[obj_type](obj) - except KeyError: - raise TypeError("Unknown type: " + str(obj_type)) from None \ No newline at end of file From 473f44b317f8f442cf9e011fcc06d8edea068675 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:05:06 -0400 Subject: [PATCH 030/113] Bump korthout/backport-action from 3.2.1 to 3.3.0 (#859) Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 3.2.1 to 3.3.0. - [Release notes](https://github.com/korthout/backport-action/releases) - [Commits](https://github.com/korthout/backport-action/compare/0193454f0c5947491d348f33a275c119f30eb736...ca4972adce8039ff995e618f5fc02d1b7961f27a) --- updated-dependencies: - dependency-name: korthout/backport-action dependency-version: 3.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index fcd9459f9..6a0fed91c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -32,7 +32,7 @@ jobs: echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV - name: Create backport pull requests - uses: korthout/backport-action@0193454f0c5947491d348f33a275c119f30eb736 # v3.2.1 + uses: korthout/backport-action@ca4972adce8039ff995e618f5fc02d1b7961f27a # v3.3.0 with: copy_assignees: true copy_labels_pattern: true From 09ca5ed80c701606cd7b8ec074b76e6debc22d7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:05:25 -0400 Subject: [PATCH 031/113] Bump github/codeql-action from 3.29.8 to 3.29.10 (#858) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.8 to 3.29.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/76621b61decf072c1cee8dd1ce2d2a82d33c17ed...96f518a34f7a870018057716cc4d7a5c014bd61c) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 41d266f60..3c2d94c5e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,13 +31,13 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8 + uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.8 + uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10 with: category: "/language:${{matrix.language}}" From 2f99cfaabf4ad2af0e23e6e64067c61977f82ecd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:06:43 -0400 Subject: [PATCH 032/113] Bump actions/upload-pages-artifact from 3.0.1 to 4.0.0 (#857) Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3.0.1 to 4.0.0. - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/56afc609e74202658d3ffba0e8f6dda462b719fa...7b1f4a764d45c48632c6b24a0339c27f5614fb0b) --- updated-dependencies: - dependency-name: actions/upload-pages-artifact dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index daebdad4d..5d0450c36 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -238,7 +238,7 @@ jobs: # TODO: Consider removing this step? - name: Upload doc artifacts - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 with: path: artifacts/ retention-days: 3 From 04438162000958fe1a39b36951bb123cd0f39886 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 19 Aug 2025 09:06:38 -0700 Subject: [PATCH 033/113] Make add_dll_directory(), load_dependencies() side-effects more deterministic. (#855) --- .../pathfinder/_dynamic_libs/load_dl_linux.py | 16 +----------- .../_dynamic_libs/load_dl_windows.py | 21 +++++----------- .../_dynamic_libs/load_nvidia_dynamic_lib.py | 25 +++++++++++-------- cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index a71019d1a..a0bcbbd73 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -127,21 +127,7 @@ def get_candidate_sonames(libname: str) -> list[str]: return candidate_sonames -def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]: - """Check if the library is already loaded in the process. - - Args: - libname: The name of the library to check - - Returns: - A LoadedDL object if the library is already loaded, None otherwise - - Example: - >>> loaded = check_if_already_loaded_from_elsewhere("cudart") - >>> if loaded is not None: - ... print(f"Library already loaded from {loaded.abs_path}") - """ - +def check_if_already_loaded_from_elsewhere(libname: str, _have_abs_path: bool) -> Optional[LoadedDL]: for soname in get_candidate_sonames(libname): try: handle = ctypes.CDLL(soname, mode=os.RTLD_NOLOAD) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py index d8e1e3d51..1a4f32cf2 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py @@ -100,25 +100,16 @@ def abs_path_for_dynamic_library(libname: str, handle: ctypes.wintypes.HMODULE) return buffer.value -def check_if_already_loaded_from_elsewhere(libname: str) -> Optional[LoadedDL]: - """Check if the library is already loaded in the process. - - Args: - libname: The name of the library to check - - Returns: - A LoadedDL object if the library is already loaded, None otherwise - - Example: - >>> loaded = check_if_already_loaded_from_elsewhere("cudart") - >>> if loaded is not None: - ... print(f"Library already loaded from {loaded.abs_path}") - """ - +def check_if_already_loaded_from_elsewhere(libname: str, have_abs_path: bool) -> Optional[LoadedDL]: for dll_name in SUPPORTED_WINDOWS_DLLS.get(libname, ()): handle = kernel32.GetModuleHandleW(dll_name) if handle: abs_path = abs_path_for_dynamic_library(libname, handle) + if have_abs_path and libname in LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY: + # This is a side-effect if the pathfinder loads the library via + # load_with_abs_path(). To make the side-effect more deterministic, + # activate it even if the library was already loaded from elsewhere. + add_dll_directory(abs_path) return LoadedDL(abs_path, True, ctypes_handle_to_unsigned_int(handle)) return None diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py index 1ff26f34b..29f265460 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py @@ -24,26 +24,29 @@ def _load_lib_no_cache(libname: str) -> LoadedDL: - # Check whether the library is already loaded into the current process by - # some other component. This check uses OS-level mechanisms (e.g., - # dlopen on Linux, GetModuleHandle on Windows). - loaded = check_if_already_loaded_from_elsewhere(libname) - if loaded is not None: - return loaded + found = _FindNvidiaDynamicLib(libname) + have_abs_path = found.abs_path is not None + + # If the library was already loaded by someone else, reproduce any OS-specific + # side-effects we would have applied on a direct absolute-path load (e.g., + # AddDllDirectory on Windows for libs that require it). + loaded = check_if_already_loaded_from_elsewhere(libname, have_abs_path) - # Load dependencies first + # Load dependencies regardless of who loaded the primary lib first. + # Doing this *after* the side-effect ensures dependencies resolve consistently + # relative to the actually loaded location. load_dependencies(libname, load_nvidia_dynamic_lib) - # Find the library path - found = _FindNvidiaDynamicLib(libname) - if found.abs_path is None: + if loaded is not None: + return loaded + + if not have_abs_path: loaded = load_with_system_search(libname) if loaded is not None: return loaded found.retry_with_cuda_home_priority_last() found.raise_if_abs_path_is_None() - # Load the library from the found path assert found.abs_path is not None # for mypy return load_with_abs_path(libname, found.abs_path) diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index f543585a5..adcedad4d 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.1.1a1" +__version__ = "1.1.1a2" From b400e345b141183d2c1d54b2e69ef14400c162c7 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Thu, 14 Aug 2025 11:21:05 -0700 Subject: [PATCH 034/113] Adds paths for the CUDA static library based on CUDA_HOME (#608). --- cuda_bindings/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 4ba357602..31dace089 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -31,6 +31,7 @@ raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") CUDA_HOME = CUDA_HOME.split(os.pathsep) + if os.environ.get("PARALLEL_LEVEL") is not None: warn( "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead", @@ -238,6 +239,8 @@ def generate_output(infile, local): os.path.dirname(sysconfig.get_path("include")), ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] +cudalib_subdir = r"lib\x64" if sys.platform == "win32" else "lib64" +library_dirs.extend(os.path.join(prefix, cudalib_subdir) for prefix in CUDA_HOME) extra_compile_args = [] extra_cythonize_kwargs = {} From 82dcb0646811e6676a548d9e775bb1ab78b4dc3f Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Tue, 19 Aug 2025 11:01:04 -0700 Subject: [PATCH 035/113] Removes LIB and LIBRARY_PATH environment variables from the build-wheel workflow. --- .github/workflows/build-wheel.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 20995f2cb..803a70cbd 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -157,11 +157,9 @@ jobs: # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} - LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" - LIB="${CUDA_HOME}\\lib\\x64;${LIB}" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" From 73acddff5ecc5e7dded038aa79f474cc0ae9bf83 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Tue, 19 Aug 2025 11:18:16 -0700 Subject: [PATCH 036/113] Updates Linux install to search both lib and lib64 directories for CUDA libraries. --- cuda_bindings/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 31dace089..8ebd68a75 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -239,8 +239,8 @@ def generate_output(infile, local): os.path.dirname(sysconfig.get_path("include")), ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] -cudalib_subdir = r"lib\x64" if sys.platform == "win32" else "lib64" -library_dirs.extend(os.path.join(prefix, cudalib_subdir) for prefix in CUDA_HOME) +cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"] +library_dirs.extend(os.path.join(prefix, subdir) for prefix in CUDA_HOME for subdir in cudalib_subdirs) extra_compile_args = [] extra_cythonize_kwargs = {} From 858126d45a0f84d7e2e0d4b38cb4942e910c20cb Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Wed, 20 Aug 2025 09:47:26 -0700 Subject: [PATCH 037/113] Removes LIBRARY_PATH environment variable from installation docs (no longer needed due to resolution of #608). --- cuda_bindings/docs/source/install.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index f7e0e3669..1c9697fd2 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -57,7 +57,6 @@ Source builds require that the provided CUDA headers are of the same major.minor ```console $ export CUDA_HOME=/usr/local/cuda -$ export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH ``` See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. From 51ec60bd2b582a9ba8cbd08c52c81f6c72138a71 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 21:13:21 -0400 Subject: [PATCH 038/113] CI: Enable proxy cache in test and build-docs pipelines (#872) --- .github/workflows/build-docs.yml | 5 +++-- .github/workflows/test-wheel-linux.yml | 4 ++++ .github/workflows/test-wheel-windows.yml | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 5d0450c36..0e8af64cb 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -52,8 +52,9 @@ jobs: fetch-depth: 0 ref: ${{ inputs.git-tag }} - # TODO: cache conda env to speed up the workflow once conda-incubator/setup-miniconda#267 - # is resolved + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true - name: Set up miniforge uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index a0776a360..b775670a9 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -143,6 +143,10 @@ jobs: with: fetch-depth: 0 + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true + - name: Install dependencies uses: ./.github/actions/install_unix_deps continue-on-error: false diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 7fb534273..18ddbcb45 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -89,6 +89,8 @@ jobs: with: fetch-depth: 0 + # TODO: use setup-proxy-cache once we have self-hosted Windows runners + - name: Update driver run: | .github/workflows/install_gpu_driver.ps1 From 5fb3fb6a8e8b774a9186959aa475be7c40a6169c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 21:45:48 -0400 Subject: [PATCH 039/113] CI: Upload wheels to release artifacts and auto-create release drafts (#873) * Initial plan * Add shared script and update workflows to upload wheels to release artifacts Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix script argument validation and add comprehensive tests Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Auto-create release draft if none exists for given tag Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Make run-id and component required inputs in release-upload workflow Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- .github/workflows/release-upload.yml | 21 ++++++++ .github/workflows/release.yml | 32 ++++++------ ci/tools/download-wheels | 75 ++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 16 deletions(-) create mode 100755 ci/tools/download-wheels diff --git a/.github/workflows/release-upload.yml b/.github/workflows/release-upload.yml index 402f0acfd..f7d6306fc 100644 --- a/.github/workflows/release-upload.yml +++ b/.github/workflows/release-upload.yml @@ -10,6 +10,14 @@ on: git-tag: type: string required: true + run-id: + description: "The GHA run ID that generated validated artifacts" + type: string + required: true + component: + description: "Component to download wheels for" + type: string + required: true concurrency: # Concurrency group that uses the workflow name and PR number if available @@ -63,3 +71,16 @@ jobs: --clobber "${{ inputs.git-tag }}" --repo "${{ github.repository }}" release/* + + - name: Download and Upload Wheels + env: + GH_TOKEN: ${{ github.token }} + run: | + # Use the shared script to download wheels + ./ci/tools/download-wheels "${{ inputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "release/wheels" + + # Upload wheels to the release + if [[ -d "release/wheels" && $(ls -A release/wheels 2>/dev/null | wc -l) -gt 0 ]]; then + echo "Uploading wheels to release ${{ inputs.git-tag }}" + gh release upload --clobber "${{ inputs.git-tag }}" --repo "${{ github.repository }}" release/wheels/* + fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c483d1be8..6e423b556 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: "CI: Release" -description: Manually-triggered release workflow. Must have a release note in the draft state and the release commit tagged. +description: Manually-triggered release workflow. Creates a release draft if one doesn't exist for the given tag, or uses existing draft. on: workflow_dispatch: @@ -46,7 +46,12 @@ jobs: check-tag: runs-on: ubuntu-latest steps: - - name: Check if draft exists for the tag + - name: Checkout Source + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 0 + + - name: Check or create draft release for the tag env: GH_TOKEN: ${{ github.token }} run: | @@ -62,7 +67,7 @@ jobs: found=0 for idx in ${!tags[@]}; do if [[ "${tags[$idx]}" == "${{ inputs.git-tag }}" ]]; then - echo "found ${{ inputs.git-tag }}" + echo "found existing release for ${{ inputs.git-tag }}" found=1 if [[ "${is_draft[$idx]}" != "true" ]]; then echo "the release note is not in draft state" @@ -72,8 +77,8 @@ jobs: fi done if [[ "$found" == 0 ]]; then - echo "the release is not yet tagged" - exit 1 + echo "no release found for ${{ inputs.git-tag }}, creating draft release" + gh release create "${{ inputs.git-tag }}" --draft --repo "${{ github.repository }}" --title "Release ${{ inputs.git-tag }}" --notes "Release ${{ inputs.git-tag }}" fi doc: @@ -105,6 +110,8 @@ jobs: uses: ./.github/workflows/release-upload.yml with: git-tag: ${{ inputs.git-tag }} + run-id: ${{ inputs.run-id }} + component: ${{ inputs.component }} publish-wheels: name: Publish wheels @@ -117,21 +124,14 @@ jobs: permissions: id-token: write steps: + - name: Checkout Source + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Download component wheels env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh run download ${{ inputs.run-id }} -p "${{ inputs.component }}*" -R ${{ github.repository }} - mkdir dist - for p in ${{ inputs.component }}* - do - # exclude cython test artifacts - if [[ "${p}" == *-tests ]]; then - continue - fi - mv ${p}/*.whl dist/ - done - rm -rf ${{ inputs.component }}* + ./ci/tools/download-wheels "${{ inputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist" - name: Publish package distributions to PyPI if: ${{ inputs.wheel-dst == 'pypi' }} diff --git a/ci/tools/download-wheels b/ci/tools/download-wheels new file mode 100755 index 000000000..05509bfc0 --- /dev/null +++ b/ci/tools/download-wheels @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# A utility script to download component wheels from GitHub Actions artifacts. +# This script reuses the same logic that was in release.yml to maintain consistency. + +set -euo pipefail + +# Check required arguments +if [[ $# -lt 3 ]]; then + echo "Usage: $0 [output-dir]" >&2 + echo " run-id: The GitHub Actions run ID containing the artifacts" >&2 + echo " component: The component name pattern to download (e.g., cuda-core, cuda-bindings)" >&2 + echo " repository: The GitHub repository (e.g., NVIDIA/cuda-python)" >&2 + echo " output-dir: Optional output directory (default: ./dist)" >&2 + exit 1 +fi + +RUN_ID="$1" +COMPONENT="$2" +REPOSITORY="$3" +OUTPUT_DIR="${4:-./dist}" + +# Ensure we have a GitHub token +if [[ -z "${GH_TOKEN:-}" ]]; then + echo "Error: GH_TOKEN environment variable is required" + exit 1 +fi + +echo "Downloading wheels for component: $COMPONENT from run: $RUN_ID" + +# Download component wheels using the same logic as release.yml +if [[ "$COMPONENT" == "all" ]]; then + # Download all component patterns + gh run download "$RUN_ID" -p "cuda-*" -R "$REPOSITORY" +else + gh run download "$RUN_ID" -p "${COMPONENT}*" -R "$REPOSITORY" +fi + +# Create output directory +mkdir -p "$OUTPUT_DIR" + +# Process downloaded artifacts +for p in cuda-* +do + if [[ ! -d "$p" ]]; then + continue + fi + + # exclude cython test artifacts + if [[ "${p}" == *-tests ]]; then + echo "Skipping test artifact: $p" + continue + fi + + # If we're not downloading "all", only process matching component + if [[ "$COMPONENT" != "all" && "$p" != ${COMPONENT}* ]]; then + continue + fi + + echo "Processing artifact: $p" + # Move wheel files to output directory + if [[ -d "$p" ]]; then + find "$p" -name "*.whl" -exec mv {} "$OUTPUT_DIR/" \; + fi +done + +# Clean up artifact directories +rm -rf cuda-* + +echo "Downloaded wheels to: $OUTPUT_DIR" +ls -la "$OUTPUT_DIR" \ No newline at end of file From bb1fe80fcfb66759f01f2e23df028c2a79fb71c1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 21:49:01 -0400 Subject: [PATCH 040/113] Fix LaunchConfig.grid unit conversion when cluster is set (#868) --- .../cuda/core/experimental/_launch_config.py | 35 +++++++-- cuda_core/docs/source/release.rst | 1 + cuda_core/docs/source/release/0.X.Y-notes.rst | 39 ++++++++++ cuda_core/examples/thread_block_cluster.py | 77 +++++++++++++++++-- cuda_core/tests/test_launcher.py | 63 +++++++++++++++ 5 files changed, 204 insertions(+), 11 deletions(-) create mode 100644 cuda_core/docs/source/release/0.X.Y-notes.rst diff --git a/cuda_core/cuda/core/experimental/_launch_config.py b/cuda_core/cuda/core/experimental/_launch_config.py index c226b8dfc..d82e0ec3a 100644 --- a/cuda_core/cuda/core/experimental/_launch_config.py +++ b/cuda_core/cuda/core/experimental/_launch_config.py @@ -35,10 +35,20 @@ def _lazy_init(): class LaunchConfig: """Customizable launch options. + Note + ---- + When cluster is specified, the grid parameter represents the number of + clusters (not blocks). The hierarchy is: grid (clusters) -> cluster (blocks) -> + block (threads). Each dimension in grid specifies clusters in the grid, each dimension in + cluster specifies blocks per cluster, and each dimension in block specifies + threads per block. + Attributes ---------- grid : Union[tuple, int] - Collection of threads that will execute a kernel function. + Collection of threads that will execute a kernel function. When cluster + is not specified, this represents the number of blocks, otherwise + this represents the number of clusters. cluster : Union[tuple, int] Group of blocks (Thread Block Cluster) that will execute on the same GPU Processing Cluster (GPC). Blocks within a cluster have access to @@ -89,16 +99,29 @@ def __post_init__(self): def _to_native_launch_config(config: LaunchConfig) -> driver.CUlaunchConfig: _lazy_init() drv_cfg = driver.CUlaunchConfig() - drv_cfg.gridDimX, drv_cfg.gridDimY, drv_cfg.gridDimZ = config.grid - drv_cfg.blockDimX, drv_cfg.blockDimY, drv_cfg.blockDimZ = config.block - drv_cfg.sharedMemBytes = config.shmem_size - attrs = [] # TODO: support more attributes + + # Handle grid dimensions and cluster configuration if config.cluster: + # Convert grid from cluster units to block units + grid_blocks = ( + config.grid[0] * config.cluster[0], + config.grid[1] * config.cluster[1], + config.grid[2] * config.cluster[2], + ) + drv_cfg.gridDimX, drv_cfg.gridDimY, drv_cfg.gridDimZ = grid_blocks + + # Set up cluster attribute attr = driver.CUlaunchAttribute() attr.id = driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION dim = attr.value.clusterDim dim.x, dim.y, dim.z = config.cluster - attrs.append(attr) + attrs = [attr] + else: + drv_cfg.gridDimX, drv_cfg.gridDimY, drv_cfg.gridDimZ = config.grid + attrs = [] + + drv_cfg.blockDimX, drv_cfg.blockDimY, drv_cfg.blockDimZ = config.block + drv_cfg.sharedMemBytes = config.shmem_size if config.cooperative_launch: attr = driver.CUlaunchAttribute() attr.id = driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_COOPERATIVE diff --git a/cuda_core/docs/source/release.rst b/cuda_core/docs/source/release.rst index 2f69e5872..954d296e2 100644 --- a/cuda_core/docs/source/release.rst +++ b/cuda_core/docs/source/release.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 3 + release/0.X.Y-notes release/0.3.2-notes release/0.3.1-notes release/0.3.0-notes diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst new file mode 100644 index 000000000..3a9c7076a --- /dev/null +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -0,0 +1,39 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. currentmodule:: cuda.core.experimental + +``cuda.core`` 0.X.Y Release Notes +================================= + +Released on TBD + + +Highlights +---------- + +- Fix for :class:`LaunchConfig` grid parameter unit conversion when thread block clusters are used. + + +Breaking Changes +---------------- + +- **LaunchConfig grid parameter interpretation**: When :attr:`LaunchConfig.cluster` is specified, the :attr:`LaunchConfig.grid` parameter now correctly represents the number of clusters instead of blocks. Previously, the grid parameter was incorrectly interpreted as blocks, causing a mismatch with the expected C++ behavior. This change ensures that ``LaunchConfig(grid=4, cluster=2, block=32)`` correctly produces 4 clusters × 2 blocks/cluster = 8 total blocks, matching the C++ equivalent ``cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32))``. + + +New features +------------ + +None. + + +New examples +------------ + +None. + + +Fixes and enhancements +---------------------- + +- Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). \ No newline at end of file diff --git a/cuda_core/examples/thread_block_cluster.py b/cuda_core/examples/thread_block_cluster.py index 98bc641ea..627018c7e 100644 --- a/cuda_core/examples/thread_block_cluster.py +++ b/cuda_core/examples/thread_block_cluster.py @@ -5,14 +5,23 @@ # ################################################################################ # # This demo illustrates the use of thread block clusters in the CUDA launch -# configuration. +# configuration and verifies that the correct grid size is passed to the kernel. # # ################################################################################ import os import sys -from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch +import numpy as np + +from cuda.core.experimental import ( + Device, + LaunchConfig, + LegacyPinnedMemoryResource, + Program, + ProgramOptions, + launch, +) # prepare include cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")) @@ -26,17 +35,34 @@ if os.path.isdir(cccl_include): include_path.insert(0, cccl_include) -# print cluster info using a kernel +# print cluster info using a kernel and store results in pinned memory code = r""" #include namespace cg = cooperative_groups; extern "C" -__global__ void check_cluster_info() { +__global__ void check_cluster_info(unsigned int* grid_dims, unsigned int* cluster_dims, unsigned int* block_dims) { auto g = cg::this_grid(); auto b = cg::this_thread_block(); + if (g.cluster_rank() == 0 && g.block_rank() == 0 && g.thread_rank() == 0) { + // Store grid dimensions (in blocks) + grid_dims[0] = g.dim_blocks().x; + grid_dims[1] = g.dim_blocks().y; + grid_dims[2] = g.dim_blocks().z; + + // Store cluster dimensions + cluster_dims[0] = g.dim_clusters().x; + cluster_dims[1] = g.dim_clusters().y; + cluster_dims[2] = g.dim_clusters().z; + + // Store block dimensions (in threads) + block_dims[0] = b.dim_threads().x; + block_dims[1] = b.dim_threads().y; + block_dims[2] = b.dim_threads().z; + + // Also print to console printf("grid dim: (%u, %u, %u)\n", g.dim_blocks().x, g.dim_blocks().y, g.dim_blocks().z); printf("cluster dim: (%u, %u, %u)\n", g.dim_clusters().x, g.dim_clusters().y, g.dim_clusters().z); printf("block dim: (%u, %u, %u)\n", b.dim_threads().x, b.dim_threads().y, b.dim_threads().z); @@ -70,8 +96,49 @@ block = 32 config = LaunchConfig(grid=grid, cluster=cluster, block=block) +# allocate pinned memory to store kernel results +pinned_mr = LegacyPinnedMemoryResource() +element_size = np.dtype(np.uint32).itemsize + +# allocate 3 uint32 values each for grid, cluster, and block dimensions +grid_buffer = pinned_mr.allocate(3 * element_size) +cluster_buffer = pinned_mr.allocate(3 * element_size) +block_buffer = pinned_mr.allocate(3 * element_size) + +# create NumPy arrays from the pinned memory +grid_dims = np.from_dlpack(grid_buffer).view(dtype=np.uint32) +cluster_dims = np.from_dlpack(cluster_buffer).view(dtype=np.uint32) +block_dims = np.from_dlpack(block_buffer).view(dtype=np.uint32) + +# initialize arrays to zero +grid_dims[:] = 0 +cluster_dims[:] = 0 +block_dims[:] = 0 + # launch kernel on the default stream -launch(dev.default_stream, config, ker) +launch(dev.default_stream, config, ker, grid_buffer, cluster_buffer, block_buffer) dev.sync() +# verify results +print("\nResults stored in pinned memory:") +print(f"Grid dimensions (blocks): {tuple(grid_dims)}") +print(f"Cluster dimensions: {tuple(cluster_dims)}") +print(f"Block dimensions (threads): {tuple(block_dims)}") + +# verify that grid conversion worked correctly: +# LaunchConfig(grid=4, cluster=2) should result in 8 total blocks (4 clusters * 2 blocks/cluster) +expected_grid_blocks = grid * cluster # 4 * 2 = 8 +actual_grid_blocks = grid_dims[0] + +print("\nVerification:") +print(f"LaunchConfig specified: grid={grid} clusters, cluster={cluster} blocks/cluster") +print(f"Expected total blocks: {expected_grid_blocks}") +print(f"Actual total blocks: {actual_grid_blocks}") + +if actual_grid_blocks == expected_grid_blocks: + print("✓ Grid conversion is correct!") +else: + print("✗ Grid conversion failed!") + sys.exit(1) + print("done!") diff --git a/cuda_core/tests/test_launcher.py b/cuda_core/tests/test_launcher.py index e37b3e6e6..e7e57bde7 100644 --- a/cuda_core/tests/test_launcher.py +++ b/cuda_core/tests/test_launcher.py @@ -23,6 +23,7 @@ launch, ) from cuda.core.experimental._memory import _SynchronousMemoryResource +from cuda.core.experimental._utils.cuda_utils import CUDAError def test_launch_config_init(init_cuda): @@ -59,6 +60,68 @@ def test_launch_config_shmem_size(): assert config.shmem_size == 0 +def test_launch_config_cluster_grid_conversion(init_cuda): + """Test that LaunchConfig preserves original grid values and conversion happens in native config.""" + try: + # Test case 1: 1D - Issue #867 example + config = LaunchConfig(grid=4, cluster=2, block=32) + assert config.grid == (4, 1, 1), f"Expected (4, 1, 1), got {config.grid}" + assert config.cluster == (2, 1, 1), f"Expected (2, 1, 1), got {config.cluster}" + assert config.block == (32, 1, 1), f"Expected (32, 1, 1), got {config.block}" + + # Test case 2: 2D grid and cluster + config = LaunchConfig(grid=(2, 3), cluster=(2, 2), block=32) + assert config.grid == (2, 3, 1), f"Expected (2, 3, 1), got {config.grid}" + assert config.cluster == (2, 2, 1), f"Expected (2, 2, 1), got {config.cluster}" + + # Test case 3: 3D full specification + config = LaunchConfig(grid=(2, 2, 2), cluster=(3, 3, 3), block=(8, 8, 8)) + assert config.grid == (2, 2, 2), f"Expected (2, 2, 2), got {config.grid}" + assert config.cluster == (3, 3, 3), f"Expected (3, 3, 3), got {config.cluster}" + + # Test case 4: Identity case + config = LaunchConfig(grid=1, cluster=1, block=32) + assert config.grid == (1, 1, 1), f"Expected (1, 1, 1), got {config.grid}" + + # Test case 5: No cluster (should not convert grid) + config = LaunchConfig(grid=4, block=32) + assert config.grid == (4, 1, 1), f"Expected (4, 1, 1), got {config.grid}" + assert config.cluster is None + + except CUDAError: + pytest.skip("Driver or GPU not new enough for thread block clusters") + + +def test_launch_config_native_conversion(init_cuda): + """Test that _to_native_launch_config correctly converts grid from cluster units to block units.""" + from cuda.core.experimental._launch_config import _to_native_launch_config + + try: + # Test case 1: 1D - Issue #867 example + config = LaunchConfig(grid=4, cluster=2, block=32) + native_config = _to_native_launch_config(config) + assert native_config.gridDimX == 8, f"Expected gridDimX=8, got {native_config.gridDimX}" + assert native_config.gridDimY == 1, f"Expected gridDimY=1, got {native_config.gridDimY}" + assert native_config.gridDimZ == 1, f"Expected gridDimZ=1, got {native_config.gridDimZ}" + + # Test case 2: 2D grid and cluster + config = LaunchConfig(grid=(2, 3), cluster=(2, 2), block=32) + native_config = _to_native_launch_config(config) + assert native_config.gridDimX == 4, f"Expected gridDimX=4, got {native_config.gridDimX}" + assert native_config.gridDimY == 6, f"Expected gridDimY=6, got {native_config.gridDimY}" + assert native_config.gridDimZ == 1, f"Expected gridDimZ=1, got {native_config.gridDimZ}" + + # Test case 3: No cluster (should not convert grid) + config = LaunchConfig(grid=4, block=32) + native_config = _to_native_launch_config(config) + assert native_config.gridDimX == 4, f"Expected gridDimX=4, got {native_config.gridDimX}" + assert native_config.gridDimY == 1, f"Expected gridDimY=1, got {native_config.gridDimY}" + assert native_config.gridDimZ == 1, f"Expected gridDimZ=1, got {native_config.gridDimZ}" + + except CUDAError: + pytest.skip("Driver or GPU not new enough for thread block clusters") + + def test_launch_invalid_values(init_cuda): code = 'extern "C" __global__ void my_kernel() {}' program = Program(code, "c++") From ee16510fb36b3df9f82d548d4fe249976ab041cd Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 08:36:31 -0400 Subject: [PATCH 041/113] Add Device.arch property for convenient compute capability string access (#877) * Initial plan * Add Device.arch property and update examples to use it Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Inline dev.arch calls in f-strings per PR feedback Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add release note for Device.arch property Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Use f-string instead of "".join for Device.arch property Co-authored-by: kkraus14 <3665167+kkraus14@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: kkraus14 <3665167+kkraus14@users.noreply.github.com> --- cuda_core/cuda/core/experimental/_device.py | 5 +++++ cuda_core/docs/source/release/0.X.Y-notes.rst | 2 +- cuda_core/examples/cuda_graphs.py | 3 +-- cuda_core/examples/memory_ops.py | 3 +-- cuda_core/examples/pytorch_example.py | 3 +-- cuda_core/examples/saxpy.py | 3 +-- cuda_core/examples/simple_multi_gpu_example.py | 6 ++---- cuda_core/examples/strided_memory_view_gpu.py | 3 +-- cuda_core/examples/vector_add.py | 3 +-- cuda_core/tests/test_device.py | 12 ++++++++++++ 10 files changed, 26 insertions(+), 17 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_device.py b/cuda_core/cuda/core/experimental/_device.py index 384db9195..0499baa58 100644 --- a/cuda_core/cuda/core/experimental/_device.py +++ b/cuda_core/cuda/core/experimental/_device.py @@ -1112,6 +1112,11 @@ def compute_capability(self) -> ComputeCapability: self.properties._cache["compute_capability"] = cc return cc + @property + def arch(self) -> str: + """Return compute capability as a string (e.g., '75' for CC 7.5).""" + return f"{self.compute_capability.major}{self.compute_capability.minor}" + @property def context(self) -> Context: """Return the current :obj:`~_context.Context` associated with this device. diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 3a9c7076a..7ad3f616d 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -24,7 +24,7 @@ Breaking Changes New features ------------ -None. +- Added :attr:`Device.arch` property that returns the compute capability as a string (e.g., '75' for CC 7.5), providing a convenient alternative to manually concatenating the compute capability tuple. New examples diff --git a/cuda_core/examples/cuda_graphs.py b/cuda_core/examples/cuda_graphs.py index b6c5edbe1..38c48fb11 100644 --- a/cuda_core/examples/cuda_graphs.py +++ b/cuda_core/examples/cuda_graphs.py @@ -53,8 +53,7 @@ def main(): cp.cuda.ExternalStream(int(stream.handle)).use() # Compile the program - arch = "".join(f"{i}" for i in dev.compute_capability) - program_options = ProgramOptions(std="c++17", arch=f"sm_{arch}") + program_options = ProgramOptions(std="c++17", arch=f"sm_{dev.arch}") prog = Program(code, code_type="c++", options=program_options) mod = prog.compile( "cubin", name_expressions=("vector_add", "vector_multiply", "vector_subtract") diff --git a/cuda_core/examples/memory_ops.py b/cuda_core/examples/memory_ops.py index 6f3de7a67..b12bc5039 100644 --- a/cuda_core/examples/memory_ops.py +++ b/cuda_core/examples/memory_ops.py @@ -54,8 +54,7 @@ cp.cuda.ExternalStream(int(stream.handle)).use() # Compile kernel -arch = "".join(f"{i}" for i in dev.compute_capability) -program_options = ProgramOptions(std="c++17", arch=f"sm_{arch}") +program_options = ProgramOptions(std="c++17", arch=f"sm_{dev.arch}") prog = Program(code, code_type="c++", options=program_options) mod = prog.compile("cubin") kernel = mod.get_kernel("memory_ops") diff --git a/cuda_core/examples/pytorch_example.py b/cuda_core/examples/pytorch_example.py index 11f049443..37288ebab 100644 --- a/cuda_core/examples/pytorch_example.py +++ b/cuda_core/examples/pytorch_example.py @@ -51,8 +51,7 @@ def __cuda_stream__(self): s = dev.create_stream(PyTorchStreamWrapper(pt_stream)) # prepare program -arch = "".join(f"{i}" for i in dev.compute_capability) -program_options = ProgramOptions(std="c++11", arch=f"sm_{arch}") +program_options = ProgramOptions(std="c++11", arch=f"sm_{dev.arch}") prog = Program(code, code_type="c++", options=program_options) mod = prog.compile( "cubin", diff --git a/cuda_core/examples/saxpy.py b/cuda_core/examples/saxpy.py index 6048c6d5d..4e4d548bb 100644 --- a/cuda_core/examples/saxpy.py +++ b/cuda_core/examples/saxpy.py @@ -38,8 +38,7 @@ s = dev.create_stream() # prepare program -arch = "".join(f"{i}" for i in dev.compute_capability) -program_options = ProgramOptions(std="c++11", arch=f"sm_{arch}") +program_options = ProgramOptions(std="c++11", arch=f"sm_{dev.arch}") prog = Program(code, code_type="c++", options=program_options) # Note the use of the `name_expressions` argument to specify the template diff --git a/cuda_core/examples/simple_multi_gpu_example.py b/cuda_core/examples/simple_multi_gpu_example.py index 456c7caca..1f9e43c03 100644 --- a/cuda_core/examples/simple_multi_gpu_example.py +++ b/cuda_core/examples/simple_multi_gpu_example.py @@ -40,8 +40,7 @@ } } """ -arch0 = "".join(f"{i}" for i in dev0.compute_capability) -prog_add = Program(code_add, code_type="c++", options={"std": "c++17", "arch": f"sm_{arch0}"}) +prog_add = Program(code_add, code_type="c++", options={"std": "c++17", "arch": f"sm_{dev0.arch}"}) mod_add = prog_add.compile("cubin") ker_add = mod_add.get_kernel("vector_add") @@ -63,8 +62,7 @@ } } """ -arch1 = "".join(f"{i}" for i in dev1.compute_capability) -prog_sub = Program(code_sub, code_type="c++", options={"std": "c++17", "arch": f"sm_{arch1}"}) +prog_sub = Program(code_sub, code_type="c++", options={"std": "c++17", "arch": f"sm_{dev1.arch}"}) mod_sub = prog_sub.compile("cubin") ker_sub = mod_sub.get_kernel("vector_sub") diff --git a/cuda_core/examples/strided_memory_view_gpu.py b/cuda_core/examples/strided_memory_view_gpu.py index 58bc9634b..5fb723ac7 100644 --- a/cuda_core/examples/strided_memory_view_gpu.py +++ b/cuda_core/examples/strided_memory_view_gpu.py @@ -103,8 +103,7 @@ def run(): # To know the GPU's compute capability, we need to identify which GPU to use. dev = Device(0) dev.set_current() - arch = "".join(f"{i}" for i in dev.compute_capability) - gpu_prog = Program(gpu_code, code_type="c++", options=ProgramOptions(arch=f"sm_{arch}", std="c++11")) + gpu_prog = Program(gpu_code, code_type="c++", options=ProgramOptions(arch=f"sm_{dev.arch}", std="c++11")) mod = gpu_prog.compile(target_type="cubin") gpu_ker = mod.get_kernel(func_name) diff --git a/cuda_core/examples/vector_add.py b/cuda_core/examples/vector_add.py index a5b9b036f..303c77418 100644 --- a/cuda_core/examples/vector_add.py +++ b/cuda_core/examples/vector_add.py @@ -33,8 +33,7 @@ s = dev.create_stream() # prepare program -arch = "".join(f"{i}" for i in dev.compute_capability) -program_options = ProgramOptions(std="c++17", arch=f"sm_{arch}") +program_options = ProgramOptions(std="c++17", arch=f"sm_{dev.arch}") prog = Program(code, code_type="c++", options=program_options) mod = prog.compile("cubin", name_expressions=("vector_add",)) diff --git a/cuda_core/tests/test_device.py b/cuda_core/tests/test_device.py index 2a135c49a..1eebd784f 100644 --- a/cuda_core/tests/test_device.py +++ b/cuda_core/tests/test_device.py @@ -105,6 +105,18 @@ def test_compute_capability(): assert device.compute_capability == expected_cc +def test_arch(): + device = Device() + # Test that arch returns the same as the old pattern + expected_arch = "".join(f"{i}" for i in device.compute_capability) + assert device.arch == expected_arch + # Test that it's a string + assert isinstance(device.arch, str) + # Test that it matches the expected format (e.g., "75" for CC 7.5) + cc = device.compute_capability + assert device.arch == f"{cc.major}{cc.minor}" + + cuda_base_properties = [ ("max_threads_per_block", int), ("max_block_dim_x", int), From 85da64b72c282b6ca463ad35ff253ff8df0b39c2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:16:23 -0400 Subject: [PATCH 042/113] Implement release threshold configuration for DeviceMemoryResource performance optimization (#875) * Initial plan * Implement release threshold configuration for DeviceMemoryResource performance optimization Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add performance demo for DeviceMemoryResource release threshold optimization Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix linting issues and format code with ruff Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove try-except wrapper and performance demo per code review feedback Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add release note for DeviceMemoryResource performance optimization Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add skip decorator for mempool support check in device memory test Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address code review feedback: move skip logic, add docstring note, update release note Co-authored-by: kkraus14 <3665167+kkraus14@users.noreply.github.com> * Remove verbose docstring Notes section per code review feedback Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: kkraus14 <3665167+kkraus14@users.noreply.github.com> --- cuda_core/cuda/core/experimental/_memory.py | 17 +++++++++++ cuda_core/docs/source/release/0.X.Y-notes.rst | 1 + cuda_core/tests/test_memory.py | 28 ++++++++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memory.py b/cuda_core/cuda/core/experimental/_memory.py index 190ba3e04..c8e7a4197 100644 --- a/cuda_core/cuda/core/experimental/_memory.py +++ b/cuda_core/cuda/core/experimental/_memory.py @@ -326,6 +326,23 @@ def __init__(self, device_id: int): self._handle = handle_return(driver.cuDeviceGetMemPool(device_id)) self._dev_id = device_id + # Set a higher release threshold to improve performance when there are no active allocations. + # By default, the release threshold is 0, which means memory is immediately released back + # to the OS when there are no active suballocations, causing performance issues. + # Check current release threshold + current_threshold = handle_return( + driver.cuMemPoolGetAttribute(self._handle, driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD) + ) + # If threshold is 0 (default), set it to maximum to retain memory in the pool + if int(current_threshold) == 0: + handle_return( + driver.cuMemPoolSetAttribute( + self._handle, + driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + driver.cuuint64_t(0xFFFFFFFFFFFFFFFF), + ) + ) + def allocate(self, size: int, stream: Stream = None) -> Buffer: """Allocate a buffer of the requested size. diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 7ad3f616d..996604494 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -36,4 +36,5 @@ None. Fixes and enhancements ---------------------- +- Improved :class:`DeviceMemoryResource` allocation performance when there are no active allocations by setting a higher release threshold (addresses issue #771). - Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). \ No newline at end of file diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index 245404646..2ba7b418f 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -10,7 +10,7 @@ import pytest -from cuda.core.experimental import Buffer, Device, MemoryResource +from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, MemoryResource from cuda.core.experimental._memory import DLDeviceType from cuda.core.experimental._utils.cuda_utils import handle_return @@ -257,3 +257,29 @@ def test_buffer_dunder_dlpack_device_failure(): buffer = dummy_mr.allocate(size=1024) with pytest.raises(BufferError, match=r"^buffer is neither device-accessible nor host-accessible$"): buffer.__dlpack_device__() + + +def test_device_memory_resource_initialization(): + """Test that DeviceMemoryResource can be initialized successfully. + + This test verifies that the DeviceMemoryResource initializes properly, + including the release threshold configuration for performance optimization. + """ + device = Device() + if not device.properties.memory_pools_supported: + pytest.skip("memory pools not supported") + device.set_current() + + # This should succeed and configure the memory pool release threshold + mr = DeviceMemoryResource(device.device_id) + + # Verify basic properties + assert mr.device_id == device.device_id + assert mr.is_device_accessible is True + assert mr.is_host_accessible is False + + # Test allocation/deallocation works + buffer = mr.allocate(1024) + assert buffer.size == 1024 + assert buffer.device_id == device.device_id + buffer.close() From 05952a34f521f5482027a9da1cb01f336f3f3b4d Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk <21087696+oleksandr-pavlyk@users.noreply.github.com> Date: Thu, 21 Aug 2025 13:03:07 -0500 Subject: [PATCH 043/113] Fix an apparent mistake in GraphBuilder.add_child (#879) * Fix an apparent mistake in GraphBuilder.add_child While working on C++ stand-alone code executing what `test_graph.py` does in gh-843, I noticed that `add_child` passes dependendencies extracted from capturing stream inconsistently with num_dependencies parameter obtained in the same cuStreamGetCaptureInfo call. Incidentally, after correcting this error, I can no longer reproduce errors reported in gh-843 * Implemented fix to work with both CTK 12.9 and CTK 13.0 --- cuda_core/cuda/core/experimental/_graph.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_graph.py b/cuda_core/cuda/core/experimental/_graph.py index cc394a8e6..b8ebe9ae5 100644 --- a/cuda_core/cuda/core/experimental/_graph.py +++ b/cuda_core/cuda/core/experimental/_graph.py @@ -683,11 +683,14 @@ def add_child(self, child_graph: GraphBuilder): driver.cuStreamGetCaptureInfo(stream_handle) ) + # See https://github.com/NVIDIA/cuda-python/pull/879#issuecomment-3211054159 + # for rationale + deps_info_trimmed = deps_info_out[:num_dependencies_out] deps_info_update = [ [ handle_return( driver.cuGraphAddChildGraphNode( - graph_out, deps_info_out[0], num_dependencies_out, child_graph._mnff.graph + graph_out, *deps_info_trimmed, num_dependencies_out, child_graph._mnff.graph ) ) ] From 2ac8554596bd6335e4f6ed54ca50bf6d85fdc0a2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:18:12 -0400 Subject: [PATCH 044/113] Switch to nvidia-sphinx-theme with backward-compatible version switching (#874) * Initial plan * Switch to nvidia-sphinx-theme and update version JSON format Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Temporarily disable test jobs in CI, keeping only wheel build and doc jobs Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address PR feedback: Fix CI workflow and preserve original versions.json files - Modify CI workflow to only comment out test-linux/test-windows in needs section instead of entire status check job - Revert all versions.json files to original format for backward compatibility - Create new nv-versions.json files with new format for nvidia-sphinx-theme - Update sphinx config files to reference new nv-versions.json files Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix sphinx version constraint to resolve nvidia-sphinx-theme CI failure Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Revert sphinx version constraint changes from commit c72a6b2 Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Comment out proxy cache in docs build to debug nvidia-sphinx-theme installation Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Revert ci.yml changes and remove proxy cache from build-docs.yml Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- .github/workflows/build-docs.yml | 4 +- cuda_bindings/docs/nv-versions.json | 30 +++++++++ .../_static/javascripts/version_dropdown.js | 61 ------------------- .../_templates/sidebar/variant-selector.html | 24 -------- cuda_bindings/docs/source/conf.py | 30 +++------ cuda_core/docs/nv-versions.json | 30 +++++++++ .../_static/javascripts/version_dropdown.js | 61 ------------------- .../_templates/sidebar/variant-selector.html | 24 -------- cuda_core/docs/source/conf.py | 30 +++------ cuda_python/docs/environment-docs.yml | 3 +- cuda_python/docs/nv-versions.json | 30 +++++++++ .../_static/javascripts/version_dropdown.js | 61 ------------------- .../_templates/sidebar/variant-selector.html | 24 -------- cuda_python/docs/source/conf.py | 30 +++------ 14 files changed, 123 insertions(+), 319 deletions(-) create mode 100644 cuda_bindings/docs/nv-versions.json delete mode 100644 cuda_bindings/docs/source/_static/javascripts/version_dropdown.js delete mode 100644 cuda_bindings/docs/source/_templates/sidebar/variant-selector.html create mode 100644 cuda_core/docs/nv-versions.json delete mode 100644 cuda_core/docs/source/_static/javascripts/version_dropdown.js delete mode 100644 cuda_core/docs/source/_templates/sidebar/variant-selector.html create mode 100644 cuda_python/docs/nv-versions.json delete mode 100644 cuda_python/docs/source/_static/javascripts/version_dropdown.js delete mode 100644 cuda_python/docs/source/_templates/sidebar/variant-selector.html diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 0e8af64cb..ed58b4f26 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -52,9 +52,7 @@ jobs: fetch-depth: 0 ref: ${{ inputs.git-tag }} - - name: Setup proxy cache - uses: nv-gha-runners/setup-proxy-cache@main - continue-on-error: true + # TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache - name: Set up miniforge uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 diff --git a/cuda_bindings/docs/nv-versions.json b/cuda_bindings/docs/nv-versions.json new file mode 100644 index 000000000..0031e6238 --- /dev/null +++ b/cuda_bindings/docs/nv-versions.json @@ -0,0 +1,30 @@ +[ + { + "version": "latest", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/latest/" + }, + { + "version": "13.0.1", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.0.1/" + }, + { + "version": "13.0.0", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.0.0/" + }, + { + "version": "12.9.0", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.0/" + }, + { + "version": "12.8.0", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.8.0/" + }, + { + "version": "12.6.2", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.6.2/" + }, + { + "version": "12.6.1", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.6.1/" + } +] diff --git a/cuda_bindings/docs/source/_static/javascripts/version_dropdown.js b/cuda_bindings/docs/source/_static/javascripts/version_dropdown.js deleted file mode 100644 index 9348d2bf8..000000000 --- a/cuda_bindings/docs/source/_static/javascripts/version_dropdown.js +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -function change_current_version(event) { - event.preventDefault(); - - var selectedVersion = event.target.textContent; - var currentVersion = document.getElementById('currentVersion'); - - // need to update both the on-screen state and the internal (persistent) storage - currentVersion.textContent = selectedVersion; - sessionStorage.setItem("currentVersion", selectedVersion); - - // Navigate to the clicked URL - window.location.href = event.target.href; -} - - -function add_version_dropdown(jsonLoc, targetLoc, currentVersion) { - var otherVersionsDiv = document.getElementById('otherVersions'); - - fetch(jsonLoc) - .then(function(response) { - return response.json(); - }) - .then(function(data) { - var versions = data; - - if (Object.keys(versions).length >= 1) { - var dlElement = document.createElement('dl'); - var dtElement = document.createElement('dt'); - dtElement.textContent = 'Versions'; - dlElement.appendChild(dtElement); - - for (var ver in versions) { - var url = versions[ver]; - var ddElement = document.createElement('dd'); - var aElement = document.createElement('a'); - aElement.setAttribute('href', targetLoc + url); - aElement.textContent = ver; - - if (ver === currentVersion) { - var strongElement = document.createElement('strong'); - strongElement.appendChild(aElement); - aElement = strongElement; - } - - ddElement.appendChild(aElement); - // Attach event listeners to version links - ddElement.addEventListener('click', change_current_version); - dlElement.appendChild(ddElement); - } - - otherVersionsDiv.innerHTML = ''; - otherVersionsDiv.appendChild(dlElement); - } - }) - .catch(function(error) { - console.error('Error fetching version.json:', error); - }); -} diff --git a/cuda_bindings/docs/source/_templates/sidebar/variant-selector.html b/cuda_bindings/docs/source/_templates/sidebar/variant-selector.html deleted file mode 100644 index b041194c5..000000000 --- a/cuda_bindings/docs/source/_templates/sidebar/variant-selector.html +++ /dev/null @@ -1,24 +0,0 @@ -
- - cuda-bindings - v: {{ version }} - - -
-
-
-
- - - diff --git a/cuda_bindings/docs/source/conf.py b/cuda_bindings/docs/source/conf.py index c156cb4cc..93427d363 100644 --- a/cuda_bindings/docs/source/conf.py +++ b/cuda_bindings/docs/source/conf.py @@ -59,27 +59,17 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_baseurl = "docs" -html_theme = "furo" -# html_theme = 'pydata_sphinx_theme' +html_theme = "nvidia_sphinx_theme" html_theme_options = { - "light_logo": "logo-light-mode.png", - "dark_logo": "logo-dark-mode.png", - # For pydata_sphinx_theme: - # "logo": { - # "image_light": "_static/logo-light-mode.png", - # "image_dark": "_static/logo-dark-mode.png", - # }, - # "switcher": { - # "json_url": "https://nvidia.github.io/cuda-python/cuda-bindings/versions.json", - # "version_match": release, - # }, - ## Add light/dark mode and documentation version switcher - # "navbar_end": [ - # "search-button", - # "theme-switcher", - # "version-switcher", - # "navbar-icon-links", - # ], + "switcher": { + "json_url": "https://nvidia.github.io/cuda-python/cuda-bindings/nv-versions.json", + "version_match": release, + }, + # Add light/dark mode and documentation version switcher + "navbar_center": [ + "version-switcher", + "navbar-nav", + ], } if os.environ.get("CI"): if int(os.environ.get("BUILD_PREVIEW", 0)): diff --git a/cuda_core/docs/nv-versions.json b/cuda_core/docs/nv-versions.json new file mode 100644 index 000000000..d1c10914c --- /dev/null +++ b/cuda_core/docs/nv-versions.json @@ -0,0 +1,30 @@ +[ + { + "version": "latest", + "url": "https://nvidia.github.io/cuda-python/cuda-core/latest/" + }, + { + "version": "0.3.2", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.3.2/" + }, + { + "version": "0.3.1", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.3.1/" + }, + { + "version": "0.3.0", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.3.0/" + }, + { + "version": "0.2.0", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.2.0/" + }, + { + "version": "0.1.1", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.1.1/" + }, + { + "version": "0.1.0", + "url": "https://nvidia.github.io/cuda-python/cuda-core/0.1.0/" + } +] diff --git a/cuda_core/docs/source/_static/javascripts/version_dropdown.js b/cuda_core/docs/source/_static/javascripts/version_dropdown.js deleted file mode 100644 index 5878c344f..000000000 --- a/cuda_core/docs/source/_static/javascripts/version_dropdown.js +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -function change_current_version(event) { - event.preventDefault(); - - var selectedVersion = event.target.textContent; - var currentVersion = document.getElementById('currentVersion'); - - // need to update both the on-screen state and the internal (persistent) storage - currentVersion.textContent = selectedVersion; - sessionStorage.setItem("currentVersion", selectedVersion); - - // Navigate to the clicked URL - window.location.href = event.target.href; -} - - -function add_version_dropdown(jsonLoc, targetLoc, currentVersion) { - var otherVersionsDiv = document.getElementById('otherVersions'); - - fetch(jsonLoc) - .then(function(response) { - return response.json(); - }) - .then(function(data) { - var versions = data; - - if (Object.keys(versions).length >= 1) { - var dlElement = document.createElement('dl'); - var dtElement = document.createElement('dt'); - dtElement.textContent = 'Versions'; - dlElement.appendChild(dtElement); - - for (var ver in versions) { - var url = versions[ver]; - var ddElement = document.createElement('dd'); - var aElement = document.createElement('a'); - aElement.setAttribute('href', targetLoc + url); - aElement.textContent = ver; - - if (ver === currentVersion) { - var strongElement = document.createElement('strong'); - strongElement.appendChild(aElement); - aElement = strongElement; - } - - ddElement.appendChild(aElement); - // Attach event listeners to version links - ddElement.addEventListener('click', change_current_version); - dlElement.appendChild(ddElement); - } - - otherVersionsDiv.innerHTML = ''; - otherVersionsDiv.appendChild(dlElement); - } - }) - .catch(function(error) { - console.error('Error fetching version.json:', error); - }); -} diff --git a/cuda_core/docs/source/_templates/sidebar/variant-selector.html b/cuda_core/docs/source/_templates/sidebar/variant-selector.html deleted file mode 100644 index 7110d24a6..000000000 --- a/cuda_core/docs/source/_templates/sidebar/variant-selector.html +++ /dev/null @@ -1,24 +0,0 @@ -
- - cuda-core - v: {{ version }} - - -
-
-
-
- - - diff --git a/cuda_core/docs/source/conf.py b/cuda_core/docs/source/conf.py index fd62db467..c172d0995 100644 --- a/cuda_core/docs/source/conf.py +++ b/cuda_core/docs/source/conf.py @@ -56,27 +56,17 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_baseurl = "docs" -html_theme = "furo" -# html_theme = 'pydata_sphinx_theme' +html_theme = "nvidia_sphinx_theme" html_theme_options = { - "light_logo": "logo-light-mode.png", - "dark_logo": "logo-dark-mode.png", - # For pydata_sphinx_theme: - # "logo": { - # "image_light": "_static/logo-light-mode.png", - # "image_dark": "_static/logo-dark-mode.png", - # }, - # "switcher": { - # "json_url": "https://nvidia.github.io/cuda-python/cuda-core/versions.json", - # "version_match": release, - # }, - ## Add light/dark mode and documentation version switcher - # "navbar_end": [ - # "search-button", - # "theme-switcher", - # "version-switcher", - # "navbar-icon-links", - # ], + "switcher": { + "json_url": "https://nvidia.github.io/cuda-python/cuda-core/nv-versions.json", + "version_match": release, + }, + # Add light/dark mode and documentation version switcher + "navbar_center": [ + "version-switcher", + "navbar-nav", + ], } if os.environ.get("CI"): if int(os.environ.get("BUILD_PREVIEW", 0)): diff --git a/cuda_python/docs/environment-docs.yml b/cuda_python/docs/environment-docs.yml index a3e10599e..47f1875e3 100644 --- a/cuda_python/docs/environment-docs.yml +++ b/cuda_python/docs/environment-docs.yml @@ -15,8 +15,9 @@ dependencies: - scipy - sphinx <8.2.0 - sphinx-copybutton - - furo - myst-nb - enum_tools - sphinx-toolbox - pyclibrary + - pip: + - nvidia-sphinx-theme diff --git a/cuda_python/docs/nv-versions.json b/cuda_python/docs/nv-versions.json new file mode 100644 index 000000000..bb4358039 --- /dev/null +++ b/cuda_python/docs/nv-versions.json @@ -0,0 +1,30 @@ +[ + { + "version": "latest", + "url": "https://nvidia.github.io/cuda-python/latest/" + }, + { + "version": "13.0.1", + "url": "https://nvidia.github.io/cuda-python/13.0.1/" + }, + { + "version": "13.0.0", + "url": "https://nvidia.github.io/cuda-python/13.0.0/" + }, + { + "version": "12.9.0", + "url": "https://nvidia.github.io/cuda-python/12.9.0/" + }, + { + "version": "12.8.0", + "url": "https://nvidia.github.io/cuda-python/12.8.0/" + }, + { + "version": "12.6.2", + "url": "https://nvidia.github.io/cuda-python/12.6.2/" + }, + { + "version": "12.6.1", + "url": "https://nvidia.github.io/cuda-python/12.6.1/" + } +] diff --git a/cuda_python/docs/source/_static/javascripts/version_dropdown.js b/cuda_python/docs/source/_static/javascripts/version_dropdown.js deleted file mode 100644 index 9348d2bf8..000000000 --- a/cuda_python/docs/source/_static/javascripts/version_dropdown.js +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -function change_current_version(event) { - event.preventDefault(); - - var selectedVersion = event.target.textContent; - var currentVersion = document.getElementById('currentVersion'); - - // need to update both the on-screen state and the internal (persistent) storage - currentVersion.textContent = selectedVersion; - sessionStorage.setItem("currentVersion", selectedVersion); - - // Navigate to the clicked URL - window.location.href = event.target.href; -} - - -function add_version_dropdown(jsonLoc, targetLoc, currentVersion) { - var otherVersionsDiv = document.getElementById('otherVersions'); - - fetch(jsonLoc) - .then(function(response) { - return response.json(); - }) - .then(function(data) { - var versions = data; - - if (Object.keys(versions).length >= 1) { - var dlElement = document.createElement('dl'); - var dtElement = document.createElement('dt'); - dtElement.textContent = 'Versions'; - dlElement.appendChild(dtElement); - - for (var ver in versions) { - var url = versions[ver]; - var ddElement = document.createElement('dd'); - var aElement = document.createElement('a'); - aElement.setAttribute('href', targetLoc + url); - aElement.textContent = ver; - - if (ver === currentVersion) { - var strongElement = document.createElement('strong'); - strongElement.appendChild(aElement); - aElement = strongElement; - } - - ddElement.appendChild(aElement); - // Attach event listeners to version links - ddElement.addEventListener('click', change_current_version); - dlElement.appendChild(ddElement); - } - - otherVersionsDiv.innerHTML = ''; - otherVersionsDiv.appendChild(dlElement); - } - }) - .catch(function(error) { - console.error('Error fetching version.json:', error); - }); -} diff --git a/cuda_python/docs/source/_templates/sidebar/variant-selector.html b/cuda_python/docs/source/_templates/sidebar/variant-selector.html deleted file mode 100644 index bec47cf47..000000000 --- a/cuda_python/docs/source/_templates/sidebar/variant-selector.html +++ /dev/null @@ -1,24 +0,0 @@ -
- - cuda-python - v: {{ version }} - - -
-
-
-
- - - diff --git a/cuda_python/docs/source/conf.py b/cuda_python/docs/source/conf.py index aae73eb11..9bd3dcc78 100644 --- a/cuda_python/docs/source/conf.py +++ b/cuda_python/docs/source/conf.py @@ -52,27 +52,17 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_baseurl = "docs" -html_theme = "furo" -# html_theme = 'pydata_sphinx_theme' +html_theme = "nvidia_sphinx_theme" html_theme_options = { - "light_logo": "logo-light-mode.png", - "dark_logo": "logo-dark-mode.png", - # For pydata_sphinx_theme: - # "logo": { - # "image_light": "_static/logo-light-mode.png", - # "image_dark": "_static/logo-dark-mode.png", - # }, - # "switcher": { - # "json_url": "https://nvidia.github.io/cuda-python/cuda-core/versions.json", - # "version_match": release, - # }, - ## Add light/dark mode and documentation version switcher - # "navbar_end": [ - # "search-button", - # "theme-switcher", - # "version-switcher", - # "navbar-icon-links", - # ], + "switcher": { + "json_url": "https://nvidia.github.io/cuda-python/nv-versions.json", + "version_match": release, + }, + # Add light/dark mode and documentation version switcher + "navbar_center": [ + "version-switcher", + "navbar-nav", + ], } if os.environ.get("CI"): if int(os.environ.get("BUILD_PREVIEW", 0)): From 3443f9a2dbd577573d1d14a48be858d53f5339d4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:31:01 -0400 Subject: [PATCH 045/113] Update cuda-core release notes: Add missing milestone 19 PRs (#881) * Initial plan * Update cuda-core release notes: Add missing milestone 19 PRs Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- cuda_core/docs/source/release/0.X.Y-notes.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 996604494..fb505b6f0 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -37,4 +37,6 @@ Fixes and enhancements ---------------------- - Improved :class:`DeviceMemoryResource` allocation performance when there are no active allocations by setting a higher release threshold (addresses issue #771). -- Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). \ No newline at end of file +- Improved :class:`StridedMemoryView` creation time performance by optimizing shape and strides tuple creation using Python/C API (addresses issue #449). +- Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). +- Fixed a bug in :class:`GraphBuilder.add_child` where dependencies extracted from capturing stream were passed inconsistently with num_dependencies parameter (addresses issue #843). \ No newline at end of file From 8c685beae784fa7803a5a8c646d9dc6be3892187 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 18 Aug 2025 09:55:05 -0400 Subject: [PATCH 046/113] Fix #449: Delay construction of Python attributes --- .../cuda/core/experimental/_memoryview.pyx | 125 +++++++++++------- cuda_core/tests/test_utils.py | 32 +++++ 2 files changed, 110 insertions(+), 47 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 31482229c..418967fa5 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -18,7 +18,6 @@ from cuda.core.experimental._utils cimport cuda_utils # TODO(leofang): support NumPy structured dtypes -@cython.dataclasses.dataclass cdef class StridedMemoryView: """A dataclass holding metadata of a strided dense array/tensor. @@ -51,7 +50,7 @@ cdef class StridedMemoryView: Pointer to the tensor buffer (as a Python `int`). shape : tuple Shape of the tensor. - strides : tuple + strides : Optional[tuple] Strides of the tensor (in **counts**, not bytes). dtype: numpy.dtype Data type of the tensor. @@ -70,19 +69,22 @@ cdef class StridedMemoryView: obj : Any Any objects that supports either DLPack (up to v1.0) or CUDA Array Interface (v3). - stream_ptr: int + stream_ptr: Optional[int] The pointer address (as Python `int`) to the **consumer** stream. Stream ordering will be properly established unless ``-1`` is passed. """ - # TODO: switch to use Cython's cdef typing? - ptr: int = None - shape: tuple = None - strides: tuple = None # in counts, not bytes - dtype: numpy.dtype = None - device_id: int = None # -1 for CPU - is_device_accessible: bool = None - readonly: bool = None - exporting_obj: Any = None + cdef readonly: + intptr_t ptr + int device_id + bint is_device_accessible + bint readonly + object exporting_obj + + # The tensor object if has obj has __dlpack__, otherwise must be NULL + cdef DLTensor *dl_tensor + # A strong reference to the result of obj.__dlpack__() so we + # can lazily create shape and strides from it later + cdef object dlpack_capsule def __init__(self, obj=None, stream_ptr=None): if obj is not None: @@ -92,9 +94,50 @@ cdef class StridedMemoryView: else: view_as_cai(obj, stream_ptr, self) else: - # default construct pass + @property + def shape(self) -> tuple[int]: + if self.exporting_obj is not None: + if self.dl_tensor != NULL: + return cuda_utils.carray_int64_t_to_tuple( + self.dl_tensor.shape, + self.dl_tensor.ndim + ) + else: + return self.exporting_obj.__cuda_array_interface__["shape"] + return () + + @property + def strides(self) -> Optional[tuple[int]]: + cdef int itemsize + if self.exporting_obj is not None: + if self.dl_tensor != NULL: + if self.dl_tensor.strides: + return cuda_utils.carray_int64_t_to_tuple( + self.dl_tensor.strides, + self.dl_tensor.ndim + ) + else: + strides = self.exporting_obj.__cuda_array_interface__.get("strides") + if strides is not None: + itemsize = self.dtype.itemsize + result = cpython.PyTuple_New(len(strides)) + for i in range(len(strides)): + cpython.PyTuple_SET_ITEM(result, i, strides[i] // itemsize) + return result + return None + + @property + def dtype(self) -> Optional[numpy.dtype]: + if self.exporting_obj is not None: + if self.dl_tensor != NULL: + return dtype_dlpack_to_numpy(&self.dl_tensor.dtype) + else: + # TODO: this only works for built-in numeric types + return numpy.dtype(self.exporting_obj.__cuda_array_interface__["typestr"]) + return None + def __repr__(self): return (f"StridedMemoryView(ptr={self.ptr},\n" + f" shape={self.shape},\n" @@ -152,7 +195,7 @@ cdef class _StridedMemoryViewProxy: cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): cdef int dldevice, device_id, i - cdef bint is_device_accessible, versioned, is_readonly + cdef bint is_device_accessible, is_readonly is_device_accessible = False dldevice, device_id = obj.__dlpack_device__() if dldevice == _kDLCPU: @@ -193,7 +236,6 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): capsule, DLPACK_VERSIONED_TENSOR_UNUSED_NAME): data = cpython.PyCapsule_GetPointer( capsule, DLPACK_VERSIONED_TENSOR_UNUSED_NAME) - versioned = True dlm_tensor_ver = data dl_tensor = &dlm_tensor_ver.dl_tensor is_readonly = bool((dlm_tensor_ver.flags & DLPACK_FLAG_BITMASK_READ_ONLY) != 0) @@ -202,7 +244,6 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): capsule, DLPACK_TENSOR_UNUSED_NAME): data = cpython.PyCapsule_GetPointer( capsule, DLPACK_TENSOR_UNUSED_NAME) - versioned = False dlm_tensor = data dl_tensor = &dlm_tensor.dl_tensor is_readonly = False @@ -210,24 +251,17 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): else: assert False + cpython.PyCapsule_SetName(capsule, used_name) + cdef StridedMemoryView buf = StridedMemoryView() if view is None else view + buf.dl_tensor = dl_tensor + buf.dlpack_capsule = capsule buf.ptr = (dl_tensor.data) - - buf.shape = cuda_utils.carray_int64_t_to_tuple(dl_tensor.shape, dl_tensor.ndim) - if dl_tensor.strides: - buf.strides = cuda_utils.carray_int64_t_to_tuple(dl_tensor.strides, dl_tensor.ndim) - else: - # C-order - buf.strides = None - - buf.dtype = dtype_dlpack_to_numpy(&dl_tensor.dtype) buf.device_id = device_id buf.is_device_accessible = is_device_accessible buf.readonly = is_readonly buf.exporting_obj = obj - cpython.PyCapsule_SetName(capsule, used_name) - return buf @@ -291,7 +325,8 @@ cdef object dtype_dlpack_to_numpy(DLDataType* dtype): return numpy.dtype(np_dtype) -cdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): +# Also generate for Python so we can test this code path +cpdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): cdef dict cai_data = obj.__cuda_array_interface__ if cai_data["version"] < 3: raise BufferError("only CUDA Array Interface v3 or above is supported") @@ -302,14 +337,8 @@ cdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): cdef StridedMemoryView buf = StridedMemoryView() if view is None else view buf.exporting_obj = obj + buf.dl_tensor = NULL buf.ptr, buf.readonly = cai_data["data"] - buf.shape = cai_data["shape"] - # TODO: this only works for built-in numeric types - buf.dtype = numpy.dtype(cai_data["typestr"]) - buf.strides = cai_data.get("strides") - if buf.strides is not None: - # convert to counts - buf.strides = tuple(s // buf.dtype.itemsize for s in buf.strides) buf.is_device_accessible = True buf.device_id = handle_return( driver.cuPointerGetAttribute( @@ -317,18 +346,20 @@ cdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): buf.ptr)) cdef intptr_t producer_s, consumer_s - stream = cai_data.get("stream") - if stream is not None: - producer_s = (stream) - consumer_s = (stream_ptr) - assert producer_s > 0 - # establish stream order - if producer_s != consumer_s: - e = handle_return(driver.cuEventCreate( - driver.CUevent_flags.CU_EVENT_DISABLE_TIMING)) - handle_return(driver.cuEventRecord(e, producer_s)) - handle_return(driver.cuStreamWaitEvent(consumer_s, e, 0)) - handle_return(driver.cuEventDestroy(e)) + stream_ptr = int(stream_ptr) if stream_ptr is not None else -1 + if stream_ptr != -1: + stream = cai_data.get("stream") + if stream is not None: + producer_s = (stream) + consumer_s = (stream_ptr) + assert producer_s > 0 + # establish stream order + if producer_s != consumer_s: + e = handle_return(driver.cuEventCreate( + driver.CUevent_flags.CU_EVENT_DISABLE_TIMING)) + handle_return(driver.cuEventRecord(e, producer_s)) + handle_return(driver.cuStreamWaitEvent(consumer_s, e, 0)) + handle_return(driver.cuEventDestroy(e)) return buf diff --git a/cuda_core/tests/test_utils.py b/cuda_core/tests/test_utils.py index e35f2c7b0..7980da185 100644 --- a/cuda_core/tests/test_utils.py +++ b/cuda_core/tests/test_utils.py @@ -15,6 +15,7 @@ import cuda.core.experimental from cuda.core.experimental import Device +from cuda.core.experimental._memoryview import view_as_cai from cuda.core.experimental.utils import StridedMemoryView, args_viewable_as_strided_memory @@ -164,3 +165,34 @@ def _check_view(self, view, in_arr, dev): assert view.is_device_accessible is True assert view.exporting_obj is in_arr # can't test view.readonly with CuPy or Numba... + + +@pytest.mark.skipif(cp is None, reason="CuPy is not installed") +@pytest.mark.parametrize("in_arr,use_stream", (*gpu_array_samples(),)) +class TestViewCudaArrayInterfaceGPU: + def test_cuda_array_interface_gpu(self, in_arr, use_stream): + # TODO: use the device fixture? + dev = Device() + dev.set_current() + # This is the consumer stream + s = dev.create_stream() if use_stream else None + + # The usual path in `StridedMemoryView` prefers the DLPack interface + # over __cuda_array_interface__, so we call `view_as_cai` directly + # here so we can test the CAI code path. + view = view_as_cai(in_arr, stream_ptr=s.handle if s else -1) + self._check_view(view, in_arr, dev) + + def _check_view(self, view, in_arr, dev): + assert isinstance(view, StridedMemoryView) + assert view.ptr == gpu_array_ptr(in_arr) + assert view.shape == in_arr.shape + strides_in_counts = convert_strides_to_counts(in_arr.strides, in_arr.dtype.itemsize) + if in_arr.flags["C_CONTIGUOUS"]: + assert view.strides is None + else: + assert view.strides == strides_in_counts + assert view.dtype == in_arr.dtype + assert view.device_id == dev.device_id + assert view.is_device_accessible is True + assert view.exporting_obj is in_arr From a0f16902904a1f593d388234f57c45aa9ed7128c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 18 Aug 2025 10:02:36 -0400 Subject: [PATCH 047/113] Fix type of device_id --- cuda_core/cuda/core/experimental/_memoryview.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 418967fa5..a39da887b 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -75,7 +75,7 @@ cdef class StridedMemoryView: """ cdef readonly: intptr_t ptr - int device_id + intptr_t device_id bint is_device_accessible bint readonly object exporting_obj From 9a9a928eaa27f4aaf6c93476cdcfb7d5ae487199 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 18 Aug 2025 11:29:44 -0400 Subject: [PATCH 048/113] Update cuda_core/cuda/core/experimental/_memoryview.pyx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cuda_core/cuda/core/experimental/_memoryview.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index a39da887b..24b644e58 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -78,7 +78,7 @@ cdef class StridedMemoryView: intptr_t device_id bint is_device_accessible bint readonly - object exporting_obj + object exporting_obj # The tensor object if has obj has __dlpack__, otherwise must be NULL cdef DLTensor *dl_tensor From 06d4ab41cd7bbbb0605bbabf392f51d524788190 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 19 Aug 2025 11:40:24 -0400 Subject: [PATCH 049/113] Memoize the properties shape, strides, and dtype --- .../cuda/core/experimental/_memoryview.pyx | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 24b644e58..2996d5894 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -69,7 +69,7 @@ cdef class StridedMemoryView: obj : Any Any objects that supports either DLPack (up to v1.0) or CUDA Array Interface (v3). - stream_ptr: Optional[int] + stream_ptr: int The pointer address (as Python `int`) to the **consumer** stream. Stream ordering will be properly established unless ``-1`` is passed. """ @@ -85,6 +85,11 @@ cdef class StridedMemoryView: # A strong reference to the result of obj.__dlpack__() so we # can lazily create shape and strides from it later cdef object dlpack_capsule + + # Memoized properties + cdef tuple _shape + cdef object _strides + cdef object _dtype def __init__(self, obj=None, stream_ptr=None): if obj is not None: @@ -98,23 +103,25 @@ cdef class StridedMemoryView: @property def shape(self) -> tuple[int]: - if self.exporting_obj is not None: + if self._shape is None and self.exporting_obj is not None: if self.dl_tensor != NULL: - return cuda_utils.carray_int64_t_to_tuple( + self._shape = cuda_utils.carray_int64_t_to_tuple( self.dl_tensor.shape, self.dl_tensor.ndim ) else: - return self.exporting_obj.__cuda_array_interface__["shape"] - return () + self._shape = self.exporting_obj.__cuda_array_interface__["shape"] + else: + self._shape = () + return self._shape @property def strides(self) -> Optional[tuple[int]]: cdef int itemsize - if self.exporting_obj is not None: + if self._strides is None and self.exporting_obj is not None: if self.dl_tensor != NULL: if self.dl_tensor.strides: - return cuda_utils.carray_int64_t_to_tuple( + self._strides = cuda_utils.carray_int64_t_to_tuple( self.dl_tensor.strides, self.dl_tensor.ndim ) @@ -122,21 +129,21 @@ cdef class StridedMemoryView: strides = self.exporting_obj.__cuda_array_interface__.get("strides") if strides is not None: itemsize = self.dtype.itemsize - result = cpython.PyTuple_New(len(strides)) + self._strides = cpython.PyTuple_New(len(strides)) for i in range(len(strides)): - cpython.PyTuple_SET_ITEM(result, i, strides[i] // itemsize) - return result - return None + cpython.PyTuple_SET_ITEM(self._strides, i, strides[i] // itemsize) + return self._strides @property def dtype(self) -> Optional[numpy.dtype]: - if self.exporting_obj is not None: - if self.dl_tensor != NULL: - return dtype_dlpack_to_numpy(&self.dl_tensor.dtype) - else: - # TODO: this only works for built-in numeric types - return numpy.dtype(self.exporting_obj.__cuda_array_interface__["typestr"]) - return None + if self._dtype is None: + if self.exporting_obj is not None: + if self.dl_tensor != NULL: + self._dtype = dtype_dlpack_to_numpy(&self.dl_tensor.dtype) + else: + # TODO: this only works for built-in numeric types + self._dtype = numpy.dtype(self.exporting_obj.__cuda_array_interface__["typestr"]) + return self._dtype def __repr__(self): return (f"StridedMemoryView(ptr={self.ptr},\n" From 5c1b7a92074021ff0565cb5d63700875656d8657 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 19 Aug 2025 11:41:50 -0400 Subject: [PATCH 050/113] We don't need to handle stream_ptr == None --- cuda_core/cuda/core/experimental/_memoryview.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 2996d5894..4b887c035 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -353,7 +353,7 @@ cpdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): buf.ptr)) cdef intptr_t producer_s, consumer_s - stream_ptr = int(stream_ptr) if stream_ptr is not None else -1 + stream_ptr = int(stream_ptr) if stream_ptr != -1: stream = cai_data.get("stream") if stream is not None: From d9270a151c2814268652f43701bfc6c03432b0ff Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 19 Aug 2025 11:55:51 -0400 Subject: [PATCH 051/113] device_id can be an int --- cuda_core/cuda/core/experimental/_memoryview.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 4b887c035..053d3a6ff 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -75,7 +75,7 @@ cdef class StridedMemoryView: """ cdef readonly: intptr_t ptr - intptr_t device_id + int device_id bint is_device_accessible bint readonly object exporting_obj From 0078990c29382b2284b24e98864a6998716d2924 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 19 Aug 2025 11:56:04 -0400 Subject: [PATCH 052/113] Also cache the cai_data --- .../cuda/core/experimental/_memoryview.pyx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 053d3a6ff..584a9ba9e 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -80,11 +80,14 @@ cdef class StridedMemoryView: bint readonly object exporting_obj + # If using dlpack, this is a strong reference to the result of + # obj.__dlpack__() so we can lazily create shape and strides from + # it later. If using CAI, this is a reference to the source + # `__cuda_array_interface__` object. + cdef object metadata + # The tensor object if has obj has __dlpack__, otherwise must be NULL cdef DLTensor *dl_tensor - # A strong reference to the result of obj.__dlpack__() so we - # can lazily create shape and strides from it later - cdef object dlpack_capsule # Memoized properties cdef tuple _shape @@ -110,7 +113,7 @@ cdef class StridedMemoryView: self.dl_tensor.ndim ) else: - self._shape = self.exporting_obj.__cuda_array_interface__["shape"] + self._shape = self.metadata["shape"] else: self._shape = () return self._shape @@ -126,7 +129,7 @@ cdef class StridedMemoryView: self.dl_tensor.ndim ) else: - strides = self.exporting_obj.__cuda_array_interface__.get("strides") + strides = self.metadata.get("strides") if strides is not None: itemsize = self.dtype.itemsize self._strides = cpython.PyTuple_New(len(strides)) @@ -142,7 +145,7 @@ cdef class StridedMemoryView: self._dtype = dtype_dlpack_to_numpy(&self.dl_tensor.dtype) else: # TODO: this only works for built-in numeric types - self._dtype = numpy.dtype(self.exporting_obj.__cuda_array_interface__["typestr"]) + self._dtype = numpy.dtype(self.metadata["typestr"]) return self._dtype def __repr__(self): @@ -262,7 +265,7 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): cdef StridedMemoryView buf = StridedMemoryView() if view is None else view buf.dl_tensor = dl_tensor - buf.dlpack_capsule = capsule + buf.metadata = capsule buf.ptr = (dl_tensor.data) buf.device_id = device_id buf.is_device_accessible = is_device_accessible @@ -344,6 +347,7 @@ cpdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): cdef StridedMemoryView buf = StridedMemoryView() if view is None else view buf.exporting_obj = obj + buf.metadata = cai_data buf.dl_tensor = NULL buf.ptr, buf.readonly = cai_data["data"] buf.is_device_accessible = True From cf377509a767deafee86849d853053b11f59901f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 21 Aug 2025 14:59:27 -0400 Subject: [PATCH 053/113] Don't recompute strides --- .../cuda/core/experimental/_memoryview.pyx | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 584a9ba9e..9d2413305 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -91,7 +91,8 @@ cdef class StridedMemoryView: # Memoized properties cdef tuple _shape - cdef object _strides + cdef tuple _strides + cdef bint _strides_init # Has the strides tuple been init'ed? cdef object _dtype def __init__(self, obj=None, stream_ptr=None): @@ -121,20 +122,24 @@ cdef class StridedMemoryView: @property def strides(self) -> Optional[tuple[int]]: cdef int itemsize - if self._strides is None and self.exporting_obj is not None: - if self.dl_tensor != NULL: - if self.dl_tensor.strides: - self._strides = cuda_utils.carray_int64_t_to_tuple( - self.dl_tensor.strides, - self.dl_tensor.ndim - ) - else: - strides = self.metadata.get("strides") - if strides is not None: - itemsize = self.dtype.itemsize - self._strides = cpython.PyTuple_New(len(strides)) - for i in range(len(strides)): - cpython.PyTuple_SET_ITEM(self._strides, i, strides[i] // itemsize) + if self._strides_init is False: + if self.exporting_obj is not None: + if self.dl_tensor != NULL: + if self.dl_tensor.strides: + self._strides = cuda_utils.carray_int64_t_to_tuple( + self.dl_tensor.strides, + self.dl_tensor.ndim + ) + else: + strides = self.metadata.get("strides") + if strides is not None: + itemsize = self.dtype.itemsize + self._strides = cpython.PyTuple_New(len(strides)) + for i in range(len(strides)): + cpython.PyTuple_SET_ITEM( + self._strides, i, strides[i] // itemsize + ) + self._strides_init = True return self._strides @property From 1c03383daef6961b1d21b62be8fac26192e4a548 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 17:40:54 -0400 Subject: [PATCH 054/113] Fix version dropdown menu by copying nv-versions.json files (#886) * Initial plan * Fix version dropdown menu by copying nv-versions.json files Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- cuda_bindings/docs/build_docs.sh | 1 + cuda_core/docs/build_docs.sh | 1 + cuda_python/docs/build_docs.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/cuda_bindings/docs/build_docs.sh b/cuda_bindings/docs/build_docs.sh index d5c00c386..c4e959fd7 100755 --- a/cuda_bindings/docs/build_docs.sh +++ b/cuda_bindings/docs/build_docs.sh @@ -35,6 +35,7 @@ SPHINXOPTS="-j 4 -d build/.doctrees" make html # to support version dropdown menu cp ./versions.json build/html +cp ./nv-versions.json build/html # to have a redirection page (to the latest docs) cp source/_templates/main.html build/html/index.html diff --git a/cuda_core/docs/build_docs.sh b/cuda_core/docs/build_docs.sh index a604239c8..efc70c817 100755 --- a/cuda_core/docs/build_docs.sh +++ b/cuda_core/docs/build_docs.sh @@ -31,6 +31,7 @@ SPHINXOPTS="-j 4 -d build/.doctrees" make html # to support version dropdown menu cp ./versions.json build/html +cp ./nv-versions.json build/html # to have a redirection page (to the latest docs) cp source/_templates/main.html build/html/index.html diff --git a/cuda_python/docs/build_docs.sh b/cuda_python/docs/build_docs.sh index 8b306143b..97be962a1 100755 --- a/cuda_python/docs/build_docs.sh +++ b/cuda_python/docs/build_docs.sh @@ -35,6 +35,7 @@ SPHINXOPTS="-j 4 -d build/.doctrees" make html # to support version dropdown menu cp ./versions.json build/html +cp ./nv-versions.json build/html # to have a redirection page (to the latest docs) cp source/_templates/main.html build/html/index.html From ce80737e52a502ca88642aeb13c076840d900689 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 18:47:27 -0400 Subject: [PATCH 055/113] Create new cuda-bindings release note files for missing milestone 14 improvements and link them in documentation (#882) * Initial plan * Update cuda-bindings release notes for missing milestone 14 improvements Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Create new release note files with proper naming convention and remove redundant content Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add new release note files to Sphinx toctree for proper documentation rendering Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- cuda_bindings/docs/source/release.rst | 2 ++ .../docs/source/release/12.9.X-notes.rst | 21 +++++++++++++++++++ .../docs/source/release/13.X.Y-notes.rst | 21 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 cuda_bindings/docs/source/release/12.9.X-notes.rst create mode 100644 cuda_bindings/docs/source/release/13.X.Y-notes.rst diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst index 7cc3471d0..3f0323ccd 100644 --- a/cuda_bindings/docs/source/release.rst +++ b/cuda_bindings/docs/source/release.rst @@ -7,8 +7,10 @@ Release Notes .. toctree:: :maxdepth: 3 + 13.X.Y 13.0.1 13.0.0 + 12.9.X 12.9.2 12.9.1 12.9.0 diff --git a/cuda_bindings/docs/source/release/12.9.X-notes.rst b/cuda_bindings/docs/source/release/12.9.X-notes.rst new file mode 100644 index 000000000..3be22a695 --- /dev/null +++ b/cuda_bindings/docs/source/release/12.9.X-notes.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.X Release notes +====================================== + +Released on TBD + + +Highlights +---------- + +* Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. \ No newline at end of file diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst new file mode 100644 index 000000000..1ac5e42cc --- /dev/null +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +.. module:: cuda.bindings + +``cuda-bindings`` 13.X.Y Release notes +====================================== + +Released on TBD + + +Highlights +---------- + +* Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. \ No newline at end of file From 33a11109369c10e7fc250508c2907fcaefff1048 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 22 Aug 2025 08:53:01 -0500 Subject: [PATCH 056/113] Update api.rst (#893) --- cuda_core/docs/source/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_core/docs/source/api.rst b/cuda_core/docs/source/api.rst index 7188e0184..9c93d0f75 100644 --- a/cuda_core/docs/source/api.rst +++ b/cuda_core/docs/source/api.rst @@ -7,7 +7,7 @@ ======================================== All of the APIs listed (or cross-referenced from) below are considered *experimental* -and subject to future changes without deprecation notice. Once stablized they will be +and subject to future changes without deprecation notice. Once stabilized they will be moved out of the ``experimental`` namespace. From db8daa678e46387d9815c116fe400e18727df177 Mon Sep 17 00:00:00 2001 From: Mark Mason Date: Fri, 22 Aug 2025 13:00:56 -0700 Subject: [PATCH 057/113] Fix command line arguments for linker and compiler (#895) * Fix command line arguments checking related to optimization, debugging, and lineinfo. Fix ProgramOptions.__repr__() to return a string instead of a list. * pre-commit formatting fix --- cuda_core/cuda/core/experimental/_linker.py | 6 +++--- cuda_core/cuda/core/experimental/_program.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_linker.py b/cuda_core/cuda/core/experimental/_linker.py index c3528a14e..bda91fb46 100644 --- a/cuda_core/cuda/core/experimental/_linker.py +++ b/cuda_core/cuda/core/experimental/_linker.py @@ -205,15 +205,15 @@ def _init_nvjitlink(self): self.formatted_options.append("-time") if self.verbose is not None: self.formatted_options.append("-verbose") - if self.link_time_optimization is not None: + if self.link_time_optimization is not None and self.link_time_optimization: self.formatted_options.append("-lto") if self.ptx is not None: self.formatted_options.append("-ptx") if self.optimization_level is not None: self.formatted_options.append(f"-O{self.optimization_level}") - if self.debug is not None: + if self.debug is not None and self.debug: self.formatted_options.append("-g") - if self.lineinfo is not None: + if self.lineinfo is not None and self.lineinfo: self.formatted_options.append("-lineinfo") if self.ftz is not None: self.formatted_options.append(f"-ftz={'true' if self.ftz else 'false'}") diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index 3df8894d5..fbba1db92 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -244,8 +244,8 @@ def __post_init__(self): self._formatted_options.append("--device-debug") if self.lineinfo is not None and self.lineinfo: self._formatted_options.append("--generate-line-info") - if self.device_code_optimize is not None: - self._formatted_options.append(f"--dopt={'on' if self.device_code_optimize else 'off'}") + if self.device_code_optimize is not None and self.device_code_optimize: + self._formatted_options.append("--dopt=on") if self.ptxas_options is not None: opt_name = "--ptxas-options" if isinstance(self.ptxas_options, str): @@ -351,7 +351,7 @@ def _as_bytes(self): def __repr__(self): # __TODO__ improve this - return self._formatted_options + return str(self._formatted_options) ProgramHandleT = Union["cuda.bindings.nvrtc.nvrtcProgram", LinkerHandleT] From 459bbcbade8c142ef8d5d00b2c624f76c5dc4ed9 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:03:49 -0400 Subject: [PATCH 058/113] Switch to cuda-toolkit metapackage for wheel dependencies with streamlined documentation (#883) * Initial plan * Switch to cuda-toolkit metapackage for wheel dependencies Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Merge cuda-toolkit extras into single lines - cuda_bindings: merge nvcc,nvrtc,nvjitlink,nvvm into single line - cuda_pathfinder: merge all extras except cufile (platform conditional) for cu12/cu13 Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add test-cu13 dependency now that cupy-cuda13x is available Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add release notes and update installation guides for cuda-toolkit dependency change - Add release notes for all modules (cuda-bindings 13.0.2, cuda-core 0.3.3, cuda-python 13.0.2) - Update installation guides to explain cuda-toolkit metapackage benefits - Clarify improved dependency resolution and version constraints - Document backward compatibility (user-facing commands unchanged) Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address reviewer feedback: move release notes to X.Y format and remove conda references Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address reviewer feedback: simplify documentation and remove overselling language Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove NVCC from dependencies and fix conda documentation - Remove nvcc from cuda-toolkit dependencies as it was only needed for libNVVM access - NVVM now has its own wheel in CUDA 13, so NVCC compiler is no longer needed - Update documentation to remove nvcc from optional dependencies list - Fix typo in conda documentation and add example usage - Add release notes explaining NVCC removal as breaking change - Users who need NVCC should explicitly install nvidia-cuda-nvcc-cu13 Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix CUDA 13 wheel names, clean up release notes, and restore nvcc in pathfinder Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Apply suggestions from code review * Fix conda version pinning, markdown backticks, and improve release notes grammar Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add two missing "the" --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: Leo Fang Co-authored-by: Ralf W. Grosse-Kunstleve --- cuda_bindings/docs/source/install.md | 23 ++++++++++---- .../docs/source/release/13.X.Y-notes.rst | 4 ++- cuda_bindings/pyproject.toml | 7 ++--- cuda_core/docs/source/install.md | 4 +-- cuda_core/docs/source/release/0.X.Y-notes.rst | 1 + cuda_core/pyproject.toml | 6 ++-- cuda_pathfinder/pyproject.toml | 31 +++---------------- 7 files changed, 32 insertions(+), 44 deletions(-) diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index 1c9697fd2..b7c693b9c 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -10,7 +10,7 @@ * Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x ```{note} -The optional CUDA Toolkit components can be installed via PyPI, Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). +The optional CUDA Toolkit components are now installed via the `cuda-toolkit` metapackage from PyPI for improved dependency resolution. Components can also be installed via Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). ``` Starting from v12.8.0, `cuda-python` becomes a meta package which currently depends only on `cuda-bindings`; in the future more sub-packages will be added to `cuda-python`. In the instructions below, we still use `cuda-python` as example to serve existing users, but everything is applicable to `cuda-bindings` as well. @@ -27,12 +27,14 @@ Install all optional dependencies with: pip install -U cuda-python[all] ``` -Where the optional dependencies are: +Where the optional dependencies include: -* nvidia-cuda-nvrtc (Provides NVRTC shared library) -* nvidia-nvjitlink (Provides nvJitLink shared library) -* nvidia-cuda-nvcc (Provides NVVM shared library) -* nvidia-cufile (Provides cuFile shared library) +* `nvidia-cuda-nvrtc` (NVRTC runtime compilation library) +* `nvidia-nvjitlink` (nvJitLink library) +* `nvidia-nvvm` (NVVM library) +* `nvidia-cufile` (cuFile library, Linux only) + +These are now installed through the `cuda-toolkit` metapackage for improved dependency resolution. ## Installing from Conda @@ -41,6 +43,15 @@ Where the optional dependencies are: $ conda install -c conda-forge cuda-python ``` +```{note} +When using conda, the `cuda-version` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment. +``` + +For example: +```console +$ conda install -c conda-forge cuda-python cuda-version=13 +``` + ## Installing from Source diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 1ac5e42cc..4ae8c86c9 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -12,10 +12,12 @@ Released on TBD Highlights ---------- +* Migrated wheel dependencies from individual NVIDIA packages to the ``cuda-toolkit`` metapackage for improved dependency resolution and version constraints. * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. +* The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. Known issues ------------ -* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. \ No newline at end of file +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index d78d8f374..1a91b44b8 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -33,11 +33,8 @@ dependencies = [ [project.optional-dependencies] all = [ - "nvidia-cuda-nvcc~=13.0", - "nvidia-cuda-nvrtc~=13.0", - "nvidia-nvjitlink~=13.0", - "nvidia-nvvm~=13.0", - "nvidia-cufile; sys_platform == 'linux'", + "cuda-toolkit[nvrtc,nvjitlink,nvvm]==13.*", + "cuda-toolkit[cufile]==13.*; sys_platform == 'linux'", ] test = [ diff --git a/cuda_core/docs/source/install.md b/cuda_core/docs/source/install.md index 3b9ceab15..4f66eeff1 100644 --- a/cuda_core/docs/source/install.md +++ b/cuda_core/docs/source/install.md @@ -17,11 +17,11 @@ dependencies are as follows: ## Installing from PyPI -`cuda.core` works with `cuda.bindings` (part of `cuda-python`) 11 or 12. For example with CUDA 12: +`cuda.core` works with `cuda.bindings` (part of `cuda-python`) 11 or 12. Test dependencies now use the ``cuda-toolkit`` metapackage for improved dependency resolution. For example with CUDA 12: ```console $ pip install cuda-core[cu12] ``` -and likewise use `[cu11]` for CUDA 11. +and likewise use `[cu11]` for CUDA 11, or `[cu13]` for CUDA 13. Note that using `cuda.core` with NVRTC installed from PyPI via `pip install` requires `cuda.bindings` 12.8.0+ or 11.8.6+. Likewise, with nvJitLink it requires 12.8.0+. diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index fb505b6f0..d2faebf93 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -25,6 +25,7 @@ New features ------------ - Added :attr:`Device.arch` property that returns the compute capability as a string (e.g., '75' for CC 7.5), providing a convenient alternative to manually concatenating the compute capability tuple. +- CUDA 13.x testing support through new ``test-cu13`` dependency group. New examples diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 83cec4d53..3506ce025 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -50,9 +50,9 @@ cu11 = ["cuda-bindings[all]==11.8.*"] cu12 = ["cuda-bindings[all]==12.*"] cu13 = ["cuda-bindings[all]==13.*"] test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"] -test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy -test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy -# TODO add test-cu13 once CuPy is ready +test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "cuda-toolkit[cudart]==11.*"] # runtime headers needed by CuPy +test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy +test-cu13 = ["cuda-core[test]", "cupy-cuda13x", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy [project.urls] homepage = "https://nvidia.github.io/cuda-python/" diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index ac6724277..6545c4e51 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -15,35 +15,12 @@ test = [ "pytest>=6.2.4", ] nvidia_wheels_cu12 = [ - "nvidia-cublas-cu12", - "nvidia-cuda-nvcc-cu12", - "nvidia-cuda-nvrtc-cu12", - "nvidia-cuda-runtime-cu12", - "nvidia-cufft-cu12", - "nvidia-cufile-cu12; sys_platform != 'win32'", - "nvidia-curand-cu12", - "nvidia-cusolver-cu12", - "nvidia-cusparse-cu12", - "nvidia-npp-cu12", - "nvidia-nvfatbin-cu12", - "nvidia-nvjitlink-cu12", - "nvidia-nvjpeg-cu12", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", + "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", ] nvidia_wheels_cu13 = [ - "nvidia-cublas", - "nvidia-cuda-nvcc", - "nvidia-cuda-nvrtc", - "nvidia-cuda-runtime", - "nvidia-cufft", - "nvidia-cufile; sys_platform != 'win32'", - "nvidia-curand", - "nvidia-cusolver", - "nvidia-cusparse", - "nvidia-npp", - "nvidia-nvfatbin", - "nvidia-nvjitlink", - "nvidia-nvjpeg", - "nvidia-nvvm", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,nvvm]==13.*", + "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", ] [project.urls] From e3a9f22a042435263f3c0cfd8c42f52651ecf9ab Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:01:46 -0400 Subject: [PATCH 059/113] Cythonize Buffer and MemoryResource classes for performance optimization (#876) * cythonize _memory.py * fix * reduce overhead * tripped again: Cython enforces type annotations at compile time * ensure Buffer.handle is None everywhere * fix test * nit: avoid extra tuple * update tests to comply with spec and make Cython 3.1 happy --------- Co-authored-by: Leo Fang --- .../experimental/{_memory.py => _memory.pyx} | 160 ++++++++++-------- cuda_core/docs/source/release/0.X.Y-notes.rst | 4 +- cuda_core/examples/memory_ops.py | 6 +- cuda_core/tests/test_launcher.py | 6 +- cuda_core/tests/test_memory.py | 14 +- 5 files changed, 108 insertions(+), 82 deletions(-) rename cuda_core/cuda/core/experimental/{_memory.py => _memory.pyx} (79%) diff --git a/cuda_core/cuda/core/experimental/_memory.py b/cuda_core/cuda/core/experimental/_memory.pyx similarity index 79% rename from cuda_core/cuda/core/experimental/_memory.py rename to cuda_core/cuda/core/experimental/_memory.pyx index c8e7a4197..ddcf7665e 100644 --- a/cuda_core/cuda/core/experimental/_memory.py +++ b/cuda_core/cuda/core/experimental/_memory.pyx @@ -4,13 +4,18 @@ from __future__ import annotations +from libc.stdint cimport uintptr_t + +from cuda.core.experimental._utils.cuda_utils cimport ( + _check_driver_error as raise_if_driver_error, +) + import abc -import weakref from typing import Tuple, TypeVar, Union from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule from cuda.core.experimental._stream import Stream, default_stream -from cuda.core.experimental._utils.cuda_utils import driver, handle_return +from cuda.core.experimental._utils.cuda_utils import driver # TODO: define a memory property mixin class and make Buffer and # MemoryResource both inherit from it @@ -23,7 +28,7 @@ """A type union of :obj:`~driver.CUdeviceptr`, `int` and `None` for hinting :attr:`Buffer.handle`.""" -class Buffer: +cdef class Buffer: """Represent a handle to allocated memory. This generic object provides a unified representation for how @@ -33,34 +38,28 @@ class Buffer: Support for data interchange mechanisms are provided by DLPack. """ - class _MembersNeededForFinalize: - __slots__ = ("ptr", "size", "mr") - - def __init__(self, buffer_obj, ptr, size, mr): - self.ptr = ptr - self.size = size - self.mr = mr - weakref.finalize(buffer_obj, self.close) - - def close(self, stream=None): - if self.ptr and self.mr is not None: - self.mr.deallocate(self.ptr, self.size, stream) - self.ptr = 0 - self.mr = None + cdef: + uintptr_t _ptr + size_t _size + object _mr + object _ptr_obj - # TODO: handle ownership? (_mr could be None) - __slots__ = ("__weakref__", "_mnff") - - def __new__(self, *args, **kwargs): + def __init__(self, *args, **kwargs): raise RuntimeError("Buffer objects cannot be instantiated directly. Please use MemoryResource APIs.") @classmethod - def _init(cls, ptr: DevicePointerT, size: int, mr: MemoryResource | None = None): - self = super().__new__(cls) - self._mnff = Buffer._MembersNeededForFinalize(self, ptr, size, mr) + def _init(cls, ptr: DevicePointerT, size_t size, mr: MemoryResource | None = None): + cdef Buffer self = Buffer.__new__(cls) + self._ptr = (int(ptr)) + self._ptr_obj = ptr + self._size = size + self._mr = mr return self - def close(self, stream: Stream = None): + def __del__(self): + self.close() + + cpdef close(self, stream: Stream = None): """Deallocate this buffer asynchronously on the given stream. This buffer is released back to their memory resource @@ -72,7 +71,11 @@ def close(self, stream: Stream = None): The stream object to use for asynchronous deallocation. If None, the behavior depends on the underlying memory resource. """ - self._mnff.close(stream) + if self._ptr and self._mr is not None: + self._mr.deallocate(self._ptr, self._size, stream) + self._ptr = 0 + self._mr = None + self._ptr_obj = None @property def handle(self) -> DevicePointerT: @@ -83,37 +86,37 @@ def handle(self) -> DevicePointerT: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Buffer.handle)``. """ - return self._mnff.ptr + return self._ptr_obj @property def size(self) -> int: """Return the memory size of this buffer.""" - return self._mnff.size + return self._size @property def memory_resource(self) -> MemoryResource: """Return the memory resource associated with this buffer.""" - return self._mnff.mr + return self._mr @property def is_device_accessible(self) -> bool: """Return True if this buffer can be accessed by the GPU, otherwise False.""" - if self._mnff.mr is not None: - return self._mnff.mr.is_device_accessible + if self._mr is not None: + return self._mr.is_device_accessible raise NotImplementedError("WIP: Currently this property only supports buffers with associated MemoryResource") @property def is_host_accessible(self) -> bool: """Return True if this buffer can be accessed by the CPU, otherwise False.""" - if self._mnff.mr is not None: - return self._mnff.mr.is_host_accessible + if self._mr is not None: + return self._mr.is_host_accessible raise NotImplementedError("WIP: Currently this property only supports buffers with associated MemoryResource") @property def device_id(self) -> int: """Return the device ordinal of this buffer.""" - if self._mnff.mr is not None: - return self._mnff.mr.device_id + if self._mr is not None: + return self._mr.device_id raise NotImplementedError("WIP: Currently this property only supports buffers with associated MemoryResource") def copy_to(self, dst: Buffer = None, *, stream: Stream) -> Buffer: @@ -134,15 +137,21 @@ def copy_to(self, dst: Buffer = None, *, stream: Stream) -> Buffer: """ if stream is None: raise ValueError("stream must be provided") + + cdef size_t src_size = self._size + if dst is None: - if self._mnff.mr is None: + if self._mr is None: raise ValueError("a destination buffer must be provided (this buffer does not have a memory_resource)") - dst = self._mnff.mr.allocate(self._mnff.size, stream) - if dst._mnff.size != self._mnff.size: + dst = self._mr.allocate(src_size, stream) + + cdef size_t dst_size = dst._size + if dst_size != src_size: raise ValueError( - f"buffer sizes mismatch between src and dst (sizes are: src={self._mnff.size}, dst={dst._mnff.size})" + f"buffer sizes mismatch between src and dst (sizes are: src={src_size}, dst={dst_size})" ) - handle_return(driver.cuMemcpyAsync(dst._mnff.ptr, self._mnff.ptr, self._mnff.size, stream.handle)) + err, = driver.cuMemcpyAsync(dst._ptr, self._ptr, src_size, stream.handle) + raise_if_driver_error(err) return dst def copy_from(self, src: Buffer, *, stream: Stream): @@ -159,11 +168,16 @@ def copy_from(self, src: Buffer, *, stream: Stream): """ if stream is None: raise ValueError("stream must be provided") - if src._mnff.size != self._mnff.size: + + cdef size_t dst_size = self._size + cdef size_t src_size = src._size + + if src_size != dst_size: raise ValueError( - f"buffer sizes mismatch between src and dst (sizes are: src={src._mnff.size}, dst={self._mnff.size})" + f"buffer sizes mismatch between src and dst (sizes are: src={src_size}, dst={dst_size})" ) - handle_return(driver.cuMemcpyAsync(self._mnff.ptr, src._mnff.ptr, self._mnff.size, stream.handle)) + err, = driver.cuMemcpyAsync(self._ptr, src._ptr, dst_size, stream.handle) + raise_if_driver_error(err) def __dlpack__( self, @@ -189,13 +203,14 @@ def __dlpack__( return capsule def __dlpack_device__(self) -> Tuple[int, int]: - d_h = (bool(self.is_device_accessible), bool(self.is_host_accessible)) - if d_h == (True, False): + cdef bint d = self.is_device_accessible + cdef bint h = self.is_host_accessible + if d and (not h): return (DLDeviceType.kDLCUDA, self.device_id) - if d_h == (True, True): + if d and h: # TODO: this can also be kDLCUDAManaged, we need more fine-grained checks return (DLDeviceType.kDLCUDAHost, 0) - if d_h == (False, True): + if (not d) and h: return (DLDeviceType.kDLCPU, 0) raise BufferError("buffer is neither device-accessible nor host-accessible") @@ -211,7 +226,7 @@ def __release_buffer__(self, buffer: memoryview, /): raise NotImplementedError("WIP: Buffer.__release_buffer__ hasn't been implemented yet.") @staticmethod - def from_handle(ptr: DevicePointerT, size: int, mr: MemoryResource | None = None) -> Buffer: + def from_handle(ptr: DevicePointerT, size_t size, mr: MemoryResource | None = None) -> Buffer: """Create a new :class:`Buffer` object from a pointer. Parameters @@ -247,7 +262,7 @@ def __init__(self, *args, **kwargs): ... @abc.abstractmethod - def allocate(self, size: int, stream: Stream = None) -> Buffer: + def allocate(self, size_t size, stream: Stream = None) -> Buffer: """Allocate a buffer of the requested size. Parameters @@ -268,7 +283,7 @@ def allocate(self, size: int, stream: Stream = None) -> Buffer: ... @abc.abstractmethod - def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None): + def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None): """Deallocate a buffer previously allocated by this resource. Parameters @@ -323,27 +338,28 @@ class DeviceMemoryResource(MemoryResource): __slots__ = ("_dev_id",) def __init__(self, device_id: int): - self._handle = handle_return(driver.cuDeviceGetMemPool(device_id)) + err, self._handle = driver.cuDeviceGetMemPool(device_id) + raise_if_driver_error(err) self._dev_id = device_id # Set a higher release threshold to improve performance when there are no active allocations. # By default, the release threshold is 0, which means memory is immediately released back # to the OS when there are no active suballocations, causing performance issues. # Check current release threshold - current_threshold = handle_return( - driver.cuMemPoolGetAttribute(self._handle, driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD) + err, current_threshold = driver.cuMemPoolGetAttribute( + self._handle, driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD ) + raise_if_driver_error(err) # If threshold is 0 (default), set it to maximum to retain memory in the pool if int(current_threshold) == 0: - handle_return( - driver.cuMemPoolSetAttribute( - self._handle, - driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, - driver.cuuint64_t(0xFFFFFFFFFFFFFFFF), - ) + err, = driver.cuMemPoolSetAttribute( + self._handle, + driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + driver.cuuint64_t(0xFFFFFFFFFFFFFFFF), ) + raise_if_driver_error(err) - def allocate(self, size: int, stream: Stream = None) -> Buffer: + def allocate(self, size_t size, stream: Stream = None) -> Buffer: """Allocate a buffer of the requested size. Parameters @@ -362,10 +378,11 @@ def allocate(self, size: int, stream: Stream = None) -> Buffer: """ if stream is None: stream = default_stream() - ptr = handle_return(driver.cuMemAllocFromPoolAsync(size, self._handle, stream.handle)) + err, ptr = driver.cuMemAllocFromPoolAsync(size, self._handle, stream.handle) + raise_if_driver_error(err) return Buffer._init(ptr, size, self) - def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None): + def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None): """Deallocate a buffer previously allocated by this resource. Parameters @@ -380,7 +397,8 @@ def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None): """ if stream is None: stream = default_stream() - handle_return(driver.cuMemFreeAsync(ptr, stream.handle)) + err, = driver.cuMemFreeAsync(ptr, stream.handle) + raise_if_driver_error(err) @property def is_device_accessible(self) -> bool: @@ -407,7 +425,7 @@ def __init__(self): # TODO: support flags from cuMemHostAlloc? self._handle = None - def allocate(self, size: int, stream: Stream = None) -> Buffer: + def allocate(self, size_t size, stream: Stream = None) -> Buffer: """Allocate a buffer of the requested size. Parameters @@ -422,10 +440,11 @@ def allocate(self, size: int, stream: Stream = None) -> Buffer: Buffer The allocated buffer object, which is accessible on both host and device. """ - ptr = handle_return(driver.cuMemAllocHost(size)) + err, ptr = driver.cuMemAllocHost(size) + raise_if_driver_error(err) return Buffer._init(ptr, size, self) - def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None): + def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream = None): """Deallocate a buffer previously allocated by this resource. Parameters @@ -440,7 +459,8 @@ def deallocate(self, ptr: DevicePointerT, size: int, stream: Stream = None): """ if stream: stream.sync() - handle_return(driver.cuMemFreeHost(ptr)) + err, = driver.cuMemFreeHost(ptr) + raise_if_driver_error(err) @property def is_device_accessible(self) -> bool: @@ -466,14 +486,16 @@ def __init__(self, device_id): self._dev_id = device_id def allocate(self, size, stream=None) -> Buffer: - ptr = handle_return(driver.cuMemAlloc(size)) + err, ptr = driver.cuMemAlloc(size) + raise_if_driver_error(err) return Buffer._init(ptr, size, self) def deallocate(self, ptr, size, stream=None): if stream is None: stream = default_stream() stream.sync() - handle_return(driver.cuMemFree(ptr)) + err, = driver.cuMemFree(ptr) + raise_if_driver_error(err) @property def is_device_accessible(self) -> bool: diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index d2faebf93..bc8c8a054 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -19,6 +19,7 @@ Breaking Changes ---------------- - **LaunchConfig grid parameter interpretation**: When :attr:`LaunchConfig.cluster` is specified, the :attr:`LaunchConfig.grid` parameter now correctly represents the number of clusters instead of blocks. Previously, the grid parameter was incorrectly interpreted as blocks, causing a mismatch with the expected C++ behavior. This change ensures that ``LaunchConfig(grid=4, cluster=2, block=32)`` correctly produces 4 clusters × 2 blocks/cluster = 8 total blocks, matching the C++ equivalent ``cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32))``. +- When :class:`Buffer` is closed, :attr:`Buffer.handle` is now set to `None`. It was previously set to ``0`` by accident. New features @@ -40,4 +41,5 @@ Fixes and enhancements - Improved :class:`DeviceMemoryResource` allocation performance when there are no active allocations by setting a higher release threshold (addresses issue #771). - Improved :class:`StridedMemoryView` creation time performance by optimizing shape and strides tuple creation using Python/C API (addresses issue #449). - Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). -- Fixed a bug in :class:`GraphBuilder.add_child` where dependencies extracted from capturing stream were passed inconsistently with num_dependencies parameter (addresses issue #843). \ No newline at end of file +- Fixed a bug in :class:`GraphBuilder.add_child` where dependencies extracted from capturing stream were passed inconsistently with num_dependencies parameter (addresses issue #843). +- Make :class:`Buffer` creation more performant. diff --git a/cuda_core/examples/memory_ops.py b/cuda_core/examples/memory_ops.py index b12bc5039..024b50ac6 100644 --- a/cuda_core/examples/memory_ops.py +++ b/cuda_core/examples/memory_ops.py @@ -129,8 +129,8 @@ cp.cuda.Stream.null.use() # reset CuPy's current stream to the null stream # Verify buffers are properly closed -assert device_buffer.handle == 0, "Device buffer should be closed" -assert pinned_buffer.handle == 0, "Pinned buffer should be closed" -assert new_device_buffer.handle == 0, "New device buffer should be closed" +assert device_buffer.handle is None, "Device buffer should be closed" +assert pinned_buffer.handle is None, "Pinned buffer should be closed" +assert new_device_buffer.handle is None, "New device buffer should be closed" print("Memory management example completed!") diff --git a/cuda_core/tests/test_launcher.py b/cuda_core/tests/test_launcher.py index e7e57bde7..fec603623 100644 --- a/cuda_core/tests/test_launcher.py +++ b/cuda_core/tests/test_launcher.py @@ -318,8 +318,10 @@ def test_launch_with_buffers_allocated_by_memory_resource(init_cuda, memory_reso mr = DeviceMemoryResource(dev.device_id) else: mr = _SynchronousMemoryResource(dev.device_id) + name = memory_resource_class else: mr = memory_resource_class() + name = str(mr) # Allocate memory size = 1024 @@ -359,7 +361,7 @@ def test_launch_with_buffers_allocated_by_memory_resource(init_cuda, memory_reso stream.sync() # Verify kernel operations - assert cp.allclose(array, original * 3.0), f"{memory_resource_class.__name__} operation failed" + assert cp.allclose(array, original * 3.0), f"{name} operation failed" # Clean up buffer.close(stream) @@ -368,4 +370,4 @@ def test_launch_with_buffers_allocated_by_memory_resource(init_cuda, memory_reso cp.cuda.Stream.null.use() # reset CuPy's current stream to the null stream # Verify buffer is properly closed - assert buffer.handle == 0, f"{memory_resource_class.__name__} buffer should be closed" + assert buffer.handle is None, f"{name} buffer should be closed" diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index 2ba7b418f..eb2a57f65 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -46,11 +46,11 @@ def __init__(self): def allocate(self, size, stream=None) -> Buffer: # Allocate a ctypes buffer of size `size` ptr = (ctypes.c_byte * size)() - return Buffer.from_handle(ptr=ptr, size=size, mr=self) + self._ptr = ptr + return Buffer.from_handle(ptr=ctypes.addressof(ptr), size=size, mr=self) def deallocate(self, ptr, size, stream=None): - # the memory is deallocated per the ctypes deallocation at garbage collection time - pass + del self._ptr @property def is_device_accessible(self) -> bool: @@ -203,7 +203,7 @@ def test_buffer_copy_from(): def buffer_close(dummy_mr: MemoryResource): buffer = dummy_mr.allocate(size=1024) buffer.close() - assert buffer.handle == 0 + assert buffer.handle is None assert buffer.memory_resource is None @@ -226,11 +226,11 @@ def test_buffer_dunder_dlpack(): capsule = buffer.__dlpack__(max_version=(1, 0)) assert "dltensor" in repr(capsule) with pytest.raises(BufferError, match=r"^Sorry, not supported: dl_device other than None$"): - buffer.__dlpack__(dl_device=[]) + buffer.__dlpack__(dl_device=()) with pytest.raises(BufferError, match=r"^Sorry, not supported: copy=True$"): buffer.__dlpack__(copy=True) - with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \[\]$"): - buffer.__dlpack__(max_version=[]) + with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \(\)$"): + buffer.__dlpack__(max_version=()) with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \(9, 8, 7\)$"): buffer.__dlpack__(max_version=(9, 8, 7)) From 5307eec4c8b1d6da5d768ae82128f7f83b87410c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:58:10 -0400 Subject: [PATCH 060/113] Convert all markdown files in docs/source/ directories to reST (#897) * Initial plan * Phase 1: Use git mv to rename 38 markdown files to .rst preserving git history Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Phase 2: Convert markdown syntax to ReST syntax in all 38 files Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Phase 3: Update toctree references from .md to .rst Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Phase 4: Add pre-commit hook to prevent new markdown files in docs/source/ Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Phase 5: Fix MyST syntax issues and validate conversion Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SPDX headers: Add missing copyright and license identifiers to converted .rst files Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix reStructuredText issues: correct cross-refs, links, and code blocks Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix code block consistency and Python comments in documentation - Changed shell to console code-block in install.rst for consistency - Converted explanatory text to Python comments in overview.rst code blocks - Ensures all code blocks are copy-paste ready for execution Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix reStructuredText syntax errors: correct toctree directive, broken hyperlinks, and code block formatting Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix release.rst toctree titles and improve pre-commit hook message Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix reStructuredText rendering issues: hyperlinks, code block introductions, and syntax errors Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * manual edit to fix rendering errors and prune outdated files --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: Leo Fang --- .pre-commit-config.yaml | 8 + .../docs/source/_static/logo-dark-mode.png | Bin 50546 -> 0 bytes .../docs/source/_static/logo-light-mode.png | Bin 48816 -> 0 bytes .../docs/source/conduct.rst | 35 +- cuda_bindings/docs/source/contribute.md | 12 - cuda_bindings/docs/source/contribute.rst | 15 + .../docs/source/environment_variables.md | 13 - .../docs/source/environment_variables.rst | 21 + cuda_bindings/docs/source/index.rst | 12 +- cuda_bindings/docs/source/install.md | 88 --- cuda_bindings/docs/source/install.rst | 96 +++ .../source/{motivation.md => motivation.rst} | 24 +- cuda_bindings/docs/source/overview.md | 558 ----------------- cuda_bindings/docs/source/overview.rst | 568 ++++++++++++++++++ cuda_bindings/docs/source/release.rst | 48 +- .../{11.4.0-notes.md => 11.4.0-notes.rst} | 15 +- .../{11.5.0-notes.md => 11.5.0-notes.rst} | 15 +- .../docs/source/release/11.6.0-notes.md | 73 --- .../docs/source/release/11.6.0-notes.rst | 82 +++ .../{11.6.1-notes.md => 11.6.1-notes.rst} | 15 +- .../{11.7.0-notes.md => 11.7.0-notes.rst} | 15 +- .../{11.7.1-notes.md => 11.7.1-notes.rst} | 22 +- .../{11.8.0-notes.md => 11.8.0-notes.rst} | 22 +- .../{11.8.1-notes.md => 11.8.1-notes.rst} | 17 +- .../{11.8.2-notes.md => 11.8.2-notes.rst} | 15 +- .../{11.8.3-notes.md => 11.8.3-notes.rst} | 15 +- .../docs/source/release/11.8.4-notes.md | 54 -- .../docs/source/release/11.8.4-notes.rst | 62 ++ .../{11.8.5-notes.md => 11.8.5-notes.rst} | 20 +- .../docs/source/release/11.8.6-notes.md | 29 - .../docs/source/release/11.8.6-notes.rst | 35 ++ .../{12.0.0-notes.md => 12.0.0-notes.rst} | 19 +- .../{12.1.0-notes.md => 12.1.0-notes.rst} | 21 +- .../{12.2.0-notes.md => 12.2.0-notes.rst} | 19 +- .../{12.2.1-notes.md => 12.2.1-notes.rst} | 15 +- .../docs/source/release/12.3.0-notes.md | 36 -- .../docs/source/release/12.3.0-notes.rst | 43 ++ .../{12.4.0-notes.md => 12.4.0-notes.rst} | 15 +- .../{12.5.0-notes.md => 12.5.0-notes.rst} | 17 +- .../{12.6.0-notes.md => 12.6.0-notes.rst} | 21 +- .../docs/source/release/12.6.1-notes.md | 56 -- .../docs/source/release/12.6.1-notes.rst | 64 ++ .../{12.6.2-notes.md => 12.6.2-notes.rst} | 20 +- .../docs/source/release/12.8.0-notes.md | 36 -- .../docs/source/release/12.8.0-notes.rst | 42 ++ cuda_bindings/docs/source/tips_and_tricks.rst | 8 +- .../docs/source/_static/logo-dark-mode.png | Bin 50546 -> 0 bytes .../docs/source/_static/logo-light-mode.png | Bin 48816 -> 0 bytes .../docs/source/conduct.rst | 35 +- cuda_core/docs/source/getting-started.md | 114 ---- cuda_core/docs/source/getting-started.rst | 114 ++++ cuda_core/docs/source/install.md | 48 -- cuda_core/docs/source/install.rst | 67 +++ cuda_core/docs/source/release.rst | 14 +- cuda_core/docs/source/release/0.3.1-notes.rst | 2 +- .../docs/source/_static/logo-dark-mode.png | Bin 50546 -> 0 bytes .../docs/source/_static/logo-light-mode.png | Bin 48816 -> 0 bytes cuda_python/docs/source/index.rst | 2 +- cuda_python/docs/source/release.md | 18 - cuda_python/docs/source/release.rst | 20 + .../docs/source/release/11.8.6-notes.md | 15 - .../docs/source/release/11.8.6-notes.rst | 20 + .../docs/source/release/12.6.1-notes.md | 12 - .../docs/source/release/12.6.1-notes.rst | 17 + .../docs/source/release/12.6.2-notes.md | 12 - .../docs/source/release/12.6.2-notes.rst | 17 + .../docs/source/release/12.8.0-notes.md | 21 - .../docs/source/release/12.8.0-notes.rst | 26 + 68 files changed, 1641 insertions(+), 1369 deletions(-) delete mode 100644 cuda_bindings/docs/source/_static/logo-dark-mode.png delete mode 100644 cuda_bindings/docs/source/_static/logo-light-mode.png rename cuda_core/docs/source/conduct.md => cuda_bindings/docs/source/conduct.rst (82%) delete mode 100644 cuda_bindings/docs/source/contribute.md create mode 100644 cuda_bindings/docs/source/contribute.rst delete mode 100644 cuda_bindings/docs/source/environment_variables.md create mode 100644 cuda_bindings/docs/source/environment_variables.rst delete mode 100644 cuda_bindings/docs/source/install.md create mode 100644 cuda_bindings/docs/source/install.rst rename cuda_bindings/docs/source/{motivation.md => motivation.rst} (73%) delete mode 100644 cuda_bindings/docs/source/overview.md create mode 100644 cuda_bindings/docs/source/overview.rst rename cuda_bindings/docs/source/release/{11.4.0-notes.md => 11.4.0-notes.rst} (73%) rename cuda_bindings/docs/source/release/{11.5.0-notes.md => 11.5.0-notes.rst} (89%) delete mode 100644 cuda_bindings/docs/source/release/11.6.0-notes.md create mode 100644 cuda_bindings/docs/source/release/11.6.0-notes.rst rename cuda_bindings/docs/source/release/{11.6.1-notes.md => 11.6.1-notes.rst} (66%) rename cuda_bindings/docs/source/release/{11.7.0-notes.md => 11.7.0-notes.rst} (65%) rename cuda_bindings/docs/source/release/{11.7.1-notes.md => 11.7.1-notes.rst} (64%) rename cuda_bindings/docs/source/release/{11.8.0-notes.md => 11.8.0-notes.rst} (62%) rename cuda_bindings/docs/source/release/{11.8.1-notes.md => 11.8.1-notes.rst} (61%) rename cuda_bindings/docs/source/release/{11.8.2-notes.md => 11.8.2-notes.rst} (65%) rename cuda_bindings/docs/source/release/{11.8.3-notes.md => 11.8.3-notes.rst} (67%) delete mode 100644 cuda_bindings/docs/source/release/11.8.4-notes.md create mode 100644 cuda_bindings/docs/source/release/11.8.4-notes.rst rename cuda_bindings/docs/source/release/{11.8.5-notes.md => 11.8.5-notes.rst} (53%) delete mode 100644 cuda_bindings/docs/source/release/11.8.6-notes.md create mode 100644 cuda_bindings/docs/source/release/11.8.6-notes.rst rename cuda_bindings/docs/source/release/{12.0.0-notes.md => 12.0.0-notes.rst} (57%) rename cuda_bindings/docs/source/release/{12.1.0-notes.md => 12.1.0-notes.rst} (51%) rename cuda_bindings/docs/source/release/{12.2.0-notes.md => 12.2.0-notes.rst} (53%) rename cuda_bindings/docs/source/release/{12.2.1-notes.md => 12.2.1-notes.rst} (65%) delete mode 100644 cuda_bindings/docs/source/release/12.3.0-notes.md create mode 100644 cuda_bindings/docs/source/release/12.3.0-notes.rst rename cuda_bindings/docs/source/release/{12.4.0-notes.md => 12.4.0-notes.rst} (67%) rename cuda_bindings/docs/source/release/{12.5.0-notes.md => 12.5.0-notes.rst} (60%) rename cuda_bindings/docs/source/release/{12.6.0-notes.md => 12.6.0-notes.rst} (50%) delete mode 100644 cuda_bindings/docs/source/release/12.6.1-notes.md create mode 100644 cuda_bindings/docs/source/release/12.6.1-notes.rst rename cuda_bindings/docs/source/release/{12.6.2-notes.md => 12.6.2-notes.rst} (54%) delete mode 100644 cuda_bindings/docs/source/release/12.8.0-notes.md create mode 100644 cuda_bindings/docs/source/release/12.8.0-notes.rst delete mode 100644 cuda_core/docs/source/_static/logo-dark-mode.png delete mode 100644 cuda_core/docs/source/_static/logo-light-mode.png rename cuda_bindings/docs/source/conduct.md => cuda_core/docs/source/conduct.rst (83%) delete mode 100644 cuda_core/docs/source/getting-started.md create mode 100644 cuda_core/docs/source/getting-started.rst delete mode 100644 cuda_core/docs/source/install.md create mode 100644 cuda_core/docs/source/install.rst delete mode 100644 cuda_python/docs/source/_static/logo-dark-mode.png delete mode 100644 cuda_python/docs/source/_static/logo-light-mode.png delete mode 100644 cuda_python/docs/source/release.md create mode 100644 cuda_python/docs/source/release.rst delete mode 100644 cuda_python/docs/source/release/11.8.6-notes.md create mode 100644 cuda_python/docs/source/release/11.8.6-notes.rst delete mode 100644 cuda_python/docs/source/release/12.6.1-notes.md create mode 100644 cuda_python/docs/source/release/12.6.1-notes.rst delete mode 100644 cuda_python/docs/source/release/12.6.2-notes.md create mode 100644 cuda_python/docs/source/release/12.6.2-notes.rst delete mode 100644 cuda_python/docs/source/release/12.8.0-notes.md create mode 100644 cuda_python/docs/source/release/12.8.0-notes.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 239f70dce..01595f8ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,14 @@ repos: language: python additional_dependencies: - https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl + + - id: no-markdown-in-docs-source + name: Prevent markdown files in docs/source directories + entry: bash -c + args: ['if find . -path "*/docs/source/*.md" -not -path "./docs/README.md" | grep -q .; then echo "ERROR: Markdown files found in docs/source/ directories. Use reST (.rst) instead."; exit 1; fi'] + language: system + pass_filenames: false + always_run: true - repo: https://github.com/PyCQA/bandit rev: 2d0b675b04c80ae42277e10500db06a0a37bae17 # frozen: 1.8.6 diff --git a/cuda_bindings/docs/source/_static/logo-dark-mode.png b/cuda_bindings/docs/source/_static/logo-dark-mode.png deleted file mode 100644 index 6b005a283ba6b7299a08cda1d37ceac8f693f535..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50546 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 diff --git a/cuda_bindings/docs/source/_static/logo-light-mode.png b/cuda_bindings/docs/source/_static/logo-light-mode.png deleted file mode 100644 index c07d6848c98d3084b6df4ef4f21fd5d8fd32b2bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48816 zcmeFZc|4Wt_dk4Xvt&$>F|;d`C_@NahKdYPQsz{YIrF?DLzxwtyiQ@SdtL8qt@j%5ZW-zyXWhcL1tG+G@`R=l zLhMfwqIYFtfbW#fHd?^{m|ahtcSi`n75fi&kCSB>ptrurG5?uoZJ9Q+FL&PLuZ zCQQnouRjR z_=CV71pXlK2Z8@@1hP8VH4q}3J9>T5)U@4=h+F0@_^WLG&j+oUgLcv&bS3>(WDa~= zqMaZ9_Mfi@gP9`#`Sbt$e~@sK?Z3Z8;Cf2?-`}~TN&W9{pxvBG|F7?y{3GUn5cz}6 ze@x?#-TViMKR)#zB+&nFiQ+de@5qRYjC0t`%#FD|MsfB^4F2`5Ba!ic!GR(1^Hm!r zgnYuqY!=NlWsj@QuRpR5P~Y4beOGg?j17$&j`01T-zO^FYQ>?lZ+FQnXRL!vIxjr4 zIjUvbX&+k~v{C={O4D&OsFYF#thRR&)%6fwTe&!oap#16gyXAQlS`0h2g*n%$ z8kgth9ljfoeqF{!*Z=!vt_M7yZ**~1NszfMF0lFi*#G_r{_tcsJl7OABg4sQu{!de zHp1cAPK#}p+W-C?B9kB@$%nY-$|x#UZS6GNR_pPv9~0ZL=(E3T-;Nzm+!gFm&MpG*eAV5J?sW-x8wh_3s7c>p&NJv|L=zk{yvq$^^n8813%*DxI+F5 zkWB1u0_r&4YcsVB4ee3)+h)1)ujim?Lre`8#h9Izc@EFwB2`6i@A@z4GMFNpyN*UI zbEW?~upbSFo3OsbU9hFaMxE}z?r~8J?$N{`e~TyQe|@A^8vxGkxWa?K`NFXHz^FyE?!@@y4Q7N{re;nV9P`a zR+};Tn-sE|htnMAm*biqb)u1Bv!R)?|buq8$fmf9Le

wT^+ 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 diff --git a/cuda_core/docs/source/conduct.md b/cuda_bindings/docs/source/conduct.rst similarity index 82% rename from cuda_core/docs/source/conduct.md rename to cuda_bindings/docs/source/conduct.rst index ccc1e4a43..b70d9dd7c 100644 --- a/cuda_core/docs/source/conduct.md +++ b/cuda_bindings/docs/source/conduct.rst @@ -1,10 +1,16 @@ -# Code of Conduct +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -## Overview +Code of Conduct +=============== -Define the code of conduct followed and enforced for the `cuda.core` project. +Overview +-------- -## Our Pledge +Define the code of conduct followed and enforced for the ``cuda.bindings`` project. + +Our Pledge +---------- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and @@ -13,7 +19,8 @@ size, disability, ethnicity, sex characteristics, gender identity and expression level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. -## Our Standards +Our Standards +------------- Examples of behavior that contributes to creating a positive environment include: @@ -35,7 +42,8 @@ Examples of unacceptable behavior by participants include: * Other conduct which could reasonably be considered inappropriate in a professional setting -## Our Responsibilities +Our Responsibilities +-------------------- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in @@ -47,7 +55,8 @@ that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -## Scope +Scope +----- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of @@ -56,11 +65,12 @@ address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. -## Enforcement +Enforcement +----------- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at -[cuda-python-conduct@nvidia.com](mailto:cuda-python-conduct@nvidia.com) All +`cuda-python-conduct@nvidia.com `_ All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an @@ -71,12 +81,11 @@ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. -## Attribution +Attribution +----------- -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +This Code of Conduct is adapted from the `Contributor Covenant `_, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html -[homepage]: https://www.contributor-covenant.org - For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq diff --git a/cuda_bindings/docs/source/contribute.md b/cuda_bindings/docs/source/contribute.md deleted file mode 100644 index d26f11723..000000000 --- a/cuda_bindings/docs/source/contribute.md +++ /dev/null @@ -1,12 +0,0 @@ -# Contributing - -Thank you for your interest in contributing to `cuda-bindings`! Based on the type of contribution, it will fall into two categories: - -1. You want to report a bug, feature request, or documentation issue - - File an [issue](https://github.com/NVIDIA/cuda-python/issues/new/choose) - describing what you encountered or what you want to see changed. - - The NVIDIA team will evaluate the issues and triage them, scheduling - them for a release. If you believe the issue needs priority attention - comment on the issue to notify the team. -2. You want to implement a feature, improvement, or bug fix: - - At this time we do not accept code contributions. diff --git a/cuda_bindings/docs/source/contribute.rst b/cuda_bindings/docs/source/contribute.rst new file mode 100644 index 000000000..20c7f51bc --- /dev/null +++ b/cuda_bindings/docs/source/contribute.rst @@ -0,0 +1,15 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +Contributing +============ + +Thank you for your interest in contributing to ``cuda-bindings``! Based on the type of contribution, it will fall into two categories: + +1. You want to report a bug, feature request, or documentation issue + - File an `issue `_ describing what you encountered or what you want to see changed. + - The NVIDIA team will evaluate the issues and triage them, scheduling + them for a release. If you believe the issue needs priority attention + comment on the issue to notify the team. +2. You want to implement a feature, improvement, or bug fix: + - At this time we do not accept code contributions. diff --git a/cuda_bindings/docs/source/environment_variables.md b/cuda_bindings/docs/source/environment_variables.md deleted file mode 100644 index 7329e582c..000000000 --- a/cuda_bindings/docs/source/environment_variables.md +++ /dev/null @@ -1,13 +0,0 @@ -# Environment Variables - -## Build-Time Environment Variables - -- `CUDA_HOME` or `CUDA_PATH`: Specifies the location of the CUDA Toolkit. - -- `CUDA_PYTHON_PARSER_CACHING` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (`CUDA_PYTHON_PARSER_CACHING` is True), the cache path is set to ./cache_, where is derived from the cuda toolkit libraries used to build cuda-bindings. - -- `CUDA_PYTHON_PARALLEL_LEVEL` (previously `PARALLEL_LEVEL`) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds. - -## Runtime Environment Variables - -- `CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM` : When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See [Stream Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html) for an explanation of the legacy and per-thread default streams. diff --git a/cuda_bindings/docs/source/environment_variables.rst b/cuda_bindings/docs/source/environment_variables.rst new file mode 100644 index 000000000..c582fe57b --- /dev/null +++ b/cuda_bindings/docs/source/environment_variables.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +Environment Variables +===================== + +Runtime Environment Variables +----------------------------- + +- ``CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM`` : When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See `Stream Synchronization Behavior `_ for an explanation of the legacy and per-thread default streams. + + +Build-Time Environment Variables +-------------------------------- + +- ``CUDA_HOME`` or ``CUDA_PATH``: Specifies the location of the CUDA Toolkit. + +- ``CUDA_PYTHON_PARSER_CACHING`` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (``CUDA_PYTHON_PARSER_CACHING`` is True), the cache path is set to ./cache_, where is derived from the cuda toolkit libraries used to build cuda-bindings. + +- ``CUDA_PYTHON_PARALLEL_LEVEL`` (previously ``PARALLEL_LEVEL``) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds. + diff --git a/cuda_bindings/docs/source/index.rst b/cuda_bindings/docs/source/index.rst index 5fc941851..3501b26a5 100644 --- a/cuda_bindings/docs/source/index.rst +++ b/cuda_bindings/docs/source/index.rst @@ -9,15 +9,15 @@ :caption: Contents: release - install.md - overview.md - motivation.md - environment_variables.md + install + overview + motivation + environment_variables api tips_and_tricks support - contribute.md - conduct.md + contribute + conduct license diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md deleted file mode 100644 index b7c693b9c..000000000 --- a/cuda_bindings/docs/source/install.md +++ /dev/null @@ -1,88 +0,0 @@ -# Installation - -## Runtime Requirements - -`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are: - -* Linux (x86-64, arm64) and Windows (x86-64) -* Python 3.9 - 3.13 -* Driver: Linux (580.65.06 or later) Windows (580.88 or later) -* Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x - -```{note} -The optional CUDA Toolkit components are now installed via the `cuda-toolkit` metapackage from PyPI for improved dependency resolution. Components can also be installed via Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). -``` - -Starting from v12.8.0, `cuda-python` becomes a meta package which currently depends only on `cuda-bindings`; in the future more sub-packages will be added to `cuda-python`. In the instructions below, we still use `cuda-python` as example to serve existing users, but everything is applicable to `cuda-bindings` as well. - - -## Installing from PyPI - -```console -$ pip install -U cuda-python -``` - -Install all optional dependencies with: -```{code-block} shell -pip install -U cuda-python[all] -``` - -Where the optional dependencies include: - -* `nvidia-cuda-nvrtc` (NVRTC runtime compilation library) -* `nvidia-nvjitlink` (nvJitLink library) -* `nvidia-nvvm` (NVVM library) -* `nvidia-cufile` (cuFile library, Linux only) - -These are now installed through the `cuda-toolkit` metapackage for improved dependency resolution. - - -## Installing from Conda - -```console -$ conda install -c conda-forge cuda-python -``` - -```{note} -When using conda, the `cuda-version` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment. -``` - -For example: -```console -$ conda install -c conda-forge cuda-python cuda-version=13 -``` - - -## Installing from Source - -### Requirements - -* CUDA Toolkit headers[^1] -* CUDA Runtime static library[^2] - -[^1]: User projects that `cimport` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the `cuda.bindings` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. - -[^2]: The CUDA Runtime static library (`libcudart_static.a` on Linux, `cudart_static.lib` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the `cuda-cudart-static` package. - -Source builds require that the provided CUDA headers are of the same major.minor version as the `cuda.bindings` you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the `CUDA_HOME` (or `CUDA_PATH`) environment variable to specify the location of your headers. For example, if your headers are located in `/usr/local/cuda/include`, then you should set `CUDA_HOME` with: - -```console -$ export CUDA_HOME=/usr/local/cuda -``` - -See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. - -```{note} -Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. -``` - - -### Editable Install - -You can use - -```console -$ pip install -v -e . -``` - -to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding). diff --git a/cuda_bindings/docs/source/install.rst b/cuda_bindings/docs/source/install.rst new file mode 100644 index 000000000..b9335b487 --- /dev/null +++ b/cuda_bindings/docs/source/install.rst @@ -0,0 +1,96 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +Installation +============ + +Runtime Requirements +-------------------- + +``cuda.bindings`` supports the same platforms as CUDA. Runtime dependencies are: + +* Linux (x86-64, arm64) and Windows (x86-64) +* Python 3.9 - 3.13 +* Driver: Linux (580.65.06 or later) Windows (580.88 or later) +* Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x + +.. note:: + + The optional CUDA Toolkit components are now installed via the ``cuda-toolkit`` metapackage from PyPI for improved dependency resolution. Components can also be installed via Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit `Windows `_ and `Linux `_ Installation Guides). + +Starting from v12.8.0, ``cuda-python`` becomes a meta package which currently depends only on ``cuda-bindings``; in the future more sub-packages will be added to ``cuda-python``. In the instructions below, we still use ``cuda-python`` as example to serve existing users, but everything is applicable to ``cuda-bindings`` as well. + +Installing from PyPI +-------------------- + +.. code-block:: console + + $ pip install -U cuda-python + +Install all optional dependencies with: + +.. code-block:: console + + $ pip install -U cuda-python[all] + +Where the optional dependencies include: + +* ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library) +* ``nvidia-nvjitlink`` (nvJitLink library) +* ``nvidia-nvvm`` (NVVM library) +* ``nvidia-cufile`` (cuFile library, Linux only) + +These are now installed through the ``cuda-toolkit`` metapackage for improved dependency resolution. + +Installing from Conda +--------------------- + +.. code-block:: console + + $ conda install -c conda-forge cuda-python + +.. note:: + + When using conda, the ``cuda-version`` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment. + +For example: + +.. code-block:: console + + $ conda install -c conda-forge cuda-python cuda-version=13 + +Installing from Source +---------------------- + +Requirements +^^^^^^^^^^^^ + +* CUDA Toolkit headers[^1] +* CUDA Runtime static library[^2] + +[^1]: User projects that ``cimport`` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the ``cuda.bindings`` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. + +[^2]: The CUDA Runtime static library (``libcudart_static.a`` on Linux, ``cudart_static.lib`` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the ``cuda-cudart-static`` package. + +Source builds require that the provided CUDA headers are of the same major.minor version as the ``cuda.bindings`` you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the ``CUDA_HOME`` (or ``CUDA_PATH``) environment variable to specify the location of your headers. For example, if your headers are located in ``/usr/local/cuda/include``, then you should set ``CUDA_HOME`` with: + +.. code-block:: console + + $ export CUDA_HOME=/usr/local/cuda + +See `Environment Variables `_ for a description of other build-time environment variables. + +.. note:: + + Only ``cydriver``, ``cyruntime`` and ``cynvrtc`` are impacted by the header requirement. + +Editable Install +^^^^^^^^^^^^^^^^ + +You can use: + +.. code-block:: console + + $ pip install -v -e . + +to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding). diff --git a/cuda_bindings/docs/source/motivation.md b/cuda_bindings/docs/source/motivation.rst similarity index 73% rename from cuda_bindings/docs/source/motivation.md rename to cuda_bindings/docs/source/motivation.rst index 5b8879f2b..afbd3412d 100644 --- a/cuda_bindings/docs/source/motivation.md +++ b/cuda_bindings/docs/source/motivation.rst @@ -1,7 +1,12 @@ -# Motivation -## What is CUDA Python? +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -NVIDIA’s CUDA Python provides [Cython](https://cython.org/) bindings and Python +Motivation +========== +What is CUDA Python? +-------------------- + +NVIDIA’s CUDA Python provides `Cython `_ bindings and Python wrappers for the driver and runtime API for existing toolkits and libraries to simplify GPU-based accelerated processing. Python is one of the most popular programming languages for science, engineering, data analytics, and deep @@ -9,14 +14,15 @@ learning applications. The goal of CUDA Python is to unify the Python ecosystem with a single set of interfaces that provide full coverage of and access to the CUDA host APIs from Python. -## Why CUDA Python? +Why CUDA Python? +---------------- CUDA Python provides uniform APIs and bindings for inclusion into existing toolkits and libraries to simplify GPU-based parallel processing for HPC, data science, and AI. -[Numba](https://numba.pydata.org/), a Python compiler from -[Anaconda](https://www.anaconda.com/) that can compile Python code for execution +`Numba `_, a Python compiler from +`Anaconda `_ that can compile Python code for execution on CUDA-capable GPUs, provides Python developers with an easy entry into GPU-accelerated computing and a path for using increasingly sophisticated CUDA code with a minimum of new syntax and jargon. Numba has its own CUDA driver API @@ -24,9 +30,9 @@ bindings that can now be replaced with CUDA Python. With CUDA Python and Numba, you get the best of both worlds: rapid iterative development with Python and the speed of a compiled language targeting both CPUs and NVIDIA GPUs. -[CuPy](https://cupy.dev/) is a -[NumPy](https://numpy.org/)/[SciPy](https://www.scipy.org/) compatible Array -library, from [Preferred Networks](https://www.preferred.jp/en/), for +`CuPy `_ is a +`NumPy `_/`SciPy `_ compatible Array +library, from `Preferred Networks `_, for GPU-accelerated computing with Python. CUDA Python simplifies the CuPy build and allows for a faster and smaller memory footprint when importing the CuPy Python module. In the future, when more CUDA Toolkit libraries are supported, diff --git a/cuda_bindings/docs/source/overview.md b/cuda_bindings/docs/source/overview.md deleted file mode 100644 index 1168d926f..000000000 --- a/cuda_bindings/docs/source/overview.md +++ /dev/null @@ -1,558 +0,0 @@ -# Overview - -Python plays a key role within the science, engineering, data analytics, and -deep learning application ecosystem. NVIDIA has long been committed to helping -the Python ecosystem leverage the accelerated massively parallel performance of -GPUs to deliver standardized libraries, tools, and applications. Today, we're -introducing another step towards simplification of the developer experience with -improved Python code portability and compatibility. - -Our goal is to help unify the Python CUDA ecosystem with a single standard set -of low-level interfaces, providing full coverage and access to the CUDA host -APIs from Python. We want to provide an ecosystem foundation to allow -interoperability among different accelerated libraries. Most importantly, it -should be easy for Python developers to use NVIDIA GPUs. - -## `cuda.bindings` workflow - -Because Python is an interpreted language, you need a way to compile the device -code into -[PTX](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html) and -then extract the function to be called at a later point in the application. You -construct your device code in the form of a string and compile it with -[NVRTC](http://docs.nvidia.com/cuda/nvrtc/index.html), a runtime compilation -library for CUDA C++. Using the NVIDIA [Driver -API](http://docs.nvidia.com/cuda/cuda-driver-api/index.html), manually create a -CUDA context and all required resources on the GPU, then launch the compiled -CUDA C++ code and retrieve the results from the GPU. Now that you have an -overview, jump into a commonly used example for parallel programming: -[SAXPY](https://developer.nvidia.com/blog/six-ways-saxpy/). - -The first thing to do is import the [Driver -API](https://docs.nvidia.com/cuda/cuda-driver-api/index.html) and -[NVRTC](https://docs.nvidia.com/cuda/nvrtc/index.html) modules from the `cuda.bindings` -package. Next, we consider how to store host data and pass it to the device. Different -approaches can be used to accomplish this and are described in [Preparing kernel -arguments](https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html#preparing-kernel-arguments). -In this example, we will use NumPy to store host data and pass it to the device, so let's -import this dependency as well. - -```python -from cuda.bindings import driver, nvrtc -import numpy as np -``` - -Error checking is a fundamental best practice when working with low-level interfaces. -The following code snippet lets us validate each API call and raise exceptions in case of error. - -```python -def _cudaGetErrorEnum(error): - if isinstance(error, driver.CUresult): - err, name = driver.cuGetErrorName(error) - return name if err == driver.CUresult.CUDA_SUCCESS else "" - elif isinstance(error, nvrtc.nvrtcResult): - return nvrtc.nvrtcGetErrorString(error)[1] - else: - raise RuntimeError('Unknown error type: {}'.format(error)) - -def checkCudaErrors(result): - if result[0].value: - raise RuntimeError("CUDA error code={}({})".format(result[0].value, _cudaGetErrorEnum(result[0]))) - if len(result) == 1: - return None - elif len(result) == 2: - return result[1] - else: - return result[1:] -``` - -It's common practice to write CUDA kernels near the top of a translation unit, -so write it next. The entire kernel is wrapped in triple quotes to form a -string. The string is compiled later using NVRTC. This is the only part of CUDA -Python that requires some understanding of CUDA C++. For more information, see -[An Even Easier Introduction to -CUDA](https://developer.nvidia.com/blog/even-easier-introduction-cuda/). - -```python -saxpy = """\ -extern "C" __global__ -void saxpy(float a, float *x, float *y, float *out, size_t n) -{ - size_t tid = blockIdx.x * blockDim.x + threadIdx.x; - if (tid < n) { - out[tid] = a * x[tid] + y[tid]; - } -} -""" -``` -Go ahead and compile the kernel into PTX. Remember that this is executed at runtime using NVRTC. There are three basic steps to NVRTC: - -- Create a program from the string. -- Compile the program. -- Extract PTX from the compiled program. - -In the following code example, the Driver API is initialized so that the NVIDIA driver -and GPU are accessible. Next, the GPU is queried for their compute capability. Finally, -the program is compiled to target our local compute capability architecture with FMAD disabled. - -```python -# Initialize CUDA Driver API -checkCudaErrors(driver.cuInit(0)) - -# Retrieve handle for device 0 -cuDevice = checkCudaErrors(driver.cuDeviceGet(0)) - -# Derive target architecture for device 0 -major = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)) -minor = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)) -arch_arg = bytes(f'--gpu-architecture=compute_{major}{minor}', 'ascii') - -# Create program -prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(saxpy), b"saxpy.cu", 0, [], [])) - -# Compile program -opts = [b"--fmad=false", arch_arg] -checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, 2, opts)) - -# Get PTX from compilation -ptxSize = checkCudaErrors(nvrtc.nvrtcGetPTXSize(prog)) -ptx = b" " * ptxSize -checkCudaErrors(nvrtc.nvrtcGetPTX(prog, ptx)) -``` - -Before you can use the PTX or do any work on the GPU, you must create a CUDA -context. CUDA contexts are analogous to host processes for the device. In the -following code example, a handle for compute device 0 is passed to -`cuCtxCreate` to designate that GPU for context creation. - -```python -# Create context -context = checkCudaErrors(driver.cuCtxCreate(0, cuDevice)) -``` - -With a CUDA context created on device 0, load the PTX generated earlier into a -module. A module is analogous to dynamically loaded libraries for the device. -After loading into the module, extract a specific kernel with -`cuModuleGetFunction`. It is not uncommon for multiple kernels to reside in PTX. - -```python -# Load PTX as module data and retrieve function -ptx = np.char.array(ptx) -# Note: Incompatible --gpu-architecture would be detected here -module = checkCudaErrors(driver.cuModuleLoadData(ptx.ctypes.data)) -kernel = checkCudaErrors(driver.cuModuleGetFunction(module, b"saxpy")) -``` - -Next, get all your data prepared and transferred to the GPU. For increased -application performance, you can input data on the device to eliminate data -transfers. For completeness, this example shows how you would transfer data to -and from the device. - -```python -NUM_THREADS = 512 # Threads per block -NUM_BLOCKS = 32768 # Blocks per grid - -a = np.array([2.0], dtype=np.float32) -n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32) -bufferSize = n * a.itemsize - -hX = np.random.rand(n).astype(dtype=np.float32) -hY = np.random.rand(n).astype(dtype=np.float32) -hOut = np.zeros(n).astype(dtype=np.float32) -``` - -With the input data `a`, `x`, and `y` created for the SAXPY transform device, -resources must be allocated to store the data using `cuMemAlloc`. To allow for -more overlap between compute and data movement, use the asynchronous function -`cuMemcpyHtoDAsync`. It returns control to the CPU immediately following command -execution. - -Python doesn't have a natural concept of pointers, yet `cuMemcpyHtoDAsync` expects -`void*`. This is where we leverage NumPy's data types to retrieve each host data pointer -by calling `XX.ctypes.data` for the associated XX. - -```python -dXclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) -dYclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) -dOutclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) - -stream = checkCudaErrors(driver.cuStreamCreate(0)) - -checkCudaErrors(driver.cuMemcpyHtoDAsync( - dXclass, hX.ctypes.data, bufferSize, stream -)) -checkCudaErrors(driver.cuMemcpyHtoDAsync( - dYclass, hY.ctypes.data, bufferSize, stream -)) -``` - -With data prep and resources allocation finished, the kernel is ready to be -launched. To pass the location of the data on the device to the kernel execution -configuration, you must retrieve the device pointer. In the following code -example, we call `int(XXclass)` to retrieve the device pointer value for the -associated XXclass as a Python `int` and wrap it in a `np.array` type. - -```python -dX = np.array([int(dXclass)], dtype=np.uint64) -dY = np.array([int(dYclass)], dtype=np.uint64) -dOut = np.array([int(dOutclass)], dtype=np.uint64) -``` - -The launch API `cuLaunchKernel` also expects a pointer input for the argument list -but this time it's of type `void**`. What this means is that our argument list needs to -be a contiguous array of `void*` elements, where each element is the pointer to a kernel -argument on either host or device. Since we already prepared each of our arguments into a `np.array` type, the -construction of our final contiguous array is done by retrieving the `XX.ctypes.data` -of each kernel argument. - -```python -args = [a, dX, dY, dOut, n] -args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) -``` - -Now the kernel can be launched: - -```python -checkCudaErrors(driver.cuLaunchKernel( - kernel, - NUM_BLOCKS, # grid x dim - 1, # grid y dim - 1, # grid z dim - NUM_THREADS, # block x dim - 1, # block y dim - 1, # block z dim - 0, # dynamic shared memory - stream, # stream - args.ctypes.data, # kernel arguments - 0, # extra (ignore) -)) - -checkCudaErrors(driver.cuMemcpyDtoHAsync( - hOut.ctypes.data, dOutclass, bufferSize, stream -)) -checkCudaErrors(driver.cuStreamSynchronize(stream)) -``` - -The `cuLaunchKernel` function takes the compiled module kernel and execution -configuration parameters. The device code is launched in the same stream as the -data transfers. That ensures that the kernel's compute is performed only after -the data has finished transfer, as all API calls and kernel launches within a -stream are serialized. After the call to transfer data back to the host is -executed, `cuStreamSynchronize` is used to halt CPU execution until all operations -in the designated stream are finished. - -```python -# Assert values are same after running kernel -hZ = a * hX + hY -if not np.allclose(hOut, hZ): - raise ValueError("Error outside tolerance for host-device vectors") -``` - -Perform verification of the data to ensure correctness and finish the code with -memory clean up. - -```python -checkCudaErrors(driver.cuStreamDestroy(stream)) -checkCudaErrors(driver.cuMemFree(dXclass)) -checkCudaErrors(driver.cuMemFree(dYclass)) -checkCudaErrors(driver.cuMemFree(dOutclass)) -checkCudaErrors(driver.cuModuleUnload(module)) -checkCudaErrors(driver.cuCtxDestroy(context)) -``` - -## Performance - -Performance is a primary driver in targeting GPUs in your application. So, how -does the above code compare to its C++ version? Table 1 shows that the results -are nearly identical. [NVIDIA NSight -Systems](https://developer.nvidia.com/nsight-systems) was used to retrieve -kernel performance and [CUDA -Events](https://developer.nvidia.com/blog/how-implement-performance-metrics-cuda-cc/) -was used for application performance. - -The following command was used to profile the applications: - -```{code-block} shell -nsys profile -s none -t cuda --stats=true -``` - -```{list-table} Kernel and application performance comparison. -:header-rows: 1 - -* - - - C++ - - Python -* - Kernel execution - - 352µs - - 352µs -* - Application execution - - 1076ms - - 1080ms -``` - -`cuda.bindings` is also compatible with [NVIDIA Nsight -Compute](https://developer.nvidia.com/nsight-compute), which is an -interactive kernel profiler for CUDA applications. It allows you to have -detailed insights into kernel performance. This is useful when you're trying to -maximize performance ({numref}`Figure 1`). - -```{figure} _static/images/Nsight-Compute-CLI-625x473.png -:name: Figure 1 - -Screenshot of Nsight Compute CLI output of `cuda.bindings` example. -``` - -## Preparing kernel arguments - -The `cuLaunchKernel` API bindings retain low-level CUDA argument preparation requirements: - -* Each kernel argument is a `void*` (i.e. pointer to the argument) -* `kernelParams` is a `void**` (i.e. pointer to a list of kernel arguments) -* `kernelParams` arguments are in contiguous memory - -These requirements can be met with two different approaches, using either NumPy or ctypes. - -### Using NumPy - -NumPy [Array objects](https://numpy.org/doc/stable/reference/arrays.html) can be used to fulfill each of these conditions directly. - -Let's use the following kernel definition as an example: -```python -kernel_string = """\ -typedef struct { - int value; -} testStruct; - -extern "C" __global__ -void testkernel(int i, int *pi, - float f, float *pf, - testStruct s, testStruct *ps) -{ - *pi = i; - *pf = f; - ps->value = s.value; -} -""" -``` - -The first step is to create array objects with types corresponding to your kernel arguments. Primitive NumPy types have the following corresponding kernel types: - -```{list-table} Correspondence between NumPy types and kernel types. -:header-rows: 1 - -* - NumPy type - - Corresponding kernel types - - itemsize (bytes) -* - bool - - bool - - 1 -* - int8 - - char, signed char, int8_t - - 1 -* - int16 - - short, signed short, int16_t - - 2 -* - int32 - - int, signed int, int32_t - - 4 -* - int64 - - long long, signed long long, int64_t - - 8 -* - uint8 - - unsigned char, uint8_t - - 1 -* - uint16 - - unsigned short, uint16_t - - 2 -* - uint32 - - unsigned int, uint32_t - - 4 -* - uint64 - - unsigned long long, uint64_t - - 8 -* - float16 - - half - - 2 -* - float32 - - float - - 4 -* - float64 - - double - - 8 -* - complex64 - - float2, cuFloatComplex, complex<float> - - 8 -* - complex128 - - double2, cuDoubleComplex, complex<double> - - 16 -``` - -Furthermore, custom NumPy types can be used to support both platform-dependent types and user-defined structures as kernel arguments. - -This example uses the following types: -* `int` is `np.uint32` -* `float` is `np.float32` -* `int*`, `float*` and `testStruct*` are `np.intp` -* `testStruct` is a custom user type `np.dtype([("value", np.int32)], align=True)` - -Note how all three pointers are `np.intp` since the pointer values are always a representation of an address space. - -Putting it all together: -```python -# Define a custom type -testStruct = np.dtype([("value", np.int32)], align=True) - -# Allocate device memory -pInt = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.int32).itemsize)) -pFloat = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.float32).itemsize)) -pStruct = checkCudaErrors(cudart.cudaMalloc(testStruct.itemsize)) - -# Collect all input kernel arguments into a single tuple for further processing -kernelValues = ( - np.array(1, dtype=np.uint32), - np.array([pInt], dtype=np.intp), - np.array(123.456, dtype=np.float32), - np.array([pFloat], dtype=np.intp), - np.array([5], testStruct), - np.array([pStruct], dtype=np.intp), -) -``` - -The final step is to construct a `kernelParams` argument that fulfills all of the launch API conditions. This is made easy because each array object comes -with a [ctypes](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html#numpy.ndarray.ctypes) data attribute that returns the underlying `void*` pointer value. - -By having the final array object contain all pointers, we fulfill the contiguous array requirement: - -```python -kernelParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) -``` - -The launch API supports [Buffer Protocol](https://docs.python.org/3/c-api/buffer.html) objects, therefore we can pass the array object directly. - -```python -checkCudaErrors(cuda.cuLaunchKernel( - kernel, - 1, 1, 1, # grid dim - 1, 1, 1, # block dim - 0, stream, # shared mem and stream - kernelParams=kernelParams, - extra=0, -)) -``` - -### Using ctypes - -The [ctypes](https://docs.python.org/3/library/ctypes.html) approach relaxes the parameter preparation requirement by delegating the contiguous memory requirement to the API launch call. - -Let's use the same kernel definition as the previous section for the example. - -The ctypes approach treats the `kernelParams` argument as a pair of two tuples: `kernel_values` and `kernel_types`. - -* `kernel_values` contain Python values to be used as an input to your kernel -* `kernel_types` contain the data types that your kernel_values should be converted into - -The ctypes [fundamental data types](https://docs.python.org/3/library/ctypes.html#fundamental-data-types) documentation describes the compatibility between different Python types and C types. -Furthermore, [custom data types](https://docs.python.org/3/library/ctypes.html#calling-functions-with-your-own-custom-data-types) can be used to support kernels with custom types. - -For this example the result becomes: - -```python -# Define a custom type -class testStruct(ctypes.Structure): - _fields_ = [("value", ctypes.c_int)] - -# Allocate device memory -pInt = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_int))) -pFloat = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_float))) -pStruct = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(testStruct))) - -# Collect all input kernel arguments into a single tuple for further processing -kernelValues = ( - 1, - pInt, - 123.456, - pFloat, - testStruct(5), - pStruct, -) -kernelTypes = ( - ctypes.c_int, - ctypes.c_void_p, - ctypes.c_float, - ctypes.c_void_p, - None, - ctypes.c_void_p, -) -``` - -Values that are set to `None` have a special meaning: - -1. The value supports a callable `getPtr` that returns the pointer address of the underlining C object address (e.g. all CUDA C types that are exposed to Python as Python classes) -2. The value is an instance of `ctypes.Structure` -3. The value is an `Enum` - -In all three cases, the API call will fetch the underlying pointer value and construct a contiguous array with other kernel parameters. - -With the setup complete, the kernel can be launched: - -```python -checkCudaErrors(cuda.cuLaunchKernel( - kernel, - 1, 1, 1, # grid dim - 1, 1, 1, # block dim - 0, stream, # shared mem and stream - kernelParams=(kernelValues, kernelTypes), - extra=0, -)) -``` - -### CUDA objects - -Certain CUDA kernels use native CUDA types as their parameters such as `cudaTextureObject_t`. These types require special handling since they're neither a primitive ctype nor a custom user type. Since `cuda.bindings` exposes each of them as Python classes, they each implement `getPtr()` and `__int__()`. These two callables used to support the NumPy and ctypes approach. The difference between each call is further described under [Tips and Tricks](https://nvidia.github.io/cuda-python/cuda-bindings/latest/tips_and_tricks.html#). - -For this example, lets use the `transformKernel` from [examples/0_Introduction/simpleCubemapTexture_test.py](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py): - -```python -simpleCubemapTexture = """\ -extern "C" -__global__ void transformKernel(float *g_odata, int width, cudaTextureObject_t tex) -{ - ... -} -""" - -def main(): - ... - d_data = checkCudaErrors(cudart.cudaMalloc(size)) - width = 64 - tex = checkCudaErrors(cudart.cudaCreateTextureObject(texRes, texDescr, None)) - ... -``` - -For NumPy, we can convert these CUDA types by leveraging the `__int__()` call to fetch the address of the underlying `cudaTextureObject_t` C object and wrapping it in a NumPy object array of type `np.intp`: - -```python -kernelValues = ( - np.array([d_data], dtype=np.intp), - np.array(width, dtype=np.uint32), - np.array([int(tex)], dtype=np.intp), -) -kernelArgs = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) -``` - -For ctypes, we leverage the special handling of `None` type since each Python class already implements `getPtr()`: - -```python -kernelValues = ( - d_data, - width, - tex, -) -kernelTypes = ( - ctypes.c_void_p, - ctypes.c_int, - None, -) -kernelArgs = (kernelValues, kernelTypes) -``` - diff --git a/cuda_bindings/docs/source/overview.rst b/cuda_bindings/docs/source/overview.rst new file mode 100644 index 000000000..0f3203252 --- /dev/null +++ b/cuda_bindings/docs/source/overview.rst @@ -0,0 +1,568 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +Overview +======== + +Python plays a key role within the science, engineering, data analytics, and +deep learning application ecosystem. NVIDIA has long been committed to helping +the Python ecosystem leverage the accelerated massively parallel performance of +GPUs to deliver standardized libraries, tools, and applications. Today, we're +introducing another step towards simplification of the developer experience with +improved Python code portability and compatibility. + +Our goal is to help unify the Python CUDA ecosystem with a single standard set +of low-level interfaces, providing full coverage and access to the CUDA host +APIs from Python. We want to provide an ecosystem foundation to allow +interoperability among different accelerated libraries. Most importantly, it +should be easy for Python developers to use NVIDIA GPUs. + +``cuda.bindings`` workflow +--------------------------- + +Because Python is an interpreted language, you need a way to compile the device +code into +`PTX `_ and +then extract the function to be called at a later point in the application. You +construct your device code in the form of a string and compile it with +`NVRTC `_, a runtime compilation +library for CUDA C++. Using the NVIDIA `Driver +API `_, manually create a +CUDA context and all required resources on the GPU, then launch the compiled +CUDA C++ code and retrieve the results from the GPU. Now that you have an +overview, jump into a commonly used example for parallel programming: +`SAXPY `_. + +The first thing to do is import the `Driver +API `_ and +`NVRTC `_ modules from the ``cuda.bindings`` +package. Next, we consider how to store host data and pass it to the device. Different +approaches can be used to accomplish this and are described in `Preparing kernel +arguments `_. +In this example, we will use NumPy to store host data and pass it to the device, so let's +import this dependency as well. + +.. code-block:: python + + from cuda.bindings import driver, nvrtc + import numpy as np + +Error checking is a fundamental best practice when working with low-level interfaces. +The following code snippet lets us validate each API call and raise exceptions in case of error: + +.. code-block:: python + + def _cudaGetErrorEnum(error): + if isinstance(error, driver.CUresult): + err, name = driver.cuGetErrorName(error) + return name if err == driver.CUresult.CUDA_SUCCESS else "" + elif isinstance(error, nvrtc.nvrtcResult): + return nvrtc.nvrtcGetErrorString(error)[1] + else: + raise RuntimeError('Unknown error type: {}'.format(error)) + + def checkCudaErrors(result): + if result[0].value: + raise RuntimeError("CUDA error code={}({})".format(result[0].value, _cudaGetErrorEnum(result[0]))) + if len(result) == 1: + return None + elif len(result) == 2: + return result[1] + else: + return result[1:] + +It's common practice to write CUDA kernels near the top of a translation unit, +so write it next. The entire kernel is wrapped in triple quotes to form a +string. The string is compiled later using NVRTC. This is the only part of CUDA +Python that requires some understanding of CUDA C++. For more information, see +`An Even Easier Introduction to +CUDA `_. + +.. code-block:: python + + saxpy = """\ + extern "C" __global__ + void saxpy(float a, float *x, float *y, float *out, size_t n) + { + size_t tid = blockIdx.x * blockDim.x + threadIdx.x; + if (tid < n) { + out[tid] = a * x[tid] + y[tid]; + } + } + """ + +Go ahead and compile the kernel into PTX. Remember that this is executed at runtime using NVRTC. There are three basic steps to NVRTC: + +- Create a program from the string. +- Compile the program. +- Extract PTX from the compiled program. + +In the following code example, the Driver API is initialized so that the NVIDIA driver +and GPU are accessible. Next, the GPU is queried for their compute capability. Finally, +the program is compiled to target our local compute capability architecture with FMAD disabled: + +.. code-block:: python + + # Initialize CUDA Driver API + checkCudaErrors(driver.cuInit(0)) + + # Retrieve handle for device 0 + cuDevice = checkCudaErrors(driver.cuDeviceGet(0)) + + # Derive target architecture for device 0 + major = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)) + minor = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)) + arch_arg = bytes(f'--gpu-architecture=compute_{major}{minor}', 'ascii') + + # Create program + prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(saxpy), b"saxpy.cu", 0, [], [])) + + # Compile program + opts = [b"--fmad=false", arch_arg] + checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, 2, opts)) + + # Get PTX from compilation + ptxSize = checkCudaErrors(nvrtc.nvrtcGetPTXSize(prog)) + ptx = b" " * ptxSize + checkCudaErrors(nvrtc.nvrtcGetPTX(prog, ptx)) + +Before you can use the PTX or do any work on the GPU, you must create a CUDA +context. CUDA contexts are analogous to host processes for the device. In the +following code example, a handle for compute device 0 is passed to +``cuCtxCreate`` to designate that GPU for context creation: + +.. code-block:: python + + # Create context + context = checkCudaErrors(driver.cuCtxCreate(0, cuDevice)) + +With a CUDA context created on device 0, load the PTX generated earlier into a +module. A module is analogous to dynamically loaded libraries for the device. +After loading into the module, extract a specific kernel with +``cuModuleGetFunction``. It is not uncommon for multiple kernels to reside in PTX: + +.. code-block:: python + + # Load PTX as module data and retrieve function + ptx = np.char.array(ptx) + # Note: Incompatible --gpu-architecture would be detected here + module = checkCudaErrors(driver.cuModuleLoadData(ptx.ctypes.data)) + kernel = checkCudaErrors(driver.cuModuleGetFunction(module, b"saxpy")) + +Next, get all your data prepared and transferred to the GPU. For increased +application performance, you can input data on the device to eliminate data +transfers. For completeness, this example shows how you would transfer data to +and from the device: + +.. code-block:: python + + NUM_THREADS = 512 # Threads per block + NUM_BLOCKS = 32768 # Blocks per grid + + a = np.array([2.0], dtype=np.float32) + n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32) + bufferSize = n * a.itemsize + + hX = np.random.rand(n).astype(dtype=np.float32) + hY = np.random.rand(n).astype(dtype=np.float32) + hOut = np.zeros(n).astype(dtype=np.float32) + +With the input data ``a``, ``x``, and ``y`` created for the SAXPY transform device, +resources must be allocated to store the data using ``cuMemAlloc``. To allow for +more overlap between compute and data movement, use the asynchronous function +``cuMemcpyHtoDAsync``. It returns control to the CPU immediately following command +execution. + +Python doesn't have a natural concept of pointers, yet ``cuMemcpyHtoDAsync`` expects +``void*``. This is where we leverage NumPy's data types to retrieve each host data pointer +by calling ``XX.ctypes.data`` for the associated XX: + +.. code-block:: python + + dXclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) + dYclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) + dOutclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) + + stream = checkCudaErrors(driver.cuStreamCreate(0)) + + checkCudaErrors(driver.cuMemcpyHtoDAsync( + dXclass, hX.ctypes.data, bufferSize, stream + )) + checkCudaErrors(driver.cuMemcpyHtoDAsync( + dYclass, hY.ctypes.data, bufferSize, stream + )) + +With data prep and resources allocation finished, the kernel is ready to be +launched. To pass the location of the data on the device to the kernel execution +configuration, you must retrieve the device pointer. In the following code +example, we call ``int(XXclass)`` to retrieve the device pointer value for the +associated XXclass as a Python ``int`` and wrap it in a ``np.array`` type: + +.. code-block:: python + + dX = np.array([int(dXclass)], dtype=np.uint64) + dY = np.array([int(dYclass)], dtype=np.uint64) + dOut = np.array([int(dOutclass)], dtype=np.uint64) + +The launch API ``cuLaunchKernel`` also expects a pointer input for the argument list +but this time it's of type ``void**``. What this means is that our argument list needs to +be a contiguous array of ``void*`` elements, where each element is the pointer to a kernel +argument on either host or device. Since we already prepared each of our arguments into a ``np.array`` type, the +construction of our final contiguous array is done by retrieving the ``XX.ctypes.data`` +of each kernel argument: + +.. code-block:: python + + args = [a, dX, dY, dOut, n] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + +Now the kernel can be launched: + +.. code-block:: python + + checkCudaErrors(driver.cuLaunchKernel( + kernel, + NUM_BLOCKS, # grid x dim + 1, # grid y dim + 1, # grid z dim + NUM_THREADS, # block x dim + 1, # block y dim + 1, # block z dim + 0, # dynamic shared memory + stream, # stream + args.ctypes.data, # kernel arguments + 0, # extra (ignore) + )) + + checkCudaErrors(driver.cuMemcpyDtoHAsync( + hOut.ctypes.data, dOutclass, bufferSize, stream + )) + checkCudaErrors(driver.cuStreamSynchronize(stream)) + +The ``cuLaunchKernel`` function takes the compiled module kernel and execution +configuration parameters. The device code is launched in the same stream as the +data transfers. That ensures that the kernel's compute is performed only after +the data has finished transfer, as all API calls and kernel launches within a +stream are serialized. After the call to transfer data back to the host is +executed, ``cuStreamSynchronize`` is used to halt CPU execution until all operations +in the designated stream are finished: + +.. code-block:: python + + # Assert values are same after running kernel + hZ = a * hX + hY + if not np.allclose(hOut, hZ): + raise ValueError("Error outside tolerance for host-device vectors") + +Perform verification of the data to ensure correctness and finish the code with +memory clean up: + +.. code-block:: python + + checkCudaErrors(driver.cuStreamDestroy(stream)) + checkCudaErrors(driver.cuMemFree(dXclass)) + checkCudaErrors(driver.cuMemFree(dYclass)) + checkCudaErrors(driver.cuMemFree(dOutclass)) + checkCudaErrors(driver.cuModuleUnload(module)) + checkCudaErrors(driver.cuCtxDestroy(context)) + +Performance +----------- + +Performance is a primary driver in targeting GPUs in your application. So, how +does the above code compare to its C++ version? Table 1 shows that the results +are nearly identical. `NVIDIA NSight +Systems `_ was used to retrieve +kernel performance and `CUDA +Events `_ +was used for application performance. + +The following command was used to profile the applications: + +.. code-block:: shell + + nsys profile -s none -t cuda --stats=true + +.. list-table:: Kernel and application performance comparison. + :header-rows: 1 + + * - + - C++ + - Python + * - Kernel execution + - 352µs + - 352µs + * - Application execution + - 1076ms + - 1080ms + +``cuda.bindings`` is also compatible with `NVIDIA Nsight +Compute `_, which is an +interactive kernel profiler for CUDA applications. It allows you to have +detailed insights into kernel performance. This is useful when you're trying to +maximize performance ({numref}``Figure 1``). + +.. figure:: _static/images/Nsight-Compute-CLI-625x473.png + :name: Figure 1 + + Screenshot of Nsight Compute CLI output of ``cuda.bindings`` example. + +Preparing kernel arguments +-------------------------- + +The ``cuLaunchKernel`` API bindings retain low-level CUDA argument preparation requirements: + +* Each kernel argument is a ``void*`` (i.e. pointer to the argument) +* ``kernelParams`` is a ``void**`` (i.e. pointer to a list of kernel arguments) +* ``kernelParams`` arguments are in contiguous memory + +These requirements can be met with two different approaches, using either NumPy or ctypes. + +Using NumPy +^^^^^^^^^^^ + +NumPy `Array objects `_ can be used to fulfill each of these conditions directly. + +Let's use the following kernel definition as an example: + +.. code-block:: python + + kernel_string = """ + typedef struct { + int value; + } testStruct; + + extern "C" __global__ + void testkernel(int i, int *pi, + float f, float *pf, + testStruct s, testStruct *ps) + { + *pi = i; + *pf = f; + ps->value = s.value; + } + """ + +The first step is to create array objects with types corresponding to your kernel arguments. Primitive NumPy types have the following corresponding kernel types: + +.. list-table:: Correspondence between NumPy types and kernel types. + :header-rows: 1 + + * - NumPy type + - Corresponding kernel types + - itemsize (bytes) + * - bool + - bool + - 1 + * - int8 + - char, signed char, int8_t + - 1 + * - int16 + - short, signed short, int16_t + - 2 + * - int32 + - int, signed int, int32_t + - 4 + * - int64 + - long long, signed long long, int64_t + - 8 + * - uint8 + - unsigned char, uint8_t + - 1 + * - uint16 + - unsigned short, uint16_t + - 2 + * - uint32 + - unsigned int, uint32_t + - 4 + * - uint64 + - unsigned long long, uint64_t + - 8 + * - float16 + - half + - 2 + * - float32 + - float + - 4 + * - float64 + - double + - 8 + * - complex64 + - float2, cuFloatComplex, complex<float> + - 8 + * - complex128 + - double2, cuDoubleComplex, complex<double> + - 16 + +Furthermore, custom NumPy types can be used to support both platform-dependent types and user-defined structures as kernel arguments. + +This example uses the following types: +* ``int`` is ``np.uint32`` +* ``float`` is ``np.float32`` +* ``int*``, ``float*`` and ``testStruct*`` are ``np.intp`` +* ``testStruct`` is a custom user type ``np.dtype([("value", np.int32)], align=True)`` + +Note how all three pointers are ``np.intp`` since the pointer values are always a representation of an address space. + +Putting it all together: + +.. code-block:: python + + # Define a custom type + testStruct = np.dtype([("value", np.int32)], align=True) + + # Allocate device memory + pInt = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.int32).itemsize)) + pFloat = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.float32).itemsize)) + pStruct = checkCudaErrors(cudart.cudaMalloc(testStruct.itemsize)) + + # Collect all input kernel arguments into a single tuple for further processing + kernelValues = ( + np.array(1, dtype=np.uint32), + np.array([pInt], dtype=np.intp), + np.array(123.456, dtype=np.float32), + np.array([pFloat], dtype=np.intp), + np.array([5], testStruct), + np.array([pStruct], dtype=np.intp), + ) + +The final step is to construct a ``kernelParams`` argument that fulfills all of the launch API conditions. This is made easy because each array object comes +with a `ctypes `_ data attribute that returns the underlying ``void*`` pointer value. + +By having the final array object contain all pointers, we fulfill the contiguous array requirement: + +.. code-block:: python + + kernelParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) + +The launch API supports `Buffer Protocol `_ objects, therefore we can pass the array object directly: + +.. code-block:: python + + checkCudaErrors(cuda.cuLaunchKernel( + kernel, + 1, 1, 1, # grid dim + 1, 1, 1, # block dim + 0, stream, # shared mem and stream + kernelParams=kernelParams, + extra=0, + )) + +Using ctypes +^^^^^^^^^^^^ + +The `ctypes `_ approach relaxes the parameter preparation requirement by delegating the contiguous memory requirement to the API launch call. + +Let's use the same kernel definition as the previous section for the example. + +The ctypes approach treats the ``kernelParams`` argument as a pair of two tuples: ``kernel_values`` and ``kernel_types``. + +* ``kernel_values`` contain Python values to be used as an input to your kernel +* ``kernel_types`` contain the data types that your kernel_values should be converted into + +The ctypes `fundamental data types `_ documentation describes the compatibility between different Python types and C types. +Furthermore, `custom data types `_ can be used to support kernels with custom types. + +For this example the result becomes: + +.. code-block:: python + + # Define a custom type + class testStruct(ctypes.Structure): + _fields_ = [("value", ctypes.c_int)] + + # Allocate device memory + pInt = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_int))) + pFloat = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_float))) + pStruct = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(testStruct))) + + # Collect all input kernel arguments into a single tuple for further processing + kernelValues = ( + 1, + pInt, + 123.456, + pFloat, + testStruct(5), + pStruct, + ) + kernelTypes = ( + ctypes.c_int, + ctypes.c_void_p, + ctypes.c_float, + ctypes.c_void_p, + None, + ctypes.c_void_p, + ) + +Values that are set to ``None`` have a special meaning: + +1. The value supports a callable ``getPtr`` that returns the pointer address of the underlining C object address (e.g. all CUDA C types that are exposed to Python as Python classes) +2. The value is an instance of ``ctypes.Structure`` +3. The value is an ``Enum`` + +In all three cases, the API call will fetch the underlying pointer value and construct a contiguous array with other kernel parameters. + +With the setup complete, the kernel can be launched: + +.. code-block:: python + + checkCudaErrors(cuda.cuLaunchKernel( + kernel, + 1, 1, 1, # grid dim + 1, 1, 1, # block dim + 0, stream, # shared mem and stream + kernelParams=(kernelValues, kernelTypes), + extra=0, + )) + +CUDA objects +^^^^^^^^^^^^ + +Certain CUDA kernels use native CUDA types as their parameters such as ``cudaTextureObject_t``. These types require special handling since they're neither a primitive ctype nor a custom user type. Since ``cuda.bindings`` exposes each of them as Python classes, they each implement ``getPtr()`` and ``__int__()``. These two callables used to support the NumPy and ctypes approach. The difference between each call is further described under `Tips and Tricks `_. + +For this example, lets use the ``transformKernel`` from `examples/0_Introduction/simpleCubemapTexture_test.py `_: + +.. code-block:: python + + simpleCubemapTexture = """\ + extern "C" + __global__ void transformKernel(float *g_odata, int width, cudaTextureObject_t tex) + { + ... + } + """ + + def main(): + ... + d_data = checkCudaErrors(cudart.cudaMalloc(size)) + width = 64 + tex = checkCudaErrors(cudart.cudaCreateTextureObject(texRes, texDescr, None)) + ... + +For NumPy, we can convert these CUDA types by leveraging the ``__int__()`` call to fetch the address of the underlying ``cudaTextureObject_t`` C object and wrapping it in a NumPy object array of type ``np.intp``: + +.. code-block:: python + + kernelValues = ( + np.array([d_data], dtype=np.intp), + np.array(width, dtype=np.uint32), + np.array([int(tex)], dtype=np.intp), + ) + kernelArgs = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) + +For ctypes, we leverage the special handling of ``None`` type since each Python class already implements ``getPtr()``: + +.. code-block:: python + + kernelValues = ( + d_data, + width, + tex, + ) + kernelTypes = ( + ctypes.c_void_p, + ctypes.c_int, + None, + ) + kernelArgs = (kernelValues, kernelTypes) + diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst index 3f0323ccd..7082d2b70 100644 --- a/cuda_bindings/docs/source/release.rst +++ b/cuda_bindings/docs/source/release.rst @@ -14,28 +14,28 @@ Release Notes 12.9.2 12.9.1 12.9.0 - 12.8.0 - 12.6.2 - 12.6.1 - 12.6.0 - 12.5.0 - 12.4.0 - 12.3.0 - 12.2.1 - 12.2.0 - 12.1.0 - 12.0.0 + 12.8.0 + 12.6.2 + 12.6.1 + 12.6.0 + 12.5.0 + 12.4.0 + 12.3.0 + 12.2.1 + 12.2.0 + 12.1.0 + 12.0.0 11.8.7 - 11.8.6 - 11.8.5 - 11.8.4 - 11.8.3 - 11.8.2 - 11.8.1 - 11.8.0 - 11.7.1 - 11.7.0 - 11.6.1 - 11.6.0 - 11.5.0 - 11.4.0 + 11.8.6 + 11.8.5 + 11.8.4 + 11.8.3 + 11.8.2 + 11.8.1 + 11.8.0 + 11.7.1 + 11.7.0 + 11.6.1 + 11.6.0 + 11.5.0 + 11.4.0 diff --git a/cuda_bindings/docs/source/release/11.4.0-notes.md b/cuda_bindings/docs/source/release/11.4.0-notes.rst similarity index 73% rename from cuda_bindings/docs/source/release/11.4.0-notes.md rename to cuda_bindings/docs/source/release/11.4.0-notes.rst index 9eaa4eff0..c019aedd9 100644 --- a/cuda_bindings/docs/source/release/11.4.0-notes.md +++ b/cuda_bindings/docs/source/release/11.4.0-notes.rst @@ -1,18 +1,25 @@ -# CUDA Python 11.4.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.4.0 Release notes +================================ Released on August 16, 2021 -## Highlights +Highlights +---------- - Initial EA release for CUDA Python - Supports all platforms that CUDA is supported - Supports all CUDA 11.x releases - Low-level CUDA Cython bindings and Python wrappers -## Limitations +Limitations +----------- - Source code release only; Python packages coming in a future release. -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - cudaGetTextureReference - cudaGetSurfaceReference diff --git a/cuda_bindings/docs/source/release/11.5.0-notes.md b/cuda_bindings/docs/source/release/11.5.0-notes.rst similarity index 89% rename from cuda_bindings/docs/source/release/11.5.0-notes.md rename to cuda_bindings/docs/source/release/11.5.0-notes.rst index 130cb17d0..17cb02e0c 100644 --- a/cuda_bindings/docs/source/release/11.5.0-notes.md +++ b/cuda_bindings/docs/source/release/11.5.0-notes.rst @@ -1,8 +1,13 @@ -# CUDA Python 11.5.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.5.0 Release notes +================================ Released on October 18, 2021 -## Highlights +Highlights +---------- - PyPi support - Conda support - GA release for CUDA Python @@ -10,11 +15,13 @@ Released on October 18, 2021 - Supports all CUDA 11.x releases - Low-level CUDA Cython bindings and Python wrappers -## Limitations +Limitations +----------- - Changing default stream not supported; coming in future release -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - cudaGetTextureReference - cudaGetSurfaceReference diff --git a/cuda_bindings/docs/source/release/11.6.0-notes.md b/cuda_bindings/docs/source/release/11.6.0-notes.md deleted file mode 100644 index 664da1624..000000000 --- a/cuda_bindings/docs/source/release/11.6.0-notes.md +++ /dev/null @@ -1,73 +0,0 @@ -# CUDA Python 11.6.0 Release notes - -Released on Januray 12, 2022 - -## Highlights -- Support CUDA Toolkit 11.6 -- Support Profiler APIs -- Support Graphic APIs (EGL, GL, VDPAU) -- Support changing default stream -- Relaxed primitive interoperability - -### Default stream - -Changing default stream to Per-Thread-Default-Stream (PTDS) is done through environment variable before execution: - -```{code-block} shell -export CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1 -``` - -When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See [Stream Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html) for an explanation of the legacy and per-thread default streams. - -### Primitive interoperability - -APIs accepting classes that wrap a primitive value are now interoperable with the underlining value. - -Example 1: Structure member handles interoperability. - -```{code-block} python ->>> waitParams = cuda.CUstreamMemOpWaitValueParams_st() ->>> waitParams.value64 = 1 ->>> waitParams.value64 - ->>> waitParams.value64 = cuda.cuuint64_t(2) ->>> waitParams.value64 - -``` - -Example 2: Function signature handles interoperability. - -```{code-block} python ->>> cudart.cudaStreamQuery(cudart.cudaStreamNonBlocking) -(,) ->>> cudart.cudaStreamQuery(cudart.cudaStream_t(cudart.cudaStreamNonBlocking)) -(,) -``` - -## Limitations - -### CUDA Functions Not Supported in this Release - -- Symbol APIs - - cudaGraphExecMemcpyNodeSetParamsFromSymbol - - cudaGraphExecMemcpyNodeSetParamsToSymbol - - cudaGraphAddMemcpyNodeToSymbol - - cudaGraphAddMemcpyNodeFromSymbol - - cudaGraphMemcpyNodeSetParamsToSymbol - - cudaGraphMemcpyNodeSetParamsFromSymbol - - cudaMemcpyToSymbol - - cudaMemcpyFromSymbol - - cudaMemcpyToSymbolAsync - - cudaMemcpyFromSymbolAsync - - cudaGetSymbolAddress - - cudaGetSymbolSize - - cudaGetFuncBySymbol -- Launch Options - - cudaLaunchKernel - - cudaLaunchCooperativeKernel - - cudaLaunchCooperativeKernelMultiDevice -- cudaSetValidDevices -- cudaVDPAUSetVDPAUDevice - -```{note} Deprecated APIs are removed from tracking -``` diff --git a/cuda_bindings/docs/source/release/11.6.0-notes.rst b/cuda_bindings/docs/source/release/11.6.0-notes.rst new file mode 100644 index 000000000..d7907df84 --- /dev/null +++ b/cuda_bindings/docs/source/release/11.6.0-notes.rst @@ -0,0 +1,82 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.6.0 Release notes +================================ + +Released on Januray 12, 2022 + +Highlights +---------- +- Support CUDA Toolkit 11.6 +- Support Profiler APIs +- Support Graphic APIs (EGL, GL, VDPAU) +- Support changing default stream +- Relaxed primitive interoperability + +Default stream +^^^^^^^^^^^^^^ + +Changing default stream to Per-Thread-Default-Stream (PTDS) is done through environment variable before execution: + +.. code-block:: shell + + export CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1 + +When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See `Stream Synchronization Behavior `_ for an explanation of the legacy and per-thread default streams. + +Primitive interoperability +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +APIs accepting classes that wrap a primitive value are now interoperable with the underlining value. + +Example 1: Structure member handles interoperability. + +.. code-block:: python + + >>> waitParams = cuda.CUstreamMemOpWaitValueParams_st() + >>> waitParams.value64 = 1 + >>> waitParams.value64 + + >>> waitParams.value64 = cuda.cuuint64_t(2) + >>> waitParams.value64 + + +Example 2: Function signature handles interoperability. + +.. code-block:: python + + >>> cudart.cudaStreamQuery(cudart.cudaStreamNonBlocking) + (,) + >>> cudart.cudaStreamQuery(cudart.cudaStream_t(cudart.cudaStreamNonBlocking)) + (,) + +Limitations +----------- + +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice + +.. note:: Deprecated APIs are removed from tracking + diff --git a/cuda_bindings/docs/source/release/11.6.1-notes.md b/cuda_bindings/docs/source/release/11.6.1-notes.rst similarity index 66% rename from cuda_bindings/docs/source/release/11.6.1-notes.md rename to cuda_bindings/docs/source/release/11.6.1-notes.rst index ddd6ff510..f136c9422 100644 --- a/cuda_bindings/docs/source/release/11.6.1-notes.md +++ b/cuda_bindings/docs/source/release/11.6.1-notes.rst @@ -1,13 +1,20 @@ -# CUDA Python 11.6.1 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.6.1 Release notes +================================ Released on March 18, 2022 -## Highlights +Highlights +---------- - Fix string decomposition for WSL library load -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.7.0-notes.md b/cuda_bindings/docs/source/release/11.7.0-notes.rst similarity index 65% rename from cuda_bindings/docs/source/release/11.7.0-notes.md rename to cuda_bindings/docs/source/release/11.7.0-notes.rst index 22500c7a2..1f850c428 100644 --- a/cuda_bindings/docs/source/release/11.7.0-notes.md +++ b/cuda_bindings/docs/source/release/11.7.0-notes.rst @@ -1,13 +1,20 @@ -# CUDA Python 11.7.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.7.0 Release notes +================================ Released on May 11, 2022 -## Highlights +Highlights +---------- - Support CUDA Toolkit 11.7 -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.7.1-notes.md b/cuda_bindings/docs/source/release/11.7.1-notes.rst similarity index 64% rename from cuda_bindings/docs/source/release/11.7.1-notes.md rename to cuda_bindings/docs/source/release/11.7.1-notes.rst index 2997c9da5..0fbea248e 100644 --- a/cuda_bindings/docs/source/release/11.7.1-notes.md +++ b/cuda_bindings/docs/source/release/11.7.1-notes.rst @@ -1,20 +1,27 @@ -# CUDA Python 11.7.1 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.7.1 Release notes +================================ Released on June 29, 2022 -## Highlights +Highlights +---------- - Fix error propagation in CUDA Runtime bindings -- Resolves [issue #22](https://github.com/NVIDIA/cuda-python/issues/22) +- Resolves `issue #22 `_ -## Limitations +Limitations +----------- -### Source builds +Source builds +^^^^^^^^^^^^^ CUDA Python no longer re-declares CUDA types, instead it uses the types from CUDA C headers. As such source builds now need to access to latest CTK headers. In particular: 1. "$CUDA_HOME/include" has latest CTK headers 2. CTK headers have all types defined -(2) Certain CUDA types are not declared on mobile platforms and may face a "has not been declared" error during source builds. A temporary workaround is to use the headers found in [https://gitlab.com/nvidia/headers/cuda](https://gitlab.com/nvidia/headers/cuda). In particular CUDA Python needs the following headers and their dependencies: +(2) Certain CUDA types are not declared on mobile platforms and may face a "has not been declared" error during source builds. A temporary workaround is to use the headers found in `https://gitlab.com/nvidia/headers/cuda `_. In particular CUDA Python needs the following headers and their dependencies: - cuda.h - cudaProfiler.h - driver_types.h @@ -23,7 +30,8 @@ CUDA Python no longer re-declares CUDA types, instead it uses the types from CUD This a short-term limitation and will be relaxed in a future release. -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.0-notes.md b/cuda_bindings/docs/source/release/11.8.0-notes.rst similarity index 62% rename from cuda_bindings/docs/source/release/11.8.0-notes.md rename to cuda_bindings/docs/source/release/11.8.0-notes.rst index c5bf9f71c..e24022142 100644 --- a/cuda_bindings/docs/source/release/11.8.0-notes.md +++ b/cuda_bindings/docs/source/release/11.8.0-notes.rst @@ -1,22 +1,30 @@ -# CUDA Python 11.8.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.0 Release notes +================================ Released on October 3, 2022 -## Highlights +Highlights +---------- - Support CUDA Toolkit 11.8 - Source builds allow for missing types and APIs - Resolves source builds for mobile platforms -- Resolves [issue #24](https://github.com/NVIDIA/cuda-python/issues/24) +- Resolves `issue #24 `_ -### Source Builds +Source Builds +^^^^^^^^^^^^^ -CUDA Python source builds now parse CUDA headers located in $CUDA_HOME directory, enabling/disabling types and APIs if defined. Therefore this removes the need for CTK headers to have all types defined. By allowing minor variations, previous [11.7.1 mobile platform workaround](https://nvidia.github.io/cuda-python/release/11.7.1-notes.html#source-builds) is no longer needed. +CUDA Python source builds now parse CUDA headers located in $CUDA_HOME directory, enabling/disabling types and APIs if defined. Therefore this removes the need for CTK headers to have all types defined. By allowing minor variations, previous `11.7.1 mobile platform workaround `_ is no longer needed. It's still required that source builds use the latest CTK headers (i.e. “$CUDA_HOME/include” has latest CTK headers). -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.1-notes.md b/cuda_bindings/docs/source/release/11.8.1-notes.rst similarity index 61% rename from cuda_bindings/docs/source/release/11.8.1-notes.md rename to cuda_bindings/docs/source/release/11.8.1-notes.rst index f7c2e7d45..0df23c929 100644 --- a/cuda_bindings/docs/source/release/11.8.1-notes.md +++ b/cuda_bindings/docs/source/release/11.8.1-notes.rst @@ -1,14 +1,21 @@ -# CUDA Python 11.8.1 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.1 Release notes +================================ Released on November 4, 2022 -## Highlights -- Resolves [issue #27](https://github.com/NVIDIA/cuda-python/issues/27) +Highlights +---------- +- Resolves `issue #27 `_ - Update install instructions to use latest CTK -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.2-notes.md b/cuda_bindings/docs/source/release/11.8.2-notes.rst similarity index 65% rename from cuda_bindings/docs/source/release/11.8.2-notes.md rename to cuda_bindings/docs/source/release/11.8.2-notes.rst index f9d165565..ec9f0324e 100644 --- a/cuda_bindings/docs/source/release/11.8.2-notes.md +++ b/cuda_bindings/docs/source/release/11.8.2-notes.rst @@ -1,13 +1,20 @@ -# CUDA Python 11.8.2 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.2 Release notes +================================ Released on May 18, 2023 -## Highlights +Highlights +---------- - Open libcuda.so.1 instead of libcuda.so -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.3-notes.md b/cuda_bindings/docs/source/release/11.8.3-notes.rst similarity index 67% rename from cuda_bindings/docs/source/release/11.8.3-notes.md rename to cuda_bindings/docs/source/release/11.8.3-notes.rst index a8ff840c1..806f5eb1b 100644 --- a/cuda_bindings/docs/source/release/11.8.3-notes.md +++ b/cuda_bindings/docs/source/release/11.8.3-notes.rst @@ -1,15 +1,22 @@ -# CUDA Python 11.8.3 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.3 Release notes +================================ Released on October 23, 2023 -## Highlights +Highlights +---------- - Compatability with Cython 3 - New API cudart.getLocalRuntimeVersion() - Modernize build config -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.4-notes.md b/cuda_bindings/docs/source/release/11.8.4-notes.md deleted file mode 100644 index 13767998f..000000000 --- a/cuda_bindings/docs/source/release/11.8.4-notes.md +++ /dev/null @@ -1,54 +0,0 @@ -# CUDA Python 11.8.4 Release notes - -Released on October 7, 2024 - -## Highlights -- Resolve [Issue #89](https://github.com/NVIDIA/cuda-python/issues/89): Fix getLocalRuntimeVersion searching for wrong libcudart version -- Resolve [Issue #90](https://github.com/NVIDIA/cuda-python/issues/90): Use new layout in preperation for cuda-python becoming a metapackage - -## CUDA namespace cleanup with a new module layout - -[Issue #75](https://github.com/NVIDIA/cuda-python/issues/75) explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. - -Before this change, `cuda-python` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert `cuda-python` into a metapackage where we use `cuda` as a namespace with existing bindings code moved to a `cuda_bindings` subpackage. - -This patch release applies the new module layout for the bindings as follows: -- `cuda.cuda` -> `cuda.bindings.driver` -- `cuda.ccuda` -> `cuda.bindings.cydriver` -- `cuda.cudart` -> `cuda.bindings.runtime` -- `cuda.ccudart` -> `cuda.bindings.cyruntime` -- `cuda.nvrtc` -> `cuda.bindings.nvrtc` -- `cuda.cnvrtc` -> `cuda.bindings.cynvrtc` - -Deprecation warnings are turned on as a notice to switch to the new module layout. - -```{note} This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. -``` - -## Limitations - -### Know issues -- [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215) - -### CUDA Functions Not Supported in this Release - -- Symbol APIs - - cudaGraphExecMemcpyNodeSetParamsFromSymbol - - cudaGraphExecMemcpyNodeSetParamsToSymbol - - cudaGraphAddMemcpyNodeToSymbol - - cudaGraphAddMemcpyNodeFromSymbol - - cudaGraphMemcpyNodeSetParamsToSymbol - - cudaGraphMemcpyNodeSetParamsFromSymbol - - cudaMemcpyToSymbol - - cudaMemcpyFromSymbol - - cudaMemcpyToSymbolAsync - - cudaMemcpyFromSymbolAsync - - cudaGetSymbolAddress - - cudaGetSymbolSize - - cudaGetFuncBySymbol -- Launch Options - - cudaLaunchKernel - - cudaLaunchCooperativeKernel - - cudaLaunchCooperativeKernelMultiDevice -- cudaSetValidDevices -- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings/docs/source/release/11.8.4-notes.rst b/cuda_bindings/docs/source/release/11.8.4-notes.rst new file mode 100644 index 000000000..6bafd0b63 --- /dev/null +++ b/cuda_bindings/docs/source/release/11.8.4-notes.rst @@ -0,0 +1,62 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.4 Release notes +================================ + +Released on October 7, 2024 + +Highlights +---------- +- Resolve `Issue #89 `_: Fix getLocalRuntimeVersion searching for wrong libcudart version +- Resolve `Issue #90 `_: Use new layout in preperation for cuda-python becoming a metapackage + +CUDA namespace cleanup with a new module layout +----------------------------------------------- + +`Issue #75 `_ explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. + +Before this change, ``cuda-python`` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert ``cuda-python`` into a metapackage where we use ``cuda`` as a namespace with existing bindings code moved to a ``cuda_bindings`` subpackage. + +This patch release applies the new module layout for the bindings as follows: +- ``cuda.cuda`` -> ``cuda.bindings.driver`` +- ``cuda.ccuda`` -> ``cuda.bindings.cydriver`` +- ``cuda.cudart`` -> ``cuda.bindings.runtime`` +- ``cuda.ccudart`` -> ``cuda.bindings.cyruntime`` +- ``cuda.nvrtc`` -> ``cuda.bindings.nvrtc`` +- ``cuda.cnvrtc`` -> ``cuda.bindings.cynvrtc`` + +Deprecation warnings are turned on as a notice to switch to the new module layout. + +.. note:: This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. + +Limitations +----------- + +Know issues +^^^^^^^^^^^ +- `Issue #215 `_ + +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings/docs/source/release/11.8.5-notes.md b/cuda_bindings/docs/source/release/11.8.5-notes.rst similarity index 53% rename from cuda_bindings/docs/source/release/11.8.5-notes.md rename to cuda_bindings/docs/source/release/11.8.5-notes.rst index 37498b115..7580d468b 100644 --- a/cuda_bindings/docs/source/release/11.8.5-notes.md +++ b/cuda_bindings/docs/source/release/11.8.5-notes.rst @@ -1,15 +1,21 @@ -# CUDA Python 11.8.5 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. +CUDA Python 11.8.5 Release notes +================================ -## Highlights -- Resolve [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215): module `cuda.ccudart` has no attribute `__pyx_capi__` -- Resolve [Issue #226](https://github.com/NVIDIA/cuda-python/issues/226): top-level Cython source files not packaged +Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. +Highlights +---------- +- Resolve `Issue #215 `_: module ``cuda.ccudart`` has no attribute ``__pyx_capi__`` +- Resolve `Issue #226 `_: top-level Cython source files not packaged -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/11.8.6-notes.md b/cuda_bindings/docs/source/release/11.8.6-notes.md deleted file mode 100644 index cdbc82e3d..000000000 --- a/cuda_bindings/docs/source/release/11.8.6-notes.md +++ /dev/null @@ -1,29 +0,0 @@ -# `cuda-bindings` 11.8.6 Release notes - -Released on January 24, 2025. - - -## Highlights - -- Support Python 3.13 -- Add an optional dependency on the CUDA NVRTC wheel -- Enable discovery and loading of shared libraries from CUDA wheels -- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) - - -## Wheels support for optional dependencies - -Optional dependencies are added for packages: - -- nvidia-cuda-nvrtc-cu12 - -Installing these dependencies with `cuda-python` can be done using: -```{code-block} shell -pip install cuda-python[all] -``` -Same applies to `cuda-bindings`. - - -## Discovery and loading of shared library dependencies from wheels - -Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. diff --git a/cuda_bindings/docs/source/release/11.8.6-notes.rst b/cuda_bindings/docs/source/release/11.8.6-notes.rst new file mode 100644 index 000000000..9ab6db2d5 --- /dev/null +++ b/cuda_bindings/docs/source/release/11.8.6-notes.rst @@ -0,0 +1,35 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +``cuda-bindings`` 11.8.6 Release notes +==================================== + +Released on January 24, 2025. + +Highlights +---------- + +- Support Python 3.13 +- Add an optional dependency on the CUDA NVRTC wheel +- Enable discovery and loading of shared libraries from CUDA wheels +- ``cuda-python`` is now a meta package, currently depending only on ``cuda-bindings`` (`see RFC `_) + +Wheels support for optional dependencies +---------------------------------------- + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 + +Installing these dependencies with ``cuda-python`` can be done using: + +.. code-block:: shell + + pip install cuda-python[all] + +Same applies to ``cuda-bindings``. + +Discovery and loading of shared library dependencies from wheels +---------------------------------------------------------------- + +Shared library search paths for wheel builds are now extended to check site-packages. This allows ``cuda-python``/``cuda-bindings`` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. diff --git a/cuda_bindings/docs/source/release/12.0.0-notes.md b/cuda_bindings/docs/source/release/12.0.0-notes.rst similarity index 57% rename from cuda_bindings/docs/source/release/12.0.0-notes.md rename to cuda_bindings/docs/source/release/12.0.0-notes.rst index 9f2ae2587..b61741a24 100644 --- a/cuda_bindings/docs/source/release/12.0.0-notes.md +++ b/cuda_bindings/docs/source/release/12.0.0-notes.rst @@ -1,15 +1,22 @@ -# CUDA Python 12.0.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.0.0 Release notes +================================ Released on December 8, 2022 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.0 -- Fix example from [MR28](https://github.com/NVIDIA/cuda-python/pull/28) -- Apply [MR35](https://github.com/NVIDIA/cuda-python/pull/35) +- Fix example from `MR28 `_ +- Apply `MR35 `_ -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.1.0-notes.md b/cuda_bindings/docs/source/release/12.1.0-notes.rst similarity index 51% rename from cuda_bindings/docs/source/release/12.1.0-notes.md rename to cuda_bindings/docs/source/release/12.1.0-notes.rst index 94310bb51..161b4596c 100644 --- a/cuda_bindings/docs/source/release/12.1.0-notes.md +++ b/cuda_bindings/docs/source/release/12.1.0-notes.rst @@ -1,16 +1,23 @@ -# CUDA Python 12.1.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.1.0 Release notes +================================ Released on February 28, 2023 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.1 -- Resolve [Issue #41](https://github.com/NVIDIA/cuda-python/issues/41): Add support for Python 3.11 -- Resolve [Issue #42](https://github.com/NVIDIA/cuda-python/issues/42): Dropping Python 3.7 -- Resolve [Issue #43](https://github.com/NVIDIA/cuda-python/issues/43): Trim Conda package dependencies +- Resolve `Issue #41 `_: Add support for Python 3.11 +- Resolve `Issue #42 `_: Dropping Python 3.7 +- Resolve `Issue #43 `_: Trim Conda package dependencies -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.2.0-notes.md b/cuda_bindings/docs/source/release/12.2.0-notes.rst similarity index 53% rename from cuda_bindings/docs/source/release/12.2.0-notes.md rename to cuda_bindings/docs/source/release/12.2.0-notes.rst index 39e37b9a8..796aaa1e5 100644 --- a/cuda_bindings/docs/source/release/12.2.0-notes.md +++ b/cuda_bindings/docs/source/release/12.2.0-notes.rst @@ -1,15 +1,22 @@ -# CUDA Python 12.2.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.2.0 Release notes +================================ Released on June 28, 2023 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.2 -- Resolve [Issue #44](https://github.com/NVIDIA/cuda-python/issues/44): nogil must be at the end of the function signature line -- Resolve [Issue #45](https://github.com/NVIDIA/cuda-python/issues/45): Error with pyparsing when no CUDA is found +- Resolve `Issue #44 `_: nogil must be at the end of the function signature line +- Resolve `Issue #45 `_: Error with pyparsing when no CUDA is found -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.2.1-notes.md b/cuda_bindings/docs/source/release/12.2.1-notes.rst similarity index 65% rename from cuda_bindings/docs/source/release/12.2.1-notes.md rename to cuda_bindings/docs/source/release/12.2.1-notes.rst index 3a89af85c..3ccacdd30 100644 --- a/cuda_bindings/docs/source/release/12.2.1-notes.md +++ b/cuda_bindings/docs/source/release/12.2.1-notes.rst @@ -1,13 +1,20 @@ -# CUDA Python 12.2.1 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.2.1 Release notes +================================ Released on January 8, 2024 -## Highlights +Highlights +---------- - Compatibility with Cython 3 -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.3.0-notes.md b/cuda_bindings/docs/source/release/12.3.0-notes.md deleted file mode 100644 index 15bcdb978..000000000 --- a/cuda_bindings/docs/source/release/12.3.0-notes.md +++ /dev/null @@ -1,36 +0,0 @@ -# CUDA Python 12.3.0 Release notes - -Released on October 19, 2023 - -## Highlights -- Rebase to CUDA Toolkit 12.3 -- Resolve [Issue #16](https://github.com/NVIDIA/cuda-python/issues/16): cuda.cudart.cudaRuntimeGetVersion() hard-codes the runtime version, rather than querying the runtime - - New API cudart.getLocalRuntimeVersion() -- Resolve [Issue #48](https://github.com/NVIDIA/cuda-python/issues/48): Dropping Python 3.8 -- Resolve [Issue #51](https://github.com/NVIDIA/cuda-python/issues/51): Dropping package releases for ppc64 on PYPI and conda-nvidia channel - -## Limitations - -### CUDA Functions Not Supported in this Release - -- Symbol APIs - - cudaGraphExecMemcpyNodeSetParamsFromSymbol - - cudaGraphExecMemcpyNodeSetParamsToSymbol - - cudaGraphAddMemcpyNodeToSymbol - - cudaGraphAddMemcpyNodeFromSymbol - - cudaGraphMemcpyNodeSetParamsToSymbol - - cudaGraphMemcpyNodeSetParamsFromSymbol - - cudaMemcpyToSymbol - - cudaMemcpyFromSymbol - - cudaMemcpyToSymbolAsync - - cudaMemcpyFromSymbolAsync - - cudaGetSymbolAddress - - cudaGetSymbolSize - - cudaGetFuncBySymbol -- Launch Options - - cudaLaunchKernel - - cudaLaunchCooperativeKernel - - cudaLaunchCooperativeKernelMultiDevice -- cudaSetValidDevices -- cudaVDPAUSetVDPAUDevice -- cudaFuncGetName diff --git a/cuda_bindings/docs/source/release/12.3.0-notes.rst b/cuda_bindings/docs/source/release/12.3.0-notes.rst new file mode 100644 index 000000000..0a14aea9e --- /dev/null +++ b/cuda_bindings/docs/source/release/12.3.0-notes.rst @@ -0,0 +1,43 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.3.0 Release notes +================================ + +Released on October 19, 2023 + +Highlights +---------- +- Rebase to CUDA Toolkit 12.3 +- Resolve `Issue #16 `_: cuda.cudart.cudaRuntimeGetVersion() hard-codes the runtime version, rather than querying the runtime + - New API cudart.getLocalRuntimeVersion() +- Resolve `Issue #48 `_: Dropping Python 3.8 +- Resolve `Issue #51 `_: Dropping package releases for ppc64 on PYPI and conda-nvidia channel + +Limitations +----------- + +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName diff --git a/cuda_bindings/docs/source/release/12.4.0-notes.md b/cuda_bindings/docs/source/release/12.4.0-notes.rst similarity index 67% rename from cuda_bindings/docs/source/release/12.4.0-notes.md rename to cuda_bindings/docs/source/release/12.4.0-notes.rst index 191ecc644..b71a4ce7d 100644 --- a/cuda_bindings/docs/source/release/12.4.0-notes.md +++ b/cuda_bindings/docs/source/release/12.4.0-notes.rst @@ -1,14 +1,21 @@ -# CUDA Python 12.4.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.4.0 Release notes +================================ Released on March 5, 2024 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.4 - Add PyPI/Conda support for Python 12 -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.5.0-notes.md b/cuda_bindings/docs/source/release/12.5.0-notes.rst similarity index 60% rename from cuda_bindings/docs/source/release/12.5.0-notes.md rename to cuda_bindings/docs/source/release/12.5.0-notes.rst index b0e527a8a..0ac6a25ee 100644 --- a/cuda_bindings/docs/source/release/12.5.0-notes.md +++ b/cuda_bindings/docs/source/release/12.5.0-notes.rst @@ -1,14 +1,21 @@ -# CUDA Python 12.5.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.5.0 Release notes +================================ Released on May 21, 2024 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.5 -- Resolve [Issue #58](https://github.com/NVIDIA/cuda-python/issues/58): Interop between CUdeviceptr and Runtime +- Resolve `Issue #58 `_: Interop between CUdeviceptr and Runtime -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.6.0-notes.md b/cuda_bindings/docs/source/release/12.6.0-notes.rst similarity index 50% rename from cuda_bindings/docs/source/release/12.6.0-notes.md rename to cuda_bindings/docs/source/release/12.6.0-notes.rst index 466e2eec1..9cd5bbff5 100644 --- a/cuda_bindings/docs/source/release/12.6.0-notes.md +++ b/cuda_bindings/docs/source/release/12.6.0-notes.rst @@ -1,16 +1,23 @@ -# CUDA Python 12.6.0 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.6.0 Release notes +================================ Released on August 1, 2024 -## Highlights +Highlights +---------- - Rebase to CUDA Toolkit 12.6 -- Resolve [Issue #32](https://github.com/NVIDIA/cuda-python/issues/32): Add 'pywin32' as Windows requirement -- Resolve [Issue #72](https://github.com/NVIDIA/cuda-python/issues/72): Allow both lists and tuples as parameter -- Resolve [Issue #73](https://github.com/NVIDIA/cuda-python/issues/73): Fix 'cuLibraryLoadData' processing of parameters +- Resolve `Issue #32 `_: Add 'pywin32' as Windows requirement +- Resolve `Issue #72 `_: Allow both lists and tuples as parameter +- Resolve `Issue #73 `_: Fix 'cuLibraryLoadData' processing of parameters -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.6.1-notes.md b/cuda_bindings/docs/source/release/12.6.1-notes.md deleted file mode 100644 index 360047125..000000000 --- a/cuda_bindings/docs/source/release/12.6.1-notes.md +++ /dev/null @@ -1,56 +0,0 @@ -# CUDA Python 12.6.1 Release notes - -Released on October 7, 2024 - -## Highlights -- Resolve [Issue #90](https://github.com/NVIDIA/cuda-python/issues/90): Use new layout in preparation for cuda-python becoming a metapackage -- Resolve [Issue #75](https://github.com/NVIDIA/cuda-python/issues/75): CUDA namespace cleanup - -## CUDA namespace cleanup with a new module layout - -[Issue #75](https://github.com/NVIDIA/cuda-python/issues/75) explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. - -Before this change, `cuda-python` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert `cuda-python` into a metapackage where we use `cuda` as a namespace with existing bindings code moved to a `cuda_bindings` subpackage. - -This patch release applies the new module layout for the bindings as follows: -- `cuda.cuda` -> `cuda.bindings.driver` -- `cuda.ccuda` -> `cuda.bindings.cydriver` -- `cuda.cudart` -> `cuda.bindings.runtime` -- `cuda.ccudart` -> `cuda.bindings.cyruntime` -- `cuda.nvrtc` -> `cuda.bindings.nvrtc` -- `cuda.cnvrtc` -> `cuda.bindings.cynvrtc` - -Deprecation warnings are turned on as a notice to switch to the new module layout. - -```{note} This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. -``` - -## Limitations - -### Know issues -- [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215) - -### CUDA Functions Not Supported in this Release - -- Symbol APIs - - cudaGraphExecMemcpyNodeSetParamsFromSymbol - - cudaGraphExecMemcpyNodeSetParamsToSymbol - - cudaGraphAddMemcpyNodeToSymbol - - cudaGraphAddMemcpyNodeFromSymbol - - cudaGraphMemcpyNodeSetParamsToSymbol - - cudaGraphMemcpyNodeSetParamsFromSymbol - - cudaMemcpyToSymbol - - cudaMemcpyFromSymbol - - cudaMemcpyToSymbolAsync - - cudaMemcpyFromSymbolAsync - - cudaGetSymbolAddress - - cudaGetSymbolSize - - cudaGetFuncBySymbol -- Launch Options - - cudaLaunchKernel - - cudaLaunchCooperativeKernel - - cudaLaunchCooperativeKernelMultiDevice -- cudaSetValidDevices -- cudaVDPAUSetVDPAUDevice -- cudaFuncGetName -- cudaFuncGetParamInfo diff --git a/cuda_bindings/docs/source/release/12.6.1-notes.rst b/cuda_bindings/docs/source/release/12.6.1-notes.rst new file mode 100644 index 000000000..257163344 --- /dev/null +++ b/cuda_bindings/docs/source/release/12.6.1-notes.rst @@ -0,0 +1,64 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.6.1 Release notes +================================ + +Released on October 7, 2024 + +Highlights +---------- +- Resolve `Issue #90 `_: Use new layout in preparation for cuda-python becoming a metapackage +- Resolve `Issue #75 `_: CUDA namespace cleanup + +CUDA namespace cleanup with a new module layout +----------------------------------------------- + +`Issue #75 `_ explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. + +Before this change, ``cuda-python`` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert ``cuda-python`` into a metapackage where we use ``cuda`` as a namespace with existing bindings code moved to a ``cuda_bindings`` subpackage. + +This patch release applies the new module layout for the bindings as follows: +- ``cuda.cuda`` -> ``cuda.bindings.driver`` +- ``cuda.ccuda`` -> ``cuda.bindings.cydriver`` +- ``cuda.cudart`` -> ``cuda.bindings.runtime`` +- ``cuda.ccudart`` -> ``cuda.bindings.cyruntime`` +- ``cuda.nvrtc`` -> ``cuda.bindings.nvrtc`` +- ``cuda.cnvrtc`` -> ``cuda.bindings.cynvrtc`` + +Deprecation warnings are turned on as a notice to switch to the new module layout. + +.. note:: This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. + +Limitations +----------- + +Know issues +^^^^^^^^^^^ +- `Issue #215 `_ + +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings/docs/source/release/12.6.2-notes.md b/cuda_bindings/docs/source/release/12.6.2-notes.rst similarity index 54% rename from cuda_bindings/docs/source/release/12.6.2-notes.md rename to cuda_bindings/docs/source/release/12.6.2-notes.rst index 938b9f5a6..4ce87dd8b 100644 --- a/cuda_bindings/docs/source/release/12.6.2-notes.md +++ b/cuda_bindings/docs/source/release/12.6.2-notes.rst @@ -1,15 +1,21 @@ -# CUDA Python 12.6.2 Release notes +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. +CUDA Python 12.6.2 Release notes +================================ -## Highlights -- Resolve [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215): module `cuda.ccudart` has no attribute `__pyx_capi__` -- Resolve [Issue #226](https://github.com/NVIDIA/cuda-python/issues/226): top-level Cython source files not packaged +Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. +Highlights +---------- +- Resolve `Issue #215 `_: module ``cuda.ccudart`` has no attribute ``__pyx_capi__`` +- Resolve `Issue #226 `_: top-level Cython source files not packaged -## Limitations +Limitations +----------- -### CUDA Functions Not Supported in this Release +CUDA Functions Not Supported in this Release +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Symbol APIs - cudaGraphExecMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings/docs/source/release/12.8.0-notes.md b/cuda_bindings/docs/source/release/12.8.0-notes.md deleted file mode 100644 index c93f2d9df..000000000 --- a/cuda_bindings/docs/source/release/12.8.0-notes.md +++ /dev/null @@ -1,36 +0,0 @@ -# `cuda-bindings` 12.8.0 Release notes - -Released on January 24, 2025. - - -## Highlights - -- Support Python 3.13 -- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) -- Add optional dependencies on CUDA NVRTC and nvJitLink wheels -- Enable discovery and loading of shared libraries from CUDA wheels -- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) - - -## Wheels support for optional dependencies - -Optional dependencies are added for packages: - -- nvidia-cuda-nvrtc-cu12 -- nvidia-nvjitlink-cu12 - -Installing these dependencies with `cuda-python` can be done using: -```{code-block} shell -pip install cuda-python[all] -``` -Same applies to `cuda-bindings`. - - -## Discovery and loading of shared library dependencies from wheels - -Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. - - -## Known issues - -- Updating from older versions (v12.6.2.post1 and below) via `pip install -U cuda-python` might not work. Please do a clean re-installation by uninstalling `pip uninstall -y cuda-python` followed by installing `pip install cuda-python`. diff --git a/cuda_bindings/docs/source/release/12.8.0-notes.rst b/cuda_bindings/docs/source/release/12.8.0-notes.rst new file mode 100644 index 000000000..6c9c95177 --- /dev/null +++ b/cuda_bindings/docs/source/release/12.8.0-notes.rst @@ -0,0 +1,42 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +``cuda-bindings`` 12.8.0 Release notes +==================================== + +Released on January 24, 2025. + +Highlights +---------- + +- Support Python 3.13 +- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) +- Add optional dependencies on CUDA NVRTC and nvJitLink wheels +- Enable discovery and loading of shared libraries from CUDA wheels +- ``cuda-python`` is now a meta package, currently depending only on ``cuda-bindings`` (`see RFC `_) + +Wheels support for optional dependencies +---------------------------------------- + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 +- nvidia-nvjitlink-cu12 + +Installing these dependencies with ``cuda-python`` can be done using: + +.. code-block:: shell + + pip install cuda-python[all] + +Same applies to ``cuda-bindings``. + +Discovery and loading of shared library dependencies from wheels +---------------------------------------------------------------- + +Shared library search paths for wheel builds are now extended to check site-packages. This allows ``cuda-python``/``cuda-bindings`` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. + +Known issues +------------ + +- Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/docs/source/tips_and_tricks.rst b/cuda_bindings/docs/source/tips_and_tricks.rst index 97f585f9b..cc666ca27 100644 --- a/cuda_bindings/docs/source/tips_and_tricks.rst +++ b/cuda_bindings/docs/source/tips_and_tricks.rst @@ -7,16 +7,16 @@ Tips and Tricks Getting the address of underlying C objects from the low-level bindings ======================================================================= -All CUDA C types are exposed to Python as Python classes. For example, the :class:`~cuda.bindings.driver.CUstream` type is exposed as a class with methods :meth:`~cuda.bindings.driver.CUstream.getPtr()` and :meth:`~cuda.bindings.driver.CUstream.__int__()` implemented. - -There is an important distinction between the ``getPtr()`` method and the behaviour of ``__int__()``. Since a ``CUstream`` is itself just a pointer, calling ``instance_of_CUstream.getPtr()`` returns the pointer *to* the pointer, instead of the value of the ``CUstream`` C object that is the pointer to the underlying stream handle. ``int(instance_of_CUstream)`` returns the value of the ``CUstream`` converted to a Python int and is the actual address of the underlying handle. - .. warning:: Using ``int(cuda_obj)`` to retrieve the underlying address of a CUDA object is deprecated and subject to future removal. Please switch to use :func:`~cuda.bindings.utils.get_cuda_native_handle` instead. +All CUDA C types are exposed to Python as Python classes. For example, the :class:`~cuda.bindings.driver.CUstream` type is exposed as a class with methods :meth:`~cuda.bindings.driver.CUstream.getPtr()` and :meth:`~cuda.bindings.driver.CUstream.__int__()` implemented. + +There is an important distinction between the ``getPtr()`` method and the behaviour of ``__int__()``. Since a ``CUstream`` is itself just a pointer, calling ``instance_of_CUstream.getPtr()`` returns the pointer *to* the pointer, instead of the value of the ``CUstream`` C object that is the pointer to the underlying stream handle. ``int(instance_of_CUstream)`` returns the value of the ``CUstream`` converted to a Python int and is the actual address of the underlying handle. + Lifetime management of the CUDA objects ======================================= diff --git a/cuda_core/docs/source/_static/logo-dark-mode.png b/cuda_core/docs/source/_static/logo-dark-mode.png deleted file mode 100644 index 6b005a283ba6b7299a08cda1d37ceac8f693f535..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50546 zcmeFZc|6qp_dom^CRB_S$BWKTk5o3U?0!d0QgQe;a?B}=kzlZr~3 zk!;zC8IdLXexK>{{e16!_kZ`l_npUeJ?b(uXI`(fJkL4LbKcj#r;PPjS$4A^gjn^D zA2mUUJqw{NUQ7(|o8SW8CHRBc^SA{LA+c?=e=&DBw+#vyqQOIB2{I6&H^_%~y;%`j-R}=rg z1&T2(Lxi+-qhkCk2J6DE$Fv{#6GBfNq@k|g;`9#3k=BCn#o=!qbG<)0+~zks8b-{m z-~S1~#K(t{V1Vp;p7|3gV|k@kZB*sQ$I5@(Fqty(L4mn{ytVNX7f8)`d0=GK&9rt( z^z=7B`mq06g7)VU6YXoC?|fa{89;A#c>cg@XvxfiCpz=>&pfeo0NzD>{crO)*-!rH z+kqgMYya;L(eGa}2C-d`m#~Zp7P`Uw!*OKZ&insJAv7E~CHz`t)7!;+#qDyXoWTEn z8lizqTI%4wckN9CuGUfhQ1AHGKVK!#UR67o>g{fF$WMN2>x~YfKVH^er@hSQ#B#{8 z_4mNdOHrV9Ta$`rmPIzL{`(bRuldjd`+rAN_gwo;WzXo&C;N zEF^nI?ARajPzOyfF@A#;p4`4CZvEj)XgWj$j|K{{&rX%;-m(!HQds}=r_5;{+RL7A zb3N6e>e%zA%xQVrOB_d^5TADltq)3kb2+JO$^FMW2ukpV%=7iQ0gn}#s2E<6hbMGa zxW7;+H_JDHKIA-a?`is~YC#mod z9z+O|V-`T=RW3gQ_(EIg&$?e{ZF)78_U24G1`WiR^>6Yvdi|U|vj6eRs=?@3UaMBR zAo<=Hqb&~@F@=e)OC@!S@swDr>s{~05mAF=F;HCa{K77T%xOiW-$5g+<~2UE@T+50 zydoDkvcaV`$ub2zW*6rDlwRH_F2Bpu@zRH{v8eN8?u7rx4b~(?5UAP_WqrLPxuw!v z04=4qb9rv<6K6nnv0&!%3JJ}{IirE;x8V9j?&_d;N6x1tkMn+SRL`|47+C}e(fO!Y z&|TIrdub^PvgkAF_B+hmd%5A8*%9NRIENyZo?DCmV$jl6nl$EcF`{FE{K_laBu|I^ z2zd(3y53l39pCjN)$X;@w!xa(l;u9U)S(Ak(1xssGTs4lr zv3+?jLO5CkJbOz)8LfV&MIOeqU=V@tqibxJ!np8biOV9gnpClB%DF>IJSHE;JLOrC z@|;gtHTzfVReEjR1~0c4bbe%G%58)=I5}xWyeBLB$psJ-z| z-$_YugYrbh(EdlEd-@Z`vP;zWGw)<8mL>M3?bqS1)?-0sRSSOW>}b`oe2WeEV^11f zb1BIpcrsR;AoW}ST2%EA^^;0DT2&Hhn_X3R_v-mdZOtS#y(&O@J)BPlL2E;vi zTQSIgJj?(#rM`|Vtd~wa+Ksx)(;ebsmc4JN@Y6v|#@$W|Q%^P#*%Mya5%a!P!Et2Q zmm7X(GtFd-#-e=~5dTns#TkvdfX%Hz2%Tcgvh!Vd1Z_`n_I6b??VfD;s7ZQ~(~BL0 zCs z!b6Ub*1@RJx@2b?Gdh%Oa(-i`x|*kU|J1(=7-Z*APvkG(X!;2L2qz_GFsZ&Qu3p1k zo}1d#>a|EB%iYVy#Kia)DcTw7(s4LLY@TdQNPJi|B{Y?tmiqXE$NN{xN;xs*&m&dd ztMN5tl?Zyq@W(gx|D+!Xx_PLkoJvDWnQ|`%@y@%gR0z#f$N?)r{OQFxUUS5zfcw!)-?-|J;CPuBl!G*Mo zU5j>T`RVf%wA;bg<>SxZF)z=bWX&sy`=+m?%C3jDa=SEd`c;D8k z?b#EpS|4u=wNB2|o16rSxoWmb;nz}^l$WFVy@pM*EYblc5i<9JQ0Cnb0tW~;O)$A+ zI-tGKgHVh{K4LqGdD8MuGjxG9isM?v5l#S*!vWdFP<6<6wxsA_}*&2GvcbSmf0bxAijgcEF z^k&+(C?mZY)AV!o;KtBFr{y)LSuKRfUshklIXC;y!mK8#op%S6^qc~J!qcWkg zu)%+L-aw+^vY<@@s6NK2w*@nhm2luW9k-W@1R@gQnwbvulq2tFn9?ZYDlfgKc|4Ac zH8f}DQ8PMbiX?G^_a~5#kPA2S|kk&nVo^FgYo}SR)(3rH9aTLI1P!IAzra(QF``%-T zWRo3q$_C)j7ojSc001HN`x$7*8b}l$;zdM%nhNdfDZL!OaxRfLXM!tsJ+G-sAI4Yc zp4XgxBmzMqHT8lmLr^9tej@qEwX>7@%-@uZ&X|GA!O7GUOo9teA6)f9h@R^(BY}ZA zLrGTe?f91v-t!{2`YJ|dKh*++6L$7n7)qR+Q4XH8_OUGxj_f-a&GPhq#gpIn>|{rT zjL!J%OHUK-=`d$sCzFkeg=cfTwdkxa^+2`m(UG3WGvEvR!s;BkUU z(mKIH1v$s8v!$Fe&=2*)Al_(WDms;AtC}Is{j{$@fK+@(TV3yM$k;7SDZN!d%_HaV zV0I0OJ=WyvRQLB;8i7#{#5lepPJe{NK`(g zKUF0zmRWRYCqh@rP=QH$RlEzX&}GKVrHuKr+1?#$5m?Vx3+&FPyzjuB$dZDdi#!nY zH10rZOG~LkI-lgQU&4YToMXY}NK*8p9q8+&<oKqJdSU;@OqfI~T9dra*EXiViMI!Zs^N9}i3&zI30=8YwyN?NS8p$7TAy*Q(4GA8{sq;a=Yn zzjX`P|NQMCuj!sDYUN8V{Q4*2Am04P8wDdxJv2aGDf^UEM$8^X^)|V%)eIgpGyUBnYRo8b!VXr zLEJx?KYc{R+Y=Qn$~^lJ+NKS$?)wTWb&WKBXIQUe7QAVRS#o;+&Axx&ixJ^ij>+|W zsua1abkj+fS&q#je5)ZMq^NgqM+4L;5wT4B_EX^W91xZQR_^k)?x*Xc?2T%DG_=M7 z+1j{{c_idR0jhn~L|rvgENAJ!RK)try5=nW(}}Af2nErh>5M61=Ohg^MA%qA$&BpO zKxO{?pA4U!z6SVnm_mL)X_8J)c3K(<^u1TJrHPV|Y>4GIfdb^bmuyZo)BBJQuAS^# z1{QzcuPWK(mx7Ua4zgpfufh+h)Ze#4g!C~mF<*I)h_$;{d`ytCr^QwN%Jd`bCP#Z@ z%gSYwgURUkWf?S*O(s81tI(~5;N+6BDNbU}ea}H_iG~Z{j<;*rDj`aqfqTgUcAIy7 znK50eW|IY{Gh9-aV#JGHlM6ia+Y29v4Cx*ME130Z2&hK)2b$2u4G6gkTAigs3a`XZ z<>_EL?@aAd9X<^H7sm`a*&u0>BIfp(U%D}VdO44uT(YB{YSh9_OUplN&Ty=^S{-hm z!DV52gMv+`8f?K#W>l(9HRT@8VdY!LKCw;^m(HFki zx9#`U+WS;|v{n=HuN8XIB^+tNph-In4;ZphG&ue2 zu$)S0B&pb&NQT-&=|7P#UzrgCA<#F!GHQV|XM5$I(;@N?wOc}}$d#)-=Zws4ETSgR z&Qt$oy*kq9u4s)FNuD`_zV7y6-Wp~IXUJ@vM>lz=0@q*4e$MCrG8KmBTW4#HdN1zfRO&1J6ABu@?BIk=3jDT_k!$jR$qCz5XBbtZvt2Ed3Q+ z@owFFHrx0GUKifKdyu$X7f>*sT*O|Tyj33&Y`Wmvk3`~jMMgmjp2i8`)o)(;z3+`q zr6}AZ=s2er&+lvW3Y)?$F0nn>dU~g#X1ylkkwQ)IksEM` z>LR?BtbOqmQ$2;qNlQkf=?2pMTg4Lrgd|6a%l#ErdA1E2sRzmyUSHdbh-hLfnm$=8 z#e4H$Cqe?WW4wdR=#STOvaP3Rv!=_I?W?EyRHlpClH{-D>qDg1Oh|3q_p1n1IsU%= z4wnK+7sTwtwqTZcf?RICtz<%(qKBzy+m!c>fU(f@vkvD#PAteNw{@@Gei`zl#BYsA zni_zUunKsF%lex{j4lJF9TSORBla)F+3kZ$5@?eZp-47jp-kCv!$q9ZiAgEFxB5%` zx#rhnR(}cTIObCt7mq6wS!mV0rbNt!p6a0QN1el^>E{wNugHi%BHat(!a9#Qocer; z9^nr&2@r&>-R1S(YVg~AI}@k3wDtF45Nc1PQfA`}8}Xt%F2Lr^4oT7_H+_%)fFdc*K?F}CHT zB(OPW|4}iYKbYoOb*Uijh4O=5O`I0gzB+g$G8Dwr;YXMKGHe?nV*q5LiXurqTKye2 zK+eBAIQ^_!#*2d+snR+y7b~=?oO-75kSjFbd!Wu^x^G<^U7`;5Jtt4_;Gz^ za|^H-E#dm-UHQq1ZW=D_6sgw*vb1^oVa80u%8V%)fS1t9bbwEgf}{k@DV&C$P36N?cc>;VPfrlq{0a=n;>ps5L*@r;OQ&?9quLO)7^l1Gcz>~ZeR|*v zL|GK=Qn5|amwHKli3OBTdzyaVt zY^b|J&sS>HdNCcS%!44tt5f!>5){dj2))t=2Yd_;*qD9elu4|0HPnZop&eV6w!-C# zgFVs?1HX)vmqJ=}W}!_sjnLfHpLgh-q)scXZyCslx&;t0&_89Iv!hOwe(t9}^FW=| zMHWQxZfY%g`BEsww(;@4DWAHYPtQxr0YTio zu9Khcfh!)B%=vWH4;#k1T5TP7MU2S1`x`XkDENI%g17f=c5S~qTm%X|$`rrLg~$G?0sWkv?qO*d`eEy(+!CcApC~55;!l=dzLXmsFLXAJ!Bf z?BE>pKG<(I_bEN^5X6aSg2`m7LK=gN&Vmd>wY{eEgEwy=Q#gd7%;ze-Rq|`yxJVp4 zGAB*5;CZm1Wc26iyxE@59vdgi^fwy>5C5o(YHiC8BSE!qO&XNb5g?7Y+^BtCmGZ6!_~AcG{y|6QL_K@dm1QCJmHqG-q!< z=D26mCObH{oUA&2ukQ)8W&g(9HPn9Q&j8TnU5+3_b#`coJm%aSXjN#=*|BOM;7#C& znu8Jo*?P<7Jg7Fryn3E+r+!(+zkuTTR2XR=goK%UeUei3F>6(2DoBPhV#{)PYN8{5 z?C@A`rLFsIAKilC`&B(d7o{O!C!Qu8IN7T394nwdh=c_nFq&pvscl5aO!(#&a_J-N zKmZ0&Z$koWBd-UatB+e7Q#q0KCZHtpOI1?Rluq*1uQLyf+To(axOCB4TRP>GTN%loA-;V0mg}!p}h)7c?|LOb6?J0 zQvy3qUJPlA(qw-f*@;uWSkBW+;#8gLNjCb+S`Ioa|%&|@%rDJ(k8e!njAND6xK5iqN;^7{o@!osM# zSZ-Vh#Wy`I55U-G6&h7L55s*6dldT?ZXH1(Z=Kv~dxkG7U~`Oc@7l4FcqGYz}b%}j;}Rj^S_XHa}Y`}ly?_%%*^1vX_lr8 zu4oiUKMhFs6PL$+JiANPv`Hemm|dUDc>W4YYT{DoQKb|lX|L>vKlMU8aDCEHJSZ;2 z{nxKgOSI8JsX|ZqbC;BAC!fn?LvFca$5P)of!aFVY9@lYwfQ2Q$7g>vX`NY2aiW#2 zl>p?0H^lZ@9+vZ!eKKxg=S6V3yphwb68wIie>qt@&@Az?hAdBo=i0$x3qa9Qh099# zXpEWw$$%jLr6dphxH~`Dx(9noX%=7dOLp@_Z#sZ#raPS8&3&v-Qn@TXSflaLYCs+7 z%g9c@*SOMYX{##i7lF0>GnG9Lt=!otX4BP7wBpusw->2V%`Ag|&)eXRvUA{+g_juQ zPM*21ZgeIt#(YCXN`Ky}njW1}0cce$#$Vo<&`WY*e%I20n^W}P;8%T9NZ;G?+>hsI z!H|l|wXJ;MELXPq4gBcN(q7?%6l6{6r6mlvO&e2#qDi`3|8%p6AJrSfn+?U#e>2il z@vj)aA3Gm?5KvZ`PC3-kWlr@cES1^ke%4ye)fbW8^AFMie_^*>)MmnED(gr+7cXD$ zZ%5&4)4|6eWGC{+C9@{3pAzm_6#LPYQKxuL1y7^n4Oz)Z$Tr$`KLfS$$%>QXWr;D#h&r zlIbyJf>!@6gp}=`eyK{heE;tA`CqTYGAheoaiL5Tn*1T4(IcG~!C=FrCU5&U8vON- zPIutGkBDrupHuDG(h?u`k2*WJ@yBBmQIm3Z(fl7rlpHRYU3*M}OXbK}F*JH{W9TGL zS|uvk^}*%<(oTc8UV15Z!u8A*!R5d>eN^*-vKJak+sbsU=&gLzNV!1M$)+4R{!Mj% zpehI@H%q5}ggiT`&zvb$072;asVdQKr?v*}CD&QX$c@b~bzqCu!U5DWN+U1dNZ#nJ z-v3(hTcGjih)P9}8TGzg;Gy*7CVSI8SEg}}^bBk$ z%_{fIWJ*dW)W=^#ZEhDLQd4Fd9<2+er=liuZ*@_SnzGyoZK;q++_JsK7%9-!I&#$tXVl51ecZiSvl{spTIU z&$OUmU%a?8eX6u(A4XdZ=UXsdAVyd%IP~tW4`bTY_KS{4*-hYZh)sXhF*b^t+`eK<#wZcD;YO-D2fl3g)(QavUQyU%42P?7g}($Hd@E3-x0 zL+!8p?EFf>Oz)0HYHvVXA;l=tscQL<8{pCI%{{C0RTHbb=aXw#>zuySt0k4}B5vH_ zIx8MFq&0vvI?q=vs$tbp>t&Nvn4x_7ZHSX60l_S0^cj5n|gySd@|` z#{w$MqlOzoY#KCx^hkZ|vN0mq|87{j^~T~Zwp+&n8A5s*~j1}gzEIfG`U#-UW<4!{6*r8hi zyHL{9(JXvk0j9ykK!3DXGGxJT*LbO7=ShbDQD;$PE7pB+RytDOniM{*GI5bPJ8bKf zLJgfcmWE&&O5sPYG|qW0Jz!;RUmk7~?@N1xJwme8+$`;?+CtEpVqV*A;CEVJff=pb zO~^D@zPqX6T5>F1E$BM9B=mIyRZTyG_B9)>hGNN5!3>e4L0(9dGfb`*+d6y7mOuM# zcnxbrLz%6eyy3aj6U62ku$yX;64JBId5iZvO?6EG(tVDhxYGh|@49xP*`K+}rQR|7Ae?yUj?GnFaNo30tPYwt62r6Uzyg#-j)&~(VYhRd~ci%d>Yl1xd{3IBG zHBQAt%+xvMNEa&XOD7oqm`>k9P8S!;#a)?yS9jFxonko?9UAb5c)DsyR}N?)MzA4u zDs5zWS3aCN#=aV*b2Ihxm_!Ob&oyF#?TIp`$j&1q|Y-K)t30*|f9r zt2GpZU)>yo$y_*YW3L288W-cY4^s3(%296EWtkdOu`+3FR2HN!lnL7Hb3W+G+_Ohl z3ZHC4p8Udi0>;Yywg{HYJ}p8B{p4>Oaku_1S;e|VDH+?sE;!7#6N9#W2Dz6C>Ceer zB>0Mn$t}{MjM>pUszLPCh7#{q`0Q$yzdkshQN3_2plM3()$4b#wZaJaPVIp@nQ3^> zAn-nU+p6N`%LZW_Bo`-^JFfj*5!*7(+iwB+xFJVMHBA0XxYU&HdP|lEqLUl7LBu}P zSAupYf&ndkq)7(d4LFxNPBg#^4kBQA*df%avwtkGRH9_oJmbg`e^jZ}nwQDHMobR{ zwQ9FORpH;wEl^umz^brOv)$)?xX$bj5IXRtpEL^)ztqd*>PdK^;%7N_-Z{JO)s4_R zA84btf;QM{#+ZIO28Gd4SL5fo6hp#eXw55Wko*n~952`(0epAx)~gnLzpN!3_fX@< zh3p{5;z@lqDmk0oTIn_sZ*ik0ur5C`=TNEQo>R^(VeX*5gS zS86k>?Ap%6qYItONhX0zQ4c!m#7PuV=d~dXoG$&+-Eoys&(+PHw9|IiA4BNq+r@mR z_9%6Bh0)l>jlE*j&Jcr+y%{MiesogTo+_dJx_5#;@S7{^T{j;8J zzrW)Ie8=|6!-57VBtt$O*fRUOJpNC{ResI$yKmZN2(8RGSavcYLJY@IihbeLk;;}i zrBEkRYSNp`pD#;+sM?>kKL}f$n1G0DUALPTuO-hXl$;eMJ>BXDH6GABJYYN*OTt)FR@Xz z%AMW90+Xp3t|6g_yx_Miu@?2#!8-jchFIMdUOlXO*=+Js=Q#!#41nRXX@)yEcly`- zenRd1l8uac;c0B%rTb-DS~|pH+)w;I>s(QPGsEgE%NcwF#y0nQ2^Qh)m`^RUGEbdH zg2Q2@P=`mCf<*-!)ycpMlv4_B0G7G-qm+_jhup{Y=epfL4t#*_UBF!z60? zgtb!BR%S06n3~O598|60FARk$O~%{h>bx`}8Ux<$7TNE&4}*6I!pqjFvj=1s$u)ZO zEsiX-zUWa2#r7(#_B-v5pg!MzRLfU=D`fELUaq6bUj&+*h5M4pEic6NnZd7xq28Nw zVit1ZX=km`Ec;Bqq!bkEqxwVb(*{lyC^kcG3@Q}|Z$bhO*~JO&ZtO~FXUJi&Dizob>-Y5*4>nHx+8b(s}+b%*xk0e9MQ z>`2d8w{l>siiTc@aG>Nr1odf$DTU@EXEv8C>YAA*x{!7jB<#oFCaKww4?4D%mmkB=qj8 zTW>t}UsLw1qjjiWbv+ksM$az2aLn(h3DO{?tI)o0SUTGMrNK?ucVJ)8Q!HH_Dl7~powRMV=2)MenP8NMCQ?8qdQXj{jxCM7O<8<|9X*ROnM04f zG-edC`g*!(Vk(@SR{Io6gUVQ>b*yFIHF9a&`kfdL4SjI>DkW@|KVGJ}zv__`bH5eo zc7c=595?erLA7)z2e`yFp%vb!9}A~-#QEEk6NpYRD%_}Zq)IEghHe~6Dg3GYw!!2P z>G7P2Z0D<60WnJfR!;50%tTd3*^p7iuvmrpzEfTNA&oJP!JC#gpxrzbx` zz2*oTV~Y>5y?j4vnuLiP)XyCXjAhL^NITUvoFDXT!^nFE?C2P#MQg&p>M{uo*wInj zIJ9j&PV~o)S$}uzNslBc&A(8qoSq;?`kf1Vtn9m=9?2DoT^wDH>f>$ol(UZdl!dgr zAG`bt%JoqrI^%}&SlaRpFI(QNUOAg$|AHPBa)SBjfy9n3bZ5nqJ9YuFktyERc{WaP z5I5|rB@x*Y{ZCA7U-7HpbDjg0dH_XHPxu1+k5#WV32Qst8;05;nhrG=+uHTA$#Dgp zY8Rb)X*FpmY9)t3g{&a_>VC|AK8wbti0bDzDLaG#Yt2~)XLmp1I3@_Qh(OY9p_Qy* zWm^4BBqzy;^j)F4oFF|T^YkvK%z@XPLYd1xI&5{q7G?C?h<#_;#&1`AsXLTB|LRRe zFe0!*$HK2&M!o!9?9}^?#$vg_s9}Xjl54^c=dp~$3xGo78b>0i(Q(84Y@8T$^KN*seMu3>|fdKN0s6rS_tk`YraDqm(~5= zh7Ua6E9M+14Gs1apNNvf8CD`&?lC?+y%po(njO_?%Ye+2IaG-aPy;``idH%riko(n z-WDDD9ueuTE=yve=NPb#b!t#%fQnAlZ%%@Bg%Ud7@}`ysAbG$EX&SYDUpt(UHyCa& zy~;cKT6Kh>{g}#w7cL))VOEd_yHIvVK;tUbB*kz|wImo++Hd#WD%(+9)RhJNQcG{Z zHoEHPAsyxi1=d1ne8aGp^YzaSvw1AmUdIbr^_f#fRt1qiyUrY2#R(SPd&>nTO&;9R zo}AAPu_NLwNLz{`1RDWiTZalopo7K&<18d9ed~IH8$>yd+Ujy0)xvM1c-{hoo@Fz_ zn0g;CWR}_LeD+9m6^1a}v8|nTeI|d)&5xSL(o$Sf21L%1)Dbb4CRON_W!iqi##m9X zQj(I_dAjE}2Q3PHx22B*hpoh~8ik`ZvD+H6o@yqV99y@t4PLRtnC+azcVmW)J} zM=h>)va8tp!HC+&MOZZP=im2)r_X6cg!gnA#Ek*U46DqtY@)~4Yo19vZ{@J0ks~aV z`9E^6gIrO;L6U7i_PPATRWzv4Gpp$#1NoR6m_#g~LZXSh$YFIEon*o{f$(El0 zk4jtT`HK%s^F&b7ELHVaHCIwz1?v?}RSH?aHrdTadvDdkh;Y zz_+}n$Mvt1@{6lmxwKD87WMJlZTrO>K@Is_Ac4PATKiHFcyA4uoyNarH+2-vlNp&q$n!?lfkIu1rJq1maS3qwnc(T{ z(Oe`>_?&`m=}vdBo-X>e_H5hg3-)?;z^pZ)N5_<=l0XY4AM;r3jIrpM{ZuAt8 z@V@E8Fa}7sb($StnVp~oz(hkctiY@_Kj$LTGoq@y2?NUY5~GI^p}+7m$~^Y@$k|GF zs(<`pB|J#g?f_pe9nKtOOX3i!D==cgd?@)oZh_K{?47kroE_J2JLYkKB>5)aLHQ{l zb(m$g6sF-IH>_33G14JZ&T_g;Nmc%HFDM7wx*EH8%>MVBN5x6K%J>C7Iw-+N-qlv>8H%C8U*FKSdbS_cB$tD(}>0L<6FEt!e{8rv1@; zi~_BFu5AK1A#{qzDI4X|3Ta1I5y|0t7DQmDS?88Jb+x?bE6j^cAWC#m+PBUng|Y>z zE($60+E0MyLvQSX!O7~Ng*R0%Djg>2QJxBHwOhTnD4C@HCPU}u{rNcUe44cLH5n9E zh>I;5ANS6on4vV59I>Mxeg~oTHpQBm8e_=4GWhVAPh$@w zI(rd@m@HSef5WO?*sKp6bZ*xj-G&G<0GMvDIH8!F!QU zOt-@nEFFe`t1JxqR{iWcdUGmy&$Np8{F?`jBRlm`Z*X^$IXENW(dR8Db8j_6w9*r_ zYvd^yG|y3fIenHnZ>^}@eCU>Qm-3b|KZSgfP$>b zF?)&=TH~5~9)1GQ^q~EbB9(XkM_$_p14QJ+AISd}ll;A+r%W1_iW8vWo1z`g!NESr zeKdsJJLCWyh`3|sI~CFh-#F*D-Yd0fiLcEWQ05DtYFLd*e=6TA#z^n?9Ey%nRYdUf zHrqnT?xcV56{NCuF4r*9di4!jHWWX6PLb|ri6nDotEx^bH*|C73}>&1JE-h}qvd_D zmr&iiqb2?k)-InOJ-d^bX)Uut_sQ0rFVCR$Woh|)U}XhqM{{(rcSue}3nEgl>sjQ@ z%j5WAEXIUbj~kqNa$7dnVq>CR_euZ_MYW)%>};9mS8?0#X3TqVD6pM#Lojk~EY_VW zxS7t;+1u!1v03=@o?0ctant45BemwyJ6!jM;r_ZPH?bz`SSyF~OZ^+dWx)3jt*#Wjo<~ zL_J5b>Ci2OqCq_E*tVB?t&eE6VI2?$g$H}dSFjWBuQ4_-U5yF?=9jW8XgUZi!N|eZcg?7QFD2Nd(-yU07ueHy3qfPASnl0*<`U-zA*TVH0hE;E1g#Z)E4rMwfvkq5%=%Ko)x+?)l+&XB-u+EfC)|O0@G$njoRu`1{}J|=pi^)ROT74wwGLM(Zxeo^m7s( z!IlBdu*xumFP3zh>{2d%x~P<#O1b6UtI>b^tGyqM(sQLnY~0YT9Sw)J)eARWssVca z)W3Py=Gv`*y$Xk)38;QRy&a7@)Z?;}_PDAXRHV zr_EbQg_3jBfVVR>Sf4HAMKMAxseB=13oyCY36oPQYaQIlvH4BHhB(kA`YI`*Q=(vK zlIp%>z2!fW8jC9mrK5B9z~xVy(0vLI;rOaCx~hwM%VE^&d~bbO)8E79!xy7%xLt^N z4ra`DqMxstT~2vy!JQYYIy7_!5tJZ6*&Z9tFW`^FGcn%UXlPK-Fcke1o@}{Sr}qeL zUiPtYtWz-`^46vG0xWO$*AxDMhkiKA&?ECVu%%q6nD+1Uq{IQzW0#MYzdpD~+Jy!f zp^8#vV)AfZ;v2(1U9W0teyv)$piZ2X%B|AE%>8UE^AoFb2t2OF&b zu*(&^&}FCohc+^qr?dBnfhYQdXXHYA*X@C2+NBrS#J17E?t;I5@gE_|FL3hcWo>{>mK*zNN^{U9R3#%1OnwtwAR zmzq(sz?!KEU7+A_jdep2b{tFq;?_Hj8=x8`)=pI#AWquS=O=rZgWr4nVfPk7iI`Y! zQZZ@DDfTOG&|~<&kApoEIXL48{8#c7-F4w&`V9iVuRjv*xsn=CNPvIu+(;=A3YG1)tl_n+-c~`gcwc!h*n|8wZ z1J+#EJzouW8ViH}Yxhn_*$1CdW2CG5MPMhud$O?}oj?qO9?N!Zt5hvw_8t$Tx+0oZ9^xt9k$*Xh69yVD(nQ0FM8W z0z8Xh{v4f>=V5Pe+7fVCF#>RiNChAH;c(Udhz1^G^ZGg0+HH3#FU99`uLKq!zn4(^ zbE%fEACA)a<;4@h`mY&}-A82ra#d2ljHp$lVH@`sKtIwf6@j&qeSoElnd4?FK*ffh4&J4@YI1RK~l1X2^*p*0rz-IIJVXeH)VwDhX(%)WM2o$4qzV zpSG-S3c>_g1v*;7H|ar1v~>Luw(Xb3rq9B|?qMr=B)1>*Rmsfk0R$PwANbnug}avY zvg6r5U1QY1!4Qv2yWjWbZ%8}qPD6^yf%Vlie5{9W{zoYKkTz+;;%jr?TggKT4b8wZ zHPb@$o;x)aCzW=C?IwG!&{9n#ZVNdc&}^Oe_u?_RLG2~itAd0fjR!W%)=*y&IF+l; z$p&p7|6o9VK$|5UgFUlTT6~J#Ev(i`_+fgHA#b(GFWU!ufGXvKT#MG=DIe=;nGH=g ze3|%f18U$Z?0WIjHi@%?KlMlVA-khAmudx3R7?d-v__t z#CpZNnWueNDJpgIe-PnF7d+3CZIyCPHa1RC4jyj1_D@$31B!y@(8w|4D&FNY?uLr8SGaZya`ayv zvRw0-O3%66z5@=Yp+yHXMYR6jfUG`64a+gOQ5$d)@PcDbs^UI|1Q`3e(aJ zT4&u1h4gPvKKHeG#J|elln%#(v|j+s?at;~8Rb8YYYCshuxGHf+d!>l=Wc{0D+$rc z4>@d5jy5a*VMwo;exFC$0KgZp>#6fJlw^XBfBQbr?TbIs!P>h-c*ph6CN+$*CzSWu zzi35~bnHKk2B-g%NrJn=ru|gDJex3N26C~9fyuRJ75pArG${FGKfO88+w488xRZh0 z^tC!UE3xmm-ou=kh)o)44)`-3}3HBC@h3{GtIz{wZ_^vux!*1p8j z$LwDVYShL~JB8Yt>@iCZXJ?^>b$s9Wg8t~}DSGNCYo=~Zb;k__2qz1!C6{OXdO&qB#;#i_|( zOqnDl65lvTIqI)x01x?QO23i2`5QnR?{Mu;UgSDCa_TFC3U&u%60n?LwdcKfh@Rvb z43C4&K0hz8SfQHkfp+NcW}P_1>|*g5V^@s`eYkQ8bP&Xcok3+*7R>357&NMY2syO1 z27-IrEX`&s_Q4NK!@2eCi+|jKa~v#q!bHQFrJF)BQk25a3olBy`%8!|FQv}XR;kh4 zNBi&_6l?0NqnNX|`)^ItW=h)+I~RMarX^qR*FRLqG<}?oda(R=DMJiPf0vjU@F643 zjOxDy;)r6CU{}F^yo!l!pWEH_QP@F(P*@S!r@p@Sp13kK;pRF~GVw{xbQfSP5JgpY1r? z(5BFf^-Q_}``^CYH#yJ2$u|y?{S)!z0M?+}!OCt?5nzuJ5Aa4OgKZ~R_nnPnsM5E6w%nPy_4#L+_fEwu%Hk zJfnAf1LxeU@%Vt&kjL~Bg%j$tMQfvQ&G_uuJHU7e)$Zkn*iK3$7}`egNuS8)KtcRW zEay&?ai&Ti?%>Z^KdYvyk2H47O!UVc`~>w$6@LRPoStM7HEY!P8)MD!Z2lzF>q7%x zfhhUQfLSHBMYbk#Fl+M`Y+enF3MnT|M}8nHW+0*5w~!~4s-|!M6v+?~126L+!rv#y5Y`6}7fR5wK=Z#i zvJD2a`Wml4PAd005Pq?FMUKMG1c{(g!21aJ5R1y>rp`5ciJW(40*$z}a@K*~<~T3k z(3g5u;1}gl3cpKcC!FTnZn@A-DnK24#sxs?>VPjRDB8UfoOFimR@&0K3gjrZZXp}5 z1B*d|J2DjTk(H4l&2wI4uwip9y^fQi%&i|gMxFs&0tCo1G^}tR^;g7l$DaOc@T;FV zl1mHsG$V|aPcG;UfV}Tl7Uv6RXvQC}TObkVmYbyUquJrZZRB`lqi~lBG@dRXlU9n` z0TYFj8n(X{6ps~Ou!K4oOsUZoCHF5+v9NsWC@0{P1Pe4Vpv$y$;ZAz%z}k_f$ci8v z4EcITK4o=dJzZ|^-L0Q3+(|>+le4Gz`}aeQV((%C`_V%ITW(o3+{~4u0|nH}E#`d>+h=oR z8x-VW(L z0x2bz31M5gES(X=Zt^s()s7A!`vHBWEUv1b6?3gT)|5~#SnyoX3Xw`n>shFkfGZo6 z-jRMd9@6+WIZ9U?=^}Uo^xP6M$y35uuW&juSub~}1MW#caFrSJ98iBrnMGq{o z|5)ZTl~(ugR&IxLJGyQ>r1viy1I{g1Fk_ZhzLHe&J8v^Wok!qiXZD{My!LTJkTBIc zl@2YD*#oo_>zsaq*xI9(<_TJBc+9W!eLs7p*N4QAik>^;( zup-NvT>clreqE~1MmFjvS7wPYGy`&BR-;#6Jc&z;l2LCfB0-rCq8WrHx9@gb5w%}1 z9kheJvcg_kKd#FZb%HO+(52oGe;7F!Oz%kfno?FE1-`l-CpG zA4fwjcbpB*U$Z}6J-LegIB9&a5?Xall+uTaET=UwOZxqPGdr(cW?B-^w}u^(a&#UJ zuH;dvzCnBIkuF}^zoi|lq7R2icz04E=~++|A4RfK%Ngwci2cp+W*w)w6fCy34^s7ad3FX?)tdrI%HRujPMBt2yt4c&^85hbjege5Ny38*F?RLn{IsE*;vBj!N3*iG8Wu ze5o+?tDCDU;0d`weZ{lvrc`rN+pmAoO9dU0x>CCr!I}as!}ZhM1)^KoPOH$m-C46@ z*NxLtrW-c({729;PusD~*s|EiqD?HF*=eb{7vB;;e4q+L@ILh2NNGkJ<@>2Dm$3%l zBTzZ=0iXr^?}sDyRffi96>CK9y)_&6gp{S<7YXFO#I3&OV0OQxX0sP45KF!$1K#3( zDXrd>NY|-?8E&Mjwtxzm!$_N3MMs8=U6=zxW}>Yn?CjYlB@a|^I}L#i3GWcIJK!Pw zz#K9z5O^w#A01z2^~K=&Tb4ZMPjiD0vLVZO)lGa{Y6^UHq|U-{pQY14LzNwMPNfnD zf>lHhY;Yo2Ks#umZ(W}1Nm*r(A4av~)iQ0P2Uz$;b4fj${KbTU5e-Sc2 zP;pmrdm#7oeY6)!xf+TT7By~8+7}Y{`5!z9h7V2A;`ClMq9OgCU!=X z$bOm1267{fGJ15m#}2BbOjLT3&-tRd*L_XNkUnGOi<=AcKb|~(`C!*=h~20cRc@}` zuR54+1im=L)r4xQB-h(9Hxes(>GN8gzXI=!WEVeIY2}`P$isX1an1| z(@RP5jfT%cq5_3l7C*^uur^6kA^5)FY!4fTEH_;H#ZHvXv%*eO;4PmDUKnUdwn+mc zVUFOH(4*(`sP7*A1020AeSA6q77kS!ef1*W+&DDZsNN#g&)oBN|La{f`lZh(AJywJP=m*M;Vm?P4m9Y^(TGAR*4&%pRVLu1b0^dYgdNF5BeDd|#; z6QW#&K~VlG>OmhKA)3EYQNNb9cagQ{F<+qHPz{@IoZ}GPkg0Fb4gb$nvl-Yqh2Bjk zOrI&}IIq5$587{vmC%Y*T;~P{*5yY%{o?PZE@C!v4C z{Jh10l;SB%Fntn|FP}2Cq*yvV4_}$GLhvU6f%Ur$4iP!}JoCk%8>jc}uol#13n>rl z7fxL-im*tsys~-64I=gy|Libq6z6{z!3mm8*l>TYRQY-s^RK&9k0N3VjNxwV+Tq zmwpyfbr?n}ier0a5bQ{Tn{}=f8V%j;m`GQTvXpJ7K#bA;?@W3+;ycN}wt+^f?g`Jj z9Aa*#5(TM@fwLyIBcBidM}3Lk2pg*@==P1}#} zu7>K8`j2=&tLtwYgHl_M*F#C%mdWbky^mpcHZAk}^%|(V?75_D41i;`6u?l1;Ib|{ zoEs-z*n8gAUlYtxuCMEm<2reYMb&dl_%-(d$%TnEky34xeE)VFNS6m6;lzg0)6LarlryP6R-or@z zf@sc{nqWR`ODE{aJ(?5(Gs1~r4}yl-x{DuEjft0`%NvuX&#O8QRJagyqkH?&MOs?< z(nvLhzUTGpYzQJ?w)!BjP;6UPdHiU*{BfkKzL6dGa^fVucIX6E{8Zac!FNRr0yB-o* zvo}1cexoS3j|Qo;>@Vso?kmIB=D1uE5@^$NycP5cA((@vkrkU551~UGSaqAD_-0L` z>y`qDY!zAU|GF|&ubqukG-dX-pBB!4fbcdU)`{Elfjz^(&$MuM6Z=Jg+VM$eGtbpi zOhw*3mXln9zvMJWjig@%D|7pimS*u(M{Z#LxA{u(0|E7omAbUd;N-oUt{U-e^IJRl z{&GyqzM80r0C36Gz~3c5dWO%LXl?IeB=!L(tQaELIk(eK*|Fj2VL*#tP@ax81V^#n zq9LZYzvymYF?X_UR;f(exzViidtcpJO(}jHf%3th<$G0BX>~{#ncMe-ABEu^pkmIlB9QvS_S$`XyZw;zASFT+2X6kFH1zpn zid665yy@T6vcGveqe-hO^QM>lDlmzD?ynL&R{eR$hg{X&ekoY#URVT!VSL!u`Iwa2 z;<4)MHGn6fah3Aay&@S9JpOY!s&yGT7G4?QxpgxgB#xo zb$r32e0GL%ER={Ds)M9GuwD9@A#@BoK@Hy8$A370@O|;4Jc>Qzm`|w zG9b*P8vNv2iX=qZv8z+VEvpo>Z$Kg2q@Ca1v-AqHAGw*53jB%AdT_O9xq4PiJPlXA zgKMDA``tNEa~^Y<^g~r@gjj#+;i_8j*K<-c==_n}6-7S%7Nf*IR^L1A~*bOOtoPqG}I5!LSwEwS%dk{huYAxxs4=%ED?!*Xflou+$ z&@UXvT&Bw*nyxNJmZgE1_3vRg>-(*)?U(?7b?VV2vxa7CYK^@YcUvtm;v8{~TG-<|9vYlF>{! zj1;xEigq0!wWq~8`FT?!jqKV~HpSq0y}x(cNOH;r8J7g(7#t7QrlQh^^LhQD-~3Ro z*n6DU+4!eW_)ba~7_{xr9|Jg~L$c;m0P?H3lIzjiBN`>oFOm5rMG-a$(-o+ZKBeEu zB}m0_sQ}=yX_GY24^{m7+ZP#`~`Lem%3F>pUK}xti2vX)Y`$6Fr`!gqQ zn*O6mm*|)ZMd>NE7%IF=XE(S_NHQu=I-h*9wJjG}nHA>*gg;ffHY{ZE{f>oEQXk4= zVW7?YRUKaUh!HV#yn;2WjrX8V^l`<#imjLr5Cr`QJ^DzuTJ<)?*d;o8!ewX~M#%1< z$yM!`_7A4Wv%DOiZ_g6iz?t*=x)qLVGfynWm5dOLJ|jJ?%MkL94?fu2w*fH6?63m= zOW^XCq1H&HF9>G1s3eAPdD?xx7_%Fok4t*Q5lh*t$a>@blZWGkHa>!<;S$vIJm?#< zf~r*bj*vq5&gk}i^)lgAiO_pF`j8Dm><&q3RrOFtvdnMr$}zS8XKK2Y>Zv7DNI{QO z0z*YOdS?a@u8&{z_#w)wK8_{T^F@>VKQrW)_k^ttPw!}QVTc7h9q-vHFEMp@ zZ{e7Ed%*;I?4lff@9#I)m@1lF;-^IHA5G}YoF?WILf4zP2zE>enF}r~dp4JCc-J5BXhmOL2u`q9p&k{5K0}`fSQz zteeKj9LJ+Tji7fp4dyaQ<;>y_ry*U$PrTus@$H`b6!VPn3_2`K;3L`4{Ca>NHxIeB zkuZ#O33vu0QctwW^C{`H!+BJ=R|(X5e&W-+>;7jZNlP-dW-wl zCYr2UYOXTpuvD{53>kn(pEV+fYk55M_wD@dt2U{eUsd~VkPbnn?mVf@JbJPJa%NK| zjDkWmX~PYC`59OzvN$x~qq;JENCUv~o{xmPxl5|%Osorw$A@F~=H^gh&1%#-3< zF7d)YnShSH{Os~MYv;q;=&Wsf$YL)Yx4u^l(&!M4cpEbOUQWM0r;TXNz)+;^atkYp z@x9Dq7N&U2jv*FmS)-~#QEaMrGv=|vT7fRgmAyc)pdXWeX7=X zT?VqwGfpfD@c&RqyAy3XRdS&W{PuQMcW-M+mv_X@qIpHscjs|z30-X-bu;rkJ3grf zff9b|><}eVwE;a-6=(kOE`pC|>jC{aj2k`prbZ+c*`hazTZ~`4EylPPBpP^~bf)V0 ze6yZD9iRF2X~Fa7N(jGz-Bp~T;{YB|TVhDlGiFE05s!>rqP5JJ&j0S;{yVUn23DvTB*O?_2bT@tifxn^x>&R?wPS9wy0}8{g>Ta!>oh*eRVvJ zO*ASM7(rGp@krM|_%||0LvT_*c`jGa!kfG}aO^y)zhTrVeQwy)8H(|i2;o{81Semd zJZejU_=6N<7pS`30>DcWeG}Si!>7YFSr~D6vOTK*q^w$dvm*t={bPn}4PkQ+mK5F2 zPJ^Sjm#Ibeu6gNO-ZO?LTV%gF?i^80e!k0Hq>N8ZyrnKzl83pFjfw3eh%7Ih<=iDY z8MSGV_{ghZ=0+qhlUVE4h~KNCqS#E6ZS*zO+Q*6$88U;k;U#rB&Yj?_@TNOX7Ntf$(pdawDc-)_mmoAgOUzySf<@GfA=uP zn>+TU8#QtiGLk=XsR(hKSEp_9%+rDMGML@KyNgk4X@EX&OkMogbN`2O1O3y=B^0Zy zUw>xLO)nky9SDZ|WsqlVu`yhTe4y4G@gnr}D{+*o&Yd>MBL3?= z^Z9JzAUZQuQ`EDUV?yZMPNAqc`EA52HHzFZB>@DBPBJ-K92;3>_yL;dljP2}T&Mkn zUuIQzyaqu3seXa3_rn26)roF!ixq?X|wGccU_*&st4_af3VY#$_VlMrMaGMD4`fkxs!WxwMpt1l+F?M z8%i?geUnE`C$^bEvl-1vTL7}13p2o~_UbnK+Wok}oK;7clhg8kF#CI?Y4T#43GAjT z#fe+>w&IV@vMI&L>X#}}2)28si$~L}1USD*Wuz|7iN)n7!hG&JasKIZATM3Vuk^c) zY)BVv+VD~ZA$UE>!h}MOF={_1;$4E+DieOWi-{jePXOoF9wzouznQunSbU)VHdlA^ zzI=tR?)P7515fmg7m?SMp;gA$-)5KYb)sv7x#sVJTcWbhl+vTY%C%Aji`mG-r(Rj| z`O$=r?_eqfP}kxSxWQdaT1#=q8S;Kd-WRBri(x9L;O3g}cLX$fZW?zi`5NU>$VM8R zrQZl}w#kxUAI2b@&mx!Xk?IN=>a}1&3}KiB@skId)rrLKu!4h{@ToHCQz;Lb@746< zf=#8y4(It1Vuv%FR`_MVtNmueO5Pb0R#+#yB=yK$^YG%gYN{3#X$^6RjUbGxBJ2mV zNlFsh(4osSJ8I=A;V}7^z=^f+JD1^vQT_u;I8^{Z6{b^CYswKu7MH<`!bx;T2s2G)a^(hHcQYP~eZ1QbgJ zXSUnW(yV-DV$>|UJAo&$#4(nsMpmuYGoiOyYac^=!geo#vIESvu{kwDFj(5J64Wh>c5`GoKYA zCk&q(k-=RQPYiemu{10?(BNtc{v4EWwYN2`(9a==eA!AUyKNd)#<<_pV%mu0?EuSInX%{UeLXQBkv_@D3Ptp{A+T-K1^@&AvUZT zuXjU6L&P!292#rH*tbTRQ8 zpKshjz#|fb3Hk;<(j(=p{U>r4mH0a@NqT9cPWEjzoukuw^cjtP(138}YJ_BX+VueG z3cHmQ40)i@=?pY7T7g0@g*H{4hM*NylGSF4oLXD66V5TPw}9uJ@x*)Cox3AOB(E~w z4p4mreuoy7=DzT)22}<$3k)T4gu9H`;)uHwMH$xkryPBR0*6%f8f| z7iaIuJ*FT}IM5)1v!Xv+DG?tO-L1Rib2HL{Y!1^pDtZoq;XVg5G=v) ze+ZJ~V}zBBMZ;dW-z733SYh>;#c;=yEPO>&c25l$@#VoQ7{mwe2oa9o(VQMR`H+0l zIXof$G+mP0Ue)P6N~08{vyvoiCum~8J63+|%U9Z@i;H>jkC&6HR+zffp**0>IAeqL zUe!g`<{aeCX;AE%4ZI=iw$lpWLwwbhr*9M|Eb>JK8F10K2Db57zY`8O)mU`cGXZ48 z(!j+RatLR%eMUwTU@Qdgg6{}jUnN1g9|4#4uT?;V;UiMO<^*ccswcs1rtZ#BA8n7< z(5mHViot3}PY;vG>JnNKi#cHs-^v#Ajn+P!Dy1@kYBg{&0iGGxhT8N<7)S&G9H5A0 zkSag~fh&y%v+{Ib>-P^8C$IDQ@>&~Q!OaE81yT`fuaTA1I8BMGtc2`5ZUvXfDG- zTGjsIDLQNSo2Fi)Lt+rK@HW$T$n6mHZ0GVBl*whOx6WYjyz~5%vW)rgH#ES>#QVbO z&J1RKk&bWr>?v%(RA8|6edAz!1I2Pxk{^O;4m$4hJ3+!d#KAbg6vqNUNA~wm{`AJ} zu0}wy0tRJ2NvP>OHfZpfNQ-PiH5n3l>MF^Z4y&&H56RMoTOGM3H^*j@Mz|jMy9$My z$}BqnbDzThL_#o!9qKZXt}p%%4kBC)5)|XEg{emwb*$)N?gGe}-?e|-Q{DTPlfs?g zcc0hkH%Pi^5~}@Sw&u7dVY-zM5)8a9xwmW0*U+>Uh&HSP`L&sY;DJjA^KS;LQt}d2x994HK zVpXRFPi2;snKQ<*R||IOX_I?N2DmK?^`LeM$O{Ct0|N5BO6YJrwlGnk>qJ_ABxjb= z(T_V4_0I}}A)H*=abu1Ka7=dlt}7abl9J)oOoaJ4v3#8*1V0b103i|X^l+;!cZBHY z&z}O0Ms5Wu9Nm7ZqIbPIF{*qy>Ye&#xqVEBsF(7T5bsle74%~MtdCm8P+W85sWiyH?wkDzT>&)#>dd)6o?k;+r zZ&d81ZyDr}-D7o9@qm^2Qy>-tajS*U-it~Jmq&#Hz_!eoA_L`lQ;L-EgAtbxMKYE+ zzFQdU+OYGYDWaWn$dCvJ*l7uhLhKAr)722s^jud;B0D1308rCjw8}di3J(x*z-Phl zoPdq>5F&IONqd==VKeS+(QB%6Q>4ty=VW=uLa(%pI%s z7s*nxwds2#x*764K#!3kK()lf7Zw?(LxE3wk3%gUl;k`G+}K`l?I|F|qzs>6zcg!9 z>e)c*b1n%v=`7Z;cPY&eZ2bLCBSJEe2YX(jqWbjpI5ep^ILm?G1b%23k<{N+lZnJ7 zL!_T~H=l^`oUI?cO0`v(`sLn>LlkvOO;&Oe%VHq1WONAYhw++3z_W;XQp$wc7~(|- zrku23l?Am&fFx8L0WSw~$CCuPad{cTE@q6qm57wqF+li{aFnIwYw7abJ_WX!~3&Q<{(7ntlmM&Zh`(qh{2lqFxWs(HqFw{&ol@HFlx|uvk1lSoPi1S z4R6^h+0=_&>Mh_>I?>BO9Mv}|H6Ubs4p@5+f2r*inYHW&;pp1Zgy%*YFjrR+#?C+^ z9wJac)176$r8>=X&d3l`YMcb4>8EOzpXMkw#t}uo@R`oX);gv^MDU|0Od}<#Z82uK!Ir1 z^WCQk*WzC6wAxZ@M_9=57!I}z_Imu7uxy-YoyNZ@( z;_1*2UOe(xQ+oW`qHsj=-Q4~f`lFx~*TPvfi!FiHp|V7%kcZnYf@#xs!1vEwxM`R; z@bhbj8xNhOxA`9GdgfXg%*8dQK{Vm>O~Fqm6&0T^PM=lC_GngVHEOt~RCO6)Nb9hE zRwjTfvYTqcVbe3w1 zdcrM~f)sq!f1?nb&_-2Z@JvFsPR(AMqN_>M&&p!qJ6UiAvbT2~rs>0LLt4PnHV+dk zM97r$A%kDw)YB;+cjmP6k8I6|;F@xBU(7d8?feoDNo6MVph{W$BVn;ZrB$f`AM%0& zY8IT#u=JO88#0pJ2X<3c_iZPE=T!Aq7-@djii4AKY32+DH@*k1DP!mkUcvu_N0g!D zVJb)Rz~+nc=CP(xGY9G(j7>DE67GJhNi+#&tK|T+-f;Hw9R9zQ8 z&2c!ZVcUgO;0?)O)5tO}L8v$nu(VX1rWse^8nL<<6U0h>(Rn($tf6#W-Of;Q;eMm9 zq{zy*Lh3FYenIA2w1jZ`4OV*m-w7|Cv+Tp!tW5y>#tSdii3ssoomC! zMq5aIbciYnsv>tE({#sy2tT+~}S7ISYoGped3t!68q=YC! z_qCQ7r`WYl5+UL;Db#e*qkjY3P9Y*pR-#iH?1&SWht%SbX?0ZG3D zD*0#u&3z!mIn_%~f?&wbmEX#`x{4BAPe;Db3UDcB19hK~6dH_NTfG`UfQ4hU@wV%c zO^0Ak`^MmjcU_5q{WX?)N-*Y52X7u0A3K*BO8UU@V98%n4A@4_7_*z^JxT(mo7Mf{ zviJ+;?ZiFz-|nThN10);c!*Id2-1`YrzXN*bCRjG`>wSZUZ$MM|D2;a&X3%ti&<)s zWt{Ylyz>5c6jQ=i8vo?qLH*25i$|m` z+=fdv6UQ?TOG#>3d{`zgDx7ziIU(udwLCH-LrGd^vv2eCZs!qio*slY*RN-(@RFcX zG-=T+vd@sIjO~lOQ)W>d6TflRqU166`j{Hx&eO9Knqqh&@%r*o;u zPx@K4=R1sAG&UPIe+o7=3C21t-t5|f!Ql6(@Nc*BsgSO?!M`H*Dq20qHmm3jWPP!t z#1nq;i<}3~Kp)BK+eH~KB~^2M)CL=jWL3S5zY~gj@Y%YbDc2IY#N2Nx2}U;P>syjc zOD0G~A3MKPza!d>^^dKNdg0pw5o3MOx1QpXEoG7%eMQ;~4wK88xk5p3MkyuFT!fP8T{g?v zfnXRQ8&{@vO$AR6bA)_%tSM^VJyt4H*^Dn*IXk+s{U)k!wJ`Nai`rL(FLgSWaZaCy z*>ug|HgctrNF%VX%9c7GTIM*8<%G9c%!-~bS5a0?@JyWhIKF;!Qv--J5Bi{YJ~_H| zmrw#H5dQQVlvKQ;A8D-}rJN;O`T7Az4mJr6#b`{cF^w>@taY1jOZ`}e8Aarg#zLBI z-|eT<+x;}V5Q*kA-2G3}zqPHG`U<-E`KP{Qb z14jK5yRvvxqv#!>8U*pXS|@i>m^6a=%48%C>Wf{FB0sk@t88O~vo-4(`-~)+PtKa% zaEZ(8eKLvD(%4+j6xy&ctabUF>jOnNH$X>~CX|szPO$w=)iaUISC`dW85(cAhkpiE zU(2$schRVCX@jeawK_e7)L^}%w-*znCB-DXZC z9KB;JL+hoo0@f355tr$*dX-*+UPfF~)ZBX3*P!-Li9VOopIlZX$NchYePb+ZDAd!``Nm4cL@`~#%;I;#lvd>lOo;}5fMY9tkc4JcJQ4;Yz#eDhqw%_k(be+R%ez_T4 zia4R(syouf6^?~`0*n!W_Pfz?4nd0V!UQ9ggtJz9=x}d5t#S;rE$+<}C?Qu7JoAU| z03=Pas;+$-Joq#DM@QO7UCz4v$S*;SUn7^F^oDUQdaleihp&1n1#{yK07OSbfb;%3 zv0M&{hs~GQL?;c$xj(K;Ny>r+KTtmpnt+T|is}09ZwIAw9~BuGdJ+CwQjDPvUo>s= zipSiH`3;xG{Kju7X)U+sBx+MHcRYCc{YK93!TE4VZzNLssetT`%W&CuU;DE0B00WG zEK4Fp(4Scw8}LJIWm}yANW@YsPm|Si4JL;?LJ4nV*u}R>y;ivEMMYR_pFLNzemBf3 z&;&zR1yVz$tJc>BD8Niz(<+_y8lwsdwo{VO7c_l`Jj!(TiRXee9RK~W;#?OcHQ{LL9`Biz_1T6;X9Lu z@Y#1Lf>S`<{&K(=6E?s56w*XZxi#Ac@*`bTCZB)2Bx>A2B1KSIB2ix}Fd2dEhrw`EJE)Qz7^L-}h2fg(yab`4-^M(4?x*Nc zk6(TlR8_r*Gi5-`#xl46gvZ#P8Y?}ccLJa^-7y1YEBw!9ru&*Z8zd?sPEKUO)1(x{jr^lFUr#DkgI0>+V(iCYO(ss`Z0 z-8C<({XK6a+597Bu7VetLZM{U50`kAM4rNlE$Zm9H+x_aWNwjXw7-WH1NIfrEq9|0 zjj*7Up#$vH*fqHyVbtZ}`Cf_DO{cA1N<2PGmBv@yiy6|yj7cP>3Iv#)Qoyv37o}f{ z5akI+hjSbrrJ7eQaE1O9`BK$Buc8_16iC^&mjuzv1K-E$Fy zae0T$WYz3OIq!1{9PA@F<&mj$LflulIe}qI%jbJ@DUDLhJxX7RWF5j7w`_m6l-j=6 zRQ>nrtm1~6gkz>Fv*uf4U@uqaBg#mGy@^VcKTOSn2^!D(z|ea2oX(|^PEGqElj6^8 zT*gF4Xc1jAP3nkz4h#G`vop-U%Z!j0Mt6Q_A#|lUm5-Y36 z0{%jh(QmT1!dI}n^rmx;O`yyz+tkNifj9sODiS?!J9A~vH^k7{94D$u-{$5N7f-N% z9$MsiOr40QC4S3mRVNXs!4iQQM+Myf}LQ*9Cq@|^| z;alxfb?9kJ`{YEkOjtCHJO{O?)-M`hjD97BN# zk;D@M=RZe~TL|6={v}Gr8!ktb3Ci~ZQ6Xymg|O@G-H$;^fAL)CH&OEqAEoTuU-;4H zn%?EZ(d+jQz4S2I4j<2TUgwzpiD8Qz2?`TP&j5^w4L$nad`jsd*sy(Yb{%<(brh|~ zM8rG}VW<~xL3MwCoj)D%$`i8oj?3lW7}p~U1zzHcF0v!`&WyF4=|ApAgfFb{Z6#o2 zuW10mY;N?b55~KXY2-0uL^UhxCUN|1zDb{8#R@)P5=k)ztw-mK;7=#o=R)%hzIKgQFv9NpI1&cp3DsroPb`N06I!MXXtrw$r2UqKQs~QkrWm z((ekQ%I(Q&U&F)W<0Z?SlGOV1OeH`4u94YMB5%G3)ItQrfV7-5?D+<|y{*YUqm;(4 zpP@o*^F(pjvrtulf)+WjRh2>F8_yhMmp1pL$2zdYv`D|<=xv*~d(21UHKtLV-0Uvs zYhmb3B<=|+ZZA%aEpwU?D@RmyK%h%sT@*BdFTv}JDua!}dy@q4PhmbhK`kwf@;WyX zN!H}n7rsA~%k3Sk?){`FLou>ZhAE_ItNQz7c|%!Am=CeqPowZmJ9+wRXXZTbOmhrgXCe649WQ;sep5|?g8E@e$w|ptjYfw!$>ds= zIWvnGQe*Xu2hWD62A9KA3PP_gSgsQL^Gjn~-}XG$~P2ocYR0_(1Cb2#9JS z(*q^K84sfhp)0{)GJx)-yd zQ7(hQ9zYkpID%Vh!{M+@y3=rS!eiWREomx$6{u^t z;bw|?=*{@aGZx(-3JYuUvsI?PwAhG)AW39~n-I;9F<=3aPY5&TlBwwb04<`!Zdb?*>gG>!$n41M|H|(dx-h;dO z*CU(H6+>cUYmaw#{42a!NIjV~mr|Df3Vc$G#eOSc2h>Kl+UB#Ei9ovblCor>LN{bIZ1VW@0;!Vgvb|2%{z zMhOCJ9hNETZHq;({E-{`K^hLczL=w9W6|S8WvyX7;f8AUe;#~OSu_OKH8*->HW)=b zMZbivpTjY0en;OxT_-Qr$b4FPDNtcVHE+yB?cYCw%*!`L!{oJ z)`9b{L>11z9|8kPQO*;ooqfZvr&j)Ra1b1}>+rv<#$lEC;NS5@n>{#p&Pk8v=V-|G zKhFnUAajLzaYRx`W_+{w$(v#KIy#!%qyBU42y!3+eZQzrQQMP}PS~ z%Epc`^ooj%YW(W=T~ON}TT_)|N7n(;`#+DBCcKB>Xu8?_<^1g@$4*@M4>iGxn23Oj z6Iy#OL*P=><&A4LwSGZ6oyLv-`#nM;D7_j8S#Q6OMIJKGY0J8}+y_Aa|2+7YsCa79 z*PYr9( z?`1dO5W&x*2KP*vks%Sd)qg)&IaD|htA|Mww_mZ$3v&MN{UbY7|C?UuZ|u-}`LE{< zy8r)rE}*CWujdHR^1q*ZK>GiB@Tgq;*Q1Hrj{kau_WqBM|Leb}puF&3&!6r5ha7*X z^B-FL;hq1`;{P|2^`9gE`L{n5_(Op|6!=4dKNR>wfj<=Ze@TJy-z(#IG*Hs)`rSWE zcjo`)+JDyiLxDdO_(Op|6!=4dKNR>wfj<=ZLxKN$3QQG$ibfEs;gh;rf4tNGd-DDH k#UBd%p}_yADKJN&uDL(qkzWpUIwHtPJyYE>ZEW=a0qVmQf&c&j diff --git a/cuda_core/docs/source/_static/logo-light-mode.png b/cuda_core/docs/source/_static/logo-light-mode.png deleted file mode 100644 index c07d6848c98d3084b6df4ef4f21fd5d8fd32b2bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48816 zcmeFZc|4Wt_dk4Xvt&$>F|;d`C_@NahKdYPQsz{YIrF?DLzxwtyiQ@SdtL8qt@j%5ZW-zyXWhcL1tG+G@`R=l zLhMfwqIYFtfbW#fHd?^{m|ahtcSi`n75fi&kCSB>ptrurG5?uoZJ9Q+FL&PLuZ zCQQnouRjR z_=CV71pXlK2Z8@@1hP8VH4q}3J9>T5)U@4=h+F0@_^WLG&j+oUgLcv&bS3>(WDa~= zqMaZ9_Mfi@gP9`#`Sbt$e~@sK?Z3Z8;Cf2?-`}~TN&W9{pxvBG|F7?y{3GUn5cz}6 ze@x?#-TViMKR)#zB+&nFiQ+de@5qRYjC0t`%#FD|MsfB^4F2`5Ba!ic!GR(1^Hm!r zgnYuqY!=NlWsj@QuRpR5P~Y4beOGg?j17$&j`01T-zO^FYQ>?lZ+FQnXRL!vIxjr4 zIjUvbX&+k~v{C={O4D&OsFYF#thRR&)%6fwTe&!oap#16gyXAQlS`0h2g*n%$ z8kgth9ljfoeqF{!*Z=!vt_M7yZ**~1NszfMF0lFi*#G_r{_tcsJl7OABg4sQu{!de zHp1cAPK#}p+W-C?B9kB@$%nY-$|x#UZS6GNR_pPv9~0ZL=(E3T-;Nzm+!gFm&MpG*eAV5J?sW-x8wh_3s7c>p&NJv|L=zk{yvq$^^n8813%*DxI+F5 zkWB1u0_r&4YcsVB4ee3)+h)1)ujim?Lre`8#h9Izc@EFwB2`6i@A@z4GMFNpyN*UI zbEW?~upbSFo3OsbU9hFaMxE}z?r~8J?$N{`e~TyQe|@A^8vxGkxWa?K`NFXHz^FyE?!@@y4Q7N{re;nV9P`a zR+};Tn-sE|htnMAm*biqb)u1Bv!R)?|buq8$fmf9Le

wT^+ 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 diff --git a/cuda_bindings/docs/source/conduct.md b/cuda_core/docs/source/conduct.rst similarity index 83% rename from cuda_bindings/docs/source/conduct.md rename to cuda_core/docs/source/conduct.rst index 80f5032e8..1c00f5c34 100644 --- a/cuda_bindings/docs/source/conduct.md +++ b/cuda_core/docs/source/conduct.rst @@ -1,10 +1,16 @@ -# Code of Conduct +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 -## Overview +Code of Conduct +=============== -Define the code of conduct followed and enforced for the `cuda.bindings` project. +Overview +-------- -## Our Pledge +Define the code of conduct followed and enforced for the ``cuda.core`` project. + +Our Pledge +---------- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and @@ -13,7 +19,8 @@ size, disability, ethnicity, sex characteristics, gender identity and expression level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. -## Our Standards +Our Standards +------------- Examples of behavior that contributes to creating a positive environment include: @@ -35,7 +42,8 @@ Examples of unacceptable behavior by participants include: * Other conduct which could reasonably be considered inappropriate in a professional setting -## Our Responsibilities +Our Responsibilities +-------------------- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in @@ -47,7 +55,8 @@ that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -## Scope +Scope +----- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of @@ -56,11 +65,12 @@ address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. -## Enforcement +Enforcement +----------- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at -[cuda-python-conduct@nvidia.com](mailto:cuda-python-conduct@nvidia.com) All +`cuda-python-conduct@nvidia.com `_ All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an @@ -71,12 +81,11 @@ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. -## Attribution +Attribution +----------- -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +This Code of Conduct is adapted from the `Contributor Covenant `_, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html -[homepage]: https://www.contributor-covenant.org - For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq diff --git a/cuda_core/docs/source/getting-started.md b/cuda_core/docs/source/getting-started.md deleted file mode 100644 index 6fffa364e..000000000 --- a/cuda_core/docs/source/getting-started.md +++ /dev/null @@ -1,114 +0,0 @@ -# Overview - -## What is `cuda core`? - -`cuda.core` provides a Pythonic interface to the CUDA runtime and other functionality, -including: - -- Compiling and launching CUDA kernels -- Asynchronous concurrent execution with CUDA graphs, streams and events -- Coordinating work across multiple CUDA devices -- Allocating, transferring, and managing device memory -- Runtime linking of device code with Link-Time Optimization (LTO) -- and much more! - -Rather than providing 1:1 equivalents of the CUDA driver and runtime APIs -(for that, see [`cuda.bindings`][bindings]), `cuda.core` provides high-level constructs such as: - -- {class}`Device ` class for GPU device operations and context management. -- {class}`Buffer ` and {class}`MemoryResource ` classes for memory allocation and management. -- {class}`Program ` for JIT compilation of CUDA kernels. -- {class}`GraphBuilder ` for building and executing CUDA graphs. -- {class}`Stream ` and {class}`Event ` for asynchronous execution and timing. - -## Example: Compiling and Launching a CUDA kernel - -To get a taste for `cuda.core`, let's walk through a simple example that compiles and launches a vector addition kernel. -You can find the complete example in [`vector_add.py`][vector_add_example]. - -First, we define a string containing the CUDA C++ kernel. Note that this is a templated kernel: - -```python -# compute c = a + b -code = """ -template -__global__ void vector_add(const T* A, - const T* B, - T* C, - size_t N) { - const unsigned int tid = threadIdx.x + blockIdx.x * blockDim.x; - for (size_t i=tid; i` object -and a corresponding {class}`Stream `. -Don't forget to use {meth}`Device.set_current() `! - -```python -import cupy as cp -from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch - -dev = Device() -dev.set_current() -s = dev.create_stream() -``` - -Next, we compile the CUDA C++ kernel from earlier using the {class}`Program ` class. -The result of the compilation is saved as a CUBIN. -Note the use of the `name_expressions` parameter to the {meth}`Program.compile() ` method to specify which kernel template instantiations to compile: - -```python -arch = "".join(f"{i}" for i in dev.compute_capability) -program_options = ProgramOptions(std="c++17", arch=f"sm_{arch}") -prog = Program(code, code_type="c++", options=program_options) -mod = prog.compile("cubin", name_expressions=("vector_add",)) -``` - -Next, we retrieve the compiled kernel from the CUBIN and prepare the arguments and kernel configuration. -We're using [CuPy][cupy] arrays as inputs for this example, but you can use PyTorch tensors too -(we show how to do this in one of our [examples][examples]). - -```python -ker = mod.get_kernel("vector_add") - -# Prepare input/output arrays (using CuPy) -size = 50000 -rng = cp.random.default_rng() -a = rng.random(size, dtype=cp.float32) -b = rng.random(size, dtype=cp.float32) -c = cp.empty_like(a) - -# Configure launch parameters -block = 256 -grid = (size + block - 1) // block -config = LaunchConfig(grid=grid, block=block) -``` - -Finally, we use the {func}`launch ` function to execute our kernel on the specified stream with the given configuration and arguments. Note the use of `.data.ptr` to get the pointer to the array data. - -```python -launch(s, config, ker, a.data.ptr, b.data.ptr, c.data.ptr, cp.uint64(size)) -s.sync() -``` - -This example demonstrates one of the core workflows enabled by `cuda.core`: compiling and launching CUDA code. -Note the clean, Pythonic interface, and absence of any direct calls to the CUDA runtime/driver APIs. - -## Examples and Recipes - -As we mentioned before, `cuda.core` can do much more than just compile and launch kernels. - -The best way to explore and learn the different features `cuda.core` is through -our [`examples`][examples]. Find one that matches your use-case, and modify it to fit your needs! - - -[bindings]: https://nvidia.github.io/cuda-python/cuda-bindings/latest/ -[cai]: https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html -[cupy]: https://cupy.dev/ -[dlpack]: https://dmlc.github.io/dlpack/latest/ -[examples]: https://github.com/NVIDIA/cuda-python/tree/main/cuda_core/examples -[vector_add_example]: https://github.com/NVIDIA/cuda-python/tree/main/cuda_core/examples/vector_add.py diff --git a/cuda_core/docs/source/getting-started.rst b/cuda_core/docs/source/getting-started.rst new file mode 100644 index 000000000..502ea6637 --- /dev/null +++ b/cuda_core/docs/source/getting-started.rst @@ -0,0 +1,114 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. currentmodule:: cuda.core.experimental + +Overview +======== + +What is ``cuda.core``? +---------------------- + +``cuda.core`` provides a Pythonic interface to the CUDA runtime and other functionality, +including: + +- Compiling and launching CUDA kernels +- Asynchronous concurrent execution with CUDA graphs, streams and events +- Coordinating work across multiple CUDA devices +- Allocating, transferring, and managing device memory +- Runtime linking of device code with Link-Time Optimization (LTO) +- and much more! + +Rather than providing 1:1 equivalents of the CUDA driver and runtime APIs +(for that, see `cuda.bindings `_), ``cuda.core`` provides high-level constructs such as: + +- :class:`Device` class for GPU device operations and context management. +- :class:`Buffer` and :class:`MemoryResource` classes for memory allocation and management. +- :class:`Program` for JIT compilation of CUDA kernels. +- :class:`GraphBuilder` for building and executing CUDA graphs. +- :class:`Stream` and :class:`Event` for asynchronous execution and timing. + +Example: Compiling and Launching a CUDA kernel +---------------------------------------------- + +To get a taste for ``cuda.core``, let's walk through a simple example that compiles and launches a vector addition kernel. +You can find the complete example in `vector_add.py `_. + +First, we define a string containing the CUDA C++ kernel. Note that this is a templated kernel: + +.. code-block:: python + + # compute c = a + b + code = """ + template + __global__ void vector_add(const T* A, + const T* B, + T* C, + size_t N) { + const unsigned int tid = threadIdx.x + blockIdx.x * blockDim.x; + for (size_t i=tid; i",)) + +Next, we retrieve the compiled kernel from the CUBIN and prepare the arguments and kernel configuration. +We're using `CuPy `_ arrays as inputs for this example, but you can use PyTorch tensors too +(we show how to do this in one of our `examples `_). + +.. code-block:: python + + ker = mod.get_kernel("vector_add") + + # Prepare input/output arrays (using CuPy) + size = 50000 + rng = cp.random.default_rng() + a = rng.random(size, dtype=cp.float32) + b = rng.random(size, dtype=cp.float32) + c = cp.empty_like(a) + + # Configure launch parameters + block = 256 + grid = (size + block - 1) // block + config = LaunchConfig(grid=grid, block=block) + +Finally, we use the :func:`launch` function to execute our kernel on the specified stream with the given configuration and arguments. Note the use of ``.data.ptr`` to get the pointer to the array data. + +.. code-block:: python + + launch(s, config, ker, a.data.ptr, b.data.ptr, c.data.ptr, cp.uint64(size)) + s.sync() + +This example demonstrates one of the core workflows enabled by ``cuda.core``: compiling and launching CUDA code. +Note the clean, Pythonic interface, and absence of any direct calls to the CUDA runtime/driver APIs. + +Examples and Recipes +-------------------- + +As we mentioned before, ``cuda.core`` can do much more than just compile and launch kernels. + +The best way to explore and learn the different features ``cuda.core`` is through +our `examples `_. Find one that matches your use-case, and modify it to fit your needs! diff --git a/cuda_core/docs/source/install.md b/cuda_core/docs/source/install.md deleted file mode 100644 index 4f66eeff1..000000000 --- a/cuda_core/docs/source/install.md +++ /dev/null @@ -1,48 +0,0 @@ -# Installation - -## Runtime Requirements - -`cuda.core` is supported on all platforms that CUDA is supported. Specific -dependencies are as follows: - -| | CUDA 11 | CUDA 12 | -|------------------ | ------------ | ----------- | -| CUDA Toolkit [^1] | 11.2 - 11.8 | 12.x | -| Driver | 450.80.02+ (Linux), 452.39+ (Windows) | 525.60.13+ (Linux), 527.41+ (Windows) | - -[^1]: Including `cuda-python`. - -`cuda.core` supports Python 3.9 - 3.13, on Linux (x86-64, arm64) and Windows (x86-64). - - -## Installing from PyPI - -`cuda.core` works with `cuda.bindings` (part of `cuda-python`) 11 or 12. Test dependencies now use the ``cuda-toolkit`` metapackage for improved dependency resolution. For example with CUDA 12: -```console -$ pip install cuda-core[cu12] -``` -and likewise use `[cu11]` for CUDA 11, or `[cu13]` for CUDA 13. - -Note that using `cuda.core` with NVRTC installed from PyPI via `pip install` requires -`cuda.bindings` 12.8.0+ or 11.8.6+. Likewise, with nvJitLink it requires 12.8.0+. - - -## Installing from Conda (conda-forge) - -Same as above, `cuda.core` can be installed in a CUDA 11 or 12 environment. For example with CUDA 12: -```console -$ conda install -c conda-forge cuda-core cuda-version=12 -``` -and likewise use `cuda-version=11` for CUDA 11. - -Note that to use `cuda.core` with nvJitLink installed from conda-forge requires `cuda.bindings` 12.8.0+. - - -## Installing from Source - -```console -$ git clone https://github.com/NVIDIA/cuda-python -$ cd cuda-python/cuda_core -$ pip install . -``` -`cuda-bindings` 11.x or 12.x is a required dependency. diff --git a/cuda_core/docs/source/install.rst b/cuda_core/docs/source/install.rst new file mode 100644 index 000000000..8bc1faa0e --- /dev/null +++ b/cuda_core/docs/source/install.rst @@ -0,0 +1,67 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Installation +============ + +Runtime Requirements +-------------------- + +``cuda.core`` is supported on all platforms that CUDA is supported. Specific +dependencies are as follows: + +.. list-table:: + :header-rows: 1 + + * - + - CUDA 11 + - CUDA 12 + * - CUDA Toolkit\ [#f1]_ + - 11.2 - 11.8 + - 12.x + * - Driver + - 450.80.02+ (Linux), 452.39+ (Windows) + - 525.60.13+ (Linux), 527.41+ (Windows) + +.. [#f1] Including ``cuda-python``. + + +``cuda.core`` supports Python 3.9 - 3.13, on Linux (x86-64, arm64) and Windows (x86-64). + +Installing from PyPI +-------------------- + +``cuda.core`` works with ``cuda.bindings`` (part of ``cuda-python``) 11 or 12. Test dependencies now use the ``cuda-toolkit`` metapackage for improved dependency resolution. For example with CUDA 12: + +.. code-block:: console + + $ pip install cuda-core[cu12] + +and likewise use ``[cu11]`` for CUDA 11, or ``[cu13]`` for CUDA 13. + +Note that using ``cuda.core`` with NVRTC installed from PyPI via ``pip install`` requires +``cuda.bindings`` 12.8.0+ or 11.8.6+. Likewise, with nvJitLink it requires 12.8.0+. + +Installing from Conda (conda-forge) +----------------------------------- + +Same as above, ``cuda.core`` can be installed in a CUDA 11 or 12 environment. For example with CUDA 12: + +.. code-block:: console + + $ conda install -c conda-forge cuda-core cuda-version=12 + +and likewise use ``cuda-version=11`` for CUDA 11. + +Note that to use ``cuda.core`` with nvJitLink installed from conda-forge requires ``cuda.bindings`` 12.8.0+. + +Installing from Source +---------------------- + +.. code-block:: console + + $ git clone https://github.com/NVIDIA/cuda-python + $ cd cuda-python/cuda_core + $ pip install . + +``cuda-bindings`` 11.x or 12.x is a required dependency. diff --git a/cuda_core/docs/source/release.rst b/cuda_core/docs/source/release.rst index 954d296e2..dc28b3122 100644 --- a/cuda_core/docs/source/release.rst +++ b/cuda_core/docs/source/release.rst @@ -7,10 +7,10 @@ Release Notes .. toctree:: :maxdepth: 3 - release/0.X.Y-notes - release/0.3.2-notes - release/0.3.1-notes - release/0.3.0-notes - release/0.2.0-notes - release/0.1.1-notes - release/0.1.0-notes + 0.X.Y + 0.3.2 + 0.3.1 + 0.3.0 + 0.2.0 + 0.1.1 + 0.1.0 diff --git a/cuda_core/docs/source/release/0.3.1-notes.rst b/cuda_core/docs/source/release/0.3.1-notes.rst index 33ea3b48e..82138763d 100644 --- a/cuda_core/docs/source/release/0.3.1-notes.rst +++ b/cuda_core/docs/source/release/0.3.1-notes.rst @@ -12,7 +12,7 @@ Released on July 2, 2025 Highlights ---------- -- Add a :doc:`Getting Started ` page. +- Add a :doc:`Getting Started <../getting-started>` page. - :class:`Stream` and :class:`Event` creation and some operations are made faster. diff --git a/cuda_python/docs/source/_static/logo-dark-mode.png b/cuda_python/docs/source/_static/logo-dark-mode.png deleted file mode 100644 index 6b005a283ba6b7299a08cda1d37ceac8f693f535..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50546 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 diff --git a/cuda_python/docs/source/_static/logo-light-mode.png b/cuda_python/docs/source/_static/logo-light-mode.png deleted file mode 100644 index c07d6848c98d3084b6df4ef4f21fd5d8fd32b2bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48816 zcmeFZc|4Wt_dk4Xvt&$>F|;d`C_@NahKdYPQsz{YIrF?DLzxwtyiQ@SdtL8qt@j%5ZW-zyXWhcL1tG+G@`R=l zLhMfwqIYFtfbW#fHd?^{m|ahtcSi`n75fi&kCSB>ptrurG5?uoZJ9Q+FL&PLuZ zCQQnouRjR z_=CV71pXlK2Z8@@1hP8VH4q}3J9>T5)U@4=h+F0@_^WLG&j+oUgLcv&bS3>(WDa~= zqMaZ9_Mfi@gP9`#`Sbt$e~@sK?Z3Z8;Cf2?-`}~TN&W9{pxvBG|F7?y{3GUn5cz}6 ze@x?#-TViMKR)#zB+&nFiQ+de@5qRYjC0t`%#FD|MsfB^4F2`5Ba!ic!GR(1^Hm!r zgnYuqY!=NlWsj@QuRpR5P~Y4beOGg?j17$&j`01T-zO^FYQ>?lZ+FQnXRL!vIxjr4 zIjUvbX&+k~v{C={O4D&OsFYF#thRR&)%6fwTe&!oap#16gyXAQlS`0h2g*n%$ z8kgth9ljfoeqF{!*Z=!vt_M7yZ**~1NszfMF0lFi*#G_r{_tcsJl7OABg4sQu{!de zHp1cAPK#}p+W-C?B9kB@$%nY-$|x#UZS6GNR_pPv9~0ZL=(E3T-;Nzm+!gFm&MpG*eAV5J?sW-x8wh_3s7c>p&NJv|L=zk{yvq$^^n8813%*DxI+F5 zkWB1u0_r&4YcsVB4ee3)+h)1)ujim?Lre`8#h9Izc@EFwB2`6i@A@z4GMFNpyN*UI zbEW?~upbSFo3OsbU9hFaMxE}z?r~8J?$N{`e~TyQe|@A^8vxGkxWa?K`NFXHz^FyE?!@@y4Q7N{re;nV9P`a zR+};Tn-sE|htnMAm*biqb)u1Bv!R)?|buq8$fmf9Le

wT^+ z8h0$i6U`j!#^CV(`$fKuX{W_kJ6p;TPQ%_-3=dFy^#m&J9?nWAXhzLJ=VT5kf0u^<$T8MMLcZ(7?{t;*!JX-%J8iIlE2>1y0!e04THqt;j`eWI^8j3-OQ&! z4(&|qNJJu}zYGp=JcHx1w?;4U4yU#V=o^pMiC;6%EA`F^>PMZ2 z+>N&4(38H|)b7QeRa!#T(fc0{cRcR6i+-oYt_sI=h~u}u;1F?dxBdpd$SKNo;f3sW zNs*OH%T30f`Fn80o`vyxf(XY}~aeKYM>TAj5aM0E$^;O1Poz0|&Ftjd3==+z z>(%Pi9w?qs77dCh{RH;i()n)V#+;L809&w*&#q*Z)wT-XkEpn}!BlmeZ7H=%`Q&x6 zh7zu=+KwtltY`i3Rd)`fOFqbzhsXg&b`5ZRDWF*nW$A3AU5Ptml>MG@1#^v+O6^8K$ z$tSZ5WR};+A(S- zA|7Z^?^ta1j{(<3<6eD(yylruyOE`^)K{l)7k!d`YxtTw*hO3Iy;JBtMK`OIX012D zvFbgSCF{2$YvACegN(-u+D+LJ!VXr$EO+R>a9BQj;)mp-s^HMEhPsg{zjsb`UYcck z$*G*$5VH9m3cnGlQd3ktk{{=+YTF{2b5f@@%npx;QXM!^y1#JNQsUYE`N;wuw{a+Z zFHni*&1uB}lVg!9oMRj3S1I!I_bdJu^tPE3I0mjj=$o~^F&7k{AIsGCzQR;EnjMky zW*!oh&`~LI9Dm$c!6AgA^?>gf6vB3-)?UQBY>TuUnEACFus+OXOdX(*{WD7LhGEA1 z>G{&O6Q#^m7A-a^ukGY_{Pq1!*uqYBL>O@2dcy-PE&Fqq#7FlbRKEw*3gt5TAzVA^ zsr&WdTMt!yGz44OAD-J*#sxapN(4urtn1p?iZ~UY>t4*JL)HfXtEk1@#nA(|F@-Jte z^_U3_%HKiSkEVGXgxU@{(;{o@V^k!~G&F0&jE@^RqB0fS_u$v8aF4I>o4S!jhS+pb zK#A79r_)T%QsJp_rrm5)?zcf5-8n6U*0br$1O<_^k?AZ+=o>F9vNi`{t%^glPoHFL zde$lC8ENiTcz$@E`SO-$R%e00>@Vx{*HYyqZTem>+HqXClR#qG3$g!uP3bfKah&vu zKj$?!S$SH-o5-PrJam=L+zR6jXt_PC|=+%cxAMY{u%wA*#T zLho}SWF@froI{(@dTWRI3(unrh)l$^bE^%t5Fgre?dP2gtGv?m)MLA<%)U}CWGsF> z3lJ0QM|1Ixssr~b;%2g!pS&m!{BA*mz+;F)1Kx(u1lXkL5pOJjC9AVk$%5~d*W-^B zxzk@Yc6i;hOp|S|1n~6a37gsF4*k))eQLHTlGmP3jfJW*pnM^SG?(zCi^rX~k@ZpR z;&_Kq*TTQlxfc70&DTz&#=nO$6a&Eb3d^%mri%4cj{|3cBaEQ zjPa3O;*3Zzze9&*I4=#>JBK*{Ds84zh34ijb3c8`-pL5$wkE%*k@)(C@)9#AUHA5} zPASKb3sFjo2gGsRd-_EXL2S4#(e;QRnyhIddF8Fr;}Gw=O>rD*n}U1lJw`k!_sH#b zWS_5a&F9q*G*l0%_XqB5TrYd)xkc*hjak)C@PpbIO_1)Note{E`P$_?b5<)*;#0Uz z=|bDyT51O^vY%IBC_em|2JuD%W@jc`Zv~VsUC$N?p}3Cc^R#l4YKli_BTj5^Fy3Lj~*w6YZN~)j3+sy?7TMKc(vywL=M)jL|Q`5 zJ+9VW4iK$EUAHMANBb?-LUp1Sb96M1rY<@+gwUs#^~DNty8Zp6c_zY&eZ&$^k7@ zbl6z|_Cy~=bI~_~ReHu&SD!H;)XJwoYHn#RS=Z4amVAi54YtQ$xCasRK(Q>KNVL8U zI4V);FnvcKTr&9U^EMnQlYYW()WKs`J@`h_TF1Y00&}YAMx4FOM^qrf9Gj zX<`TC)OLw7!y<-uRqoJCQW{-ffyjfL%lPROgiIslaH!-?Jdw>*fdNsUfR*mI-=eoA zwX-gV(kf*$$56f<0;j#f2@oSzVC)a9|kBp{yq$vo9DmxERj0R>0-sl9{?F%a|M`4PQ2DJ#IhXL$ieQA)YZEj?#X|uPRlXu5 zh~3D;Q$z0j#--kmoK<*KBV^#|@BVpu_TqX|A(uzvELuBrng)?%8p?855SdG0;e^XQ zxZSyv5afhB$~0BYzvK6l94F-hQW9vwcSrYgl%@fz#c*nFs?NHn9&BoM(wTH8Fr(Hq z?hq>4KO1!N6Cq-f4-wh03t)#MWK5UG81#s9zJ}E47pPGCTLs%(5ua5HEoS1w-FRxq z;y%>+w@=#$H)>jUzR};M%ZggX0l=jU@qi%Ky@D<;-W>?2R-SUYLf;QcF#T5IK(k!k zqe1VonUX0xTt|F7$yWeRO4_e4W7mp4kP)OG9GaUi)95VJ7?BnBTx#SlB^1Z;*K@m%N0|Rd zi(7U0TpQyt6CI{h+S!vL(Uw(XCUaIISd}R&-Ebz{pnSQ+O1`n+K{j2pB(R6a2TM^D zBpODPvMqw;eI<;WrjD448kDB)Z8x=G9&)!<6wi>ZFluwC*uI_)*G8C})xErAXcCg! zqn7>l2IHjrE;!9><%bG{1_HeaQ?Venl?Ma1VTkMMmOU4k&Rbz}RK~zc>)wYiT}WQM zD|V5`S(gU7^C@QGF`=n4nd9e7XiR?EeL06v+fmEynv8?5CQe@FKF^HMiU=s>oiV*E z=XmXc874}(K|DHlDzDX7_;SVezEy}{Sqby+;>vM6OX7hJs~C5LMw`)p!7ZIKp<(#@ zH^7*)F9ohH>vpvkm2lNk2rB>3#<(o~7jFp=(WaES)gfw1T&MMbg2HRr^=qpFnlva{ z)(cZc>{xlUyu8jQI2t1yEnGgV#mYs^P6dCn<%ZJpvam0OMs0R}c4e6FW+m)e>1i5T z$!IRz%_vxO5UK*{uC)&vVyNH$`0mTrWG~1W86h>`?ckO!lJT&>gvevW;U?)9_<42T z*Bt8JcDON#ONGmrpoDnj6y?ngM!+E0aOE-@j9H|OuE*U+C>c&=eZ;#o)ojqT^W>6% zed|9)15!S?y}^_rRg|Z5tsOrd;;bT$V}V?{5^`z8;3=CzKN#ap8@&&-BdlV|-0o>n za8sHZ?&RJ)s54q%85)1@dhZBbuVUdw>(rMjd=S>88uj9t_bpfG8CZJ$LTA*Q&3{7Hezx zd@Hx+z;7t(DrFq={m#ad#=Y3Oxi~pnz-6XKkDTKWw63fcF7q{_K}0X?Bw^wKzZPaa zCn5PPUl$luC`~(e#qap<2$A(x#!+eOY+>#<%@5{t2`hexn9@*jekTea+TpR}FAyJ( zLnJ+5CRxa@1WKoUjbhF|`MkP>4`7?#19C% z`%l1;ez{;8-p~!9quUU&06Qa{2RrMzQxwZp+S5{KgaSV0P!k@8P(vV0l1FE?@ErOR zrY1B(7)f>vAf!r3V$q@LUA@=q)W>tep*T`PoKb2Aap%82*`@s7y{+y=wE6zPyJC|%~2t7xk z03YyvQh&PM2(6#cL8+=@^{P;OK$sw1b5^rDdn@ujzu&{h%e=9v$bOmQ$pIeCQDnIl&WT zzvOcMKC;?k_h_RnZJDNDiQ~IeQts$_xscT9&;I;dBzzWhG}o>(fnntrboR7164m_K z90XN@OV00H3Qzwha!pSs9ocyfCp(ZxYc-28{3K?h5+PQvxcq(;Qe?u&zT1C=jQOrO z7PLHaApj2vVRUiXz#Ug;zq7#*?PbPWq+8~FPlF4zpQ#R*>234q(dAO+-20@KIfpsOD=>QZvWLbGqsfF z(h4Xk?IksiK)FX2&E;HJL9(La>IvpbUl<%h!K|0SJ*}OLBOAYeR??@T)~Q%QN(=SN z!LROnh@V|3fj?dtbcHqF$SKpG(klrL@)|PP3l{DBt>x6-dt9WPtymFAzBqiz_A*hv zEA?FJ^+gt2sDFii?D0S*!wa)#6UyjYql~uBm_N@?YF6m&yOUDZC6g|8wiu@bl}|p2NM1ah!T(qA`$;d4z~jkS^fJ(Sy?nSZDl!>J9Zk^NUHa?YYaL455bMNm~^lc7aLH@kL{+ODk6SeZZL&J_Zc1Nr*jL^b!B z*WTh#yN3tyBVxpoGcQSBJlmy>I`=WvcrPO~C(oS16g@R`#405F*^@;Ys-TK;2<6O3 zYR{MX!}BMMt)9kpEiCU#!Kg<>tlwi{!gdNGOi_#!HVrcMoN!#*YG}84D)7_Z;Mf`P z^?}`xLS(Zgo-p?5xJXv=GCmT&kotJPkA8DT&lhj+(r1NL+#->djfI@mMc~AviHxhh z&97E|F!1-gp9#rOJVJ-aOFIbzr=0W$*2dfLU~GhBh{H+ELtKi$IuE#p7G~>H6ITb9 z<@W1*y))+JVKe7vp6M;!qssI9+`Zan2M=ZbG&Z848bN+TY^RuvohYV!QlH1oIZb(JuAy?WaDI!wZ}(uUAne0H z;xKI+q5Ff$rgVGxdgWWYcR7@3P2Q?4|0Ljv7G`QJoNO_W@{T^Fyf@|Ni;An%?a=mp z6wFc&%??DohCB9#`&fD)ZoSGS&z$od ztj3X51tdi%*HRyE(;V2?xeu~AgpN8Fm0Qf*^%j@Jg)UsJ@&z$ho``<$B-ZFpt%am? z-KWV<&ZcXR4XmlH2*>2AVd-aLAHC!G27Od@i}HQGW7eVTD5DFP_CTAbUvQzt>cM{` zOR>)t?hy7)Oo=Dn(o63@j`HW;{LHc13~%=qNso2gi3aRqUg^JIEmVfy2>Lk#%rq#O zfgYb+_wzEgk5NjEkX2!qZ+xrpWbrP0;=Zqi!^s6$?$G{r&*PGH=vPSzjMAdD$wV$k ziJIBY)TVP;Z8G)UyS%qJxKw>9O%wdxe@w3G{59aToUA5)@TtkMJ7`?j#_5^%fQn(( zlE7ovtq!LVYKM3>sA1e?Vtq|T>qPzvMcrqIkhEa_>7xd(wrS>(CJod*CWR1*ZTXe$ zSa7|Id}`rXuT=dvkF!Tzx~2O{aNW>8KwCv?W*Wwv_uJ+kJ7DYJzMnY1YWZ`v&wJ>j z-53lJ2K_f+c;M3l9zxgJxtnM?Rd@&5A^I&EMw~vqzMF4alwZ_e`wQzNL6YXQs3iwo zq|@I^hSugg^Ts;I1L~iI%Ly|2FHjAPLWat7UORyW<*QD2b`w2uC8Gp7w4N)|z1Vp# zsz6Q*ON<4<0DQi3mlfNWq})e-2`%ba`G2#;Mg~ZJc4Ki5>w`p5x-XLUiqEu;p`jisdIbE)`-}GY}`bamFT{dy3Asl2R6bCTlVBPdg7PctRI=0};6lK1ouciyW)6yLG9T?N%q3&1kOh=J#9FX~MB32Kd%LKezFCdXP} zP-!K0lTEs;4*wT7LE*HOf#MW>tK`+qT8iOo@h5MLZ@st3e2scaJcogkWa5|Hw>^rX ztepY2whH)_{UO5G6JYI2V<~>X1 zfw;!24~_gF=?MObo$9O4ojQKZzeVKL>sUXSUV4Ssh)LHTnxuoxiN3L@1sP8CIo(fbivw2*jeZ&Xn_uXXf zJ#$*;m--mUFzU~K_oD4SDZWHL!Jk_Y$N%U-JZaet9A;zn9B*5Kccmnsvq0R#4vB& zeJ*M+jwoCcA^5r38|*eIp-$yzJP)tC%%~kZBJ)6e*g7Z`-B>}_T6%R#5$u=O*s$|f zQ6mOvAiplmpK>&l7N<8Vok*$k-x~S^-(CvbK7V)v5tZU2mqz-Uc%Upx(lQFU)}VD@ zP5FFys0c(2C>&bL#g9HXbJ3HAI$k;-Q1(vO)IMbB$)Yo(xgk{Ger3G6j$PHoP6&x^ zKzDU9HdKXn4ljPgF7YQs3*ygulbXtB%QtCj(5Maj#bo`Mb^nJ}Sd^Rxl|6pC-jb!i zu28Bl%m!NDz!e_$TW(pLz37>TJ7IE-V!X7*w@ zqDW+QV2>0uhsd%N8TlV)g{XFc3vS+f#nl%bw>Ty8lM%@oFK{NJd9Pf2Q8Ft~OCc+RSBS*F=2o9`>M8L8-;rc=o%wl{lq$Dc_C}1< zTbfR%hqdJN@>PlDJBUFZ+`dD>H5!J+^a%As<03)hh}F*gH7^;a1&xIRjc$Eo1~X@^yoh=H(Gud-vdEgEZ!9WSo;2fJ{3{p|du zwwU?iz)`ior@~tP$v^sE%`Oc0-+x>(mh3GK`IY;^MaLsgxQ88MB~^d@5~$0OQ<*vc z(-udpm=Fz!kj=jo%{Yy(&Gzj6evflX55su_vn?jvTr)Gtp{K57J&9(BvcC41G1Jwz z+<{%uIcjC>my5EH)aLs7O;@GEMKv%s&R`Krr2C@a@)Zkpl?87Djv7F=o0%`eZGEeH zJEGqA3~_tT(L}R!E%;>M-`blN<1Ld%_{O0igc6d3J67=+?ljkF^ zvw40NbL$4uRiUXdVS0=_+*7^Zn1G>69U2kRT>EDIdDrY~-n|6VfZje|qY&p6k+~d1 zsG|GQAead=?8=skGs!6mYc7dni899g*N>cnM(F9yOgc2r72fj%tz4h%9;G-Xi(Z8G zW8SRl^#+ki+umbi2VqDBiw|FMOw$=JS`JFcM9I!CI(~hids7BRs+?a1DCt{=o8B|5 z`W8D)@}!EboI!)D0ei1KVIvO&rUw=1`wnkz6vmNuI_JQKVG@TDA&f0?;B8Ji-(yaK zRfa{4edpt41s_X>)n((}9sGI5`&5Lb^lN_9(0!o<{({SLYQ$qrn6i(figmn`^+J;s zYA2Z=+0|vLZb$Z^Q<^bfab+iU44?C{H8!d;v_PLi0gOB0q4U^w!oUNxvNov{(bG~Y z?Kiz9w%LC#w`D{@eeSpGJkZ4|o@u)nB5u?g>|pd)w=~Is9tC~&PD6vF*bCch*pC9Z z^N`(SeXu~ulT4(R-i*xYr}Qb?dt5c2(6!Xy-w!CH@5S5r@%RWg%|+`)+|AcBlj;U7 z^2X_5+*34OZF=0<%p@eEff@R&0TGuf*+?$w+RyI|M9fpXu=LCn#^eM%UF)k|L{*o^ zpN${uzkIE~8q-`oN!{AK__Tf;t!Q5}`nvJp`>?$ZRt#RojLEt}`~nKJrJ)va_*{sDb z;rot9ft=dH8-0eg^-<;K^cdWV0g4QWSa*vW=c^9{Dk~{|gTjXFy(~vo4Tn96oU2-a zw#nBo*9Z^1DymDljEG_I1V_g$<9iaio*Zl&z1ji=8;_IU_Pn9lZ0@LS+QLtEtz<*o zcWQjY(F%!=h0LCb{>akBF1jq%!YT+KaZqdDcDv!GOjNzAQ@=aNz^4Q%R>*krMR0T1 z%GCW*7M_TGf5{cKO?4nvdWB5)#SR}??PRtC8VKax3>UG_rA=-{HUZ9Sy@k+1*ft=t zvy?XaUCc+%mu|_mOCJhZk@Qg!4pRzR6e!=gKrFx z-(ou5*_XaC3adVkzR%L2q=y_zKCddBRJ|Z)cma=`T8pFqQKy@Ye65d|hh$e6kYQ+zPE_@8zMhv>c zS3GT@wICyhH9yD!5aV~q(|ggkj_)FFn40Muo9Vxld2@f-_ngtqT`T+Gx`rQqD-opR z&+sDaGq9H?`*ZD+o@}7oo03JQl~WKh@d3ef1giqBCC4kg!e1B|^$~0%FbP_#J4fe6 zp%o1$#fUoY2Zq0g9Ji$`G8fT$jg`*QJ)2y+`m(D%ZubBR={>^)zq<(}NuZm-e1s`n zdY=n6*F4@SX(!))%~^jGAx{k3NaW{9*DCDLs84TB(yLexU>bAf%oeN?aNs zGi}Itq551s*xB8Ek~fueMF(1;ZlRvE$nQ?Al6FoCKR^E$Hbw)`QWLbq(NNnt=hn|F z>v#VxiVY8nK0Zx%t()ZlPV}|R@MhXf+o~!UncX zmvCY_I@Z}T+ZgAH=6n4YaOeu8CDMnV_WgWvGcdR<*7#;gB{A9TO2nQ>RRnwpHAGMN zZ$6AZ!5d?F2~YiWn)&5}c!Cu(+N#m@$yA8s+3_%1X4ELav0eqCXVB44x(nz2u-_Sxe;~#v#ep_e2 z9x6ZVUthw*vcke-+Y68B!=`pup@=}lR4~t^M6EC|KRv=VK4DBE!~&ZpSFV2GQy8dJ4RS|5c=obqp$XVKgm27g~+Xt zi;Iclum!bwiR3kb1-YFKG-#_j*n5x`vph6XqUc&FF8*u;>pdY#j|nLr@q5U&d4Gsil70 zdIbL~UU1M`U`0GgmaNV{A1my~uTfT(eE_T9t0953-nnDDiD>$QoH6+n;kwX29m)L@ z5|O#V^Uii*3y*6PC1Fs1csS5uzWcCy;SDn@CS)CLlS@x>8O}^mUVC^uu2{T70f&MJ z7)wy9dP1@y`1S2ZyevC*gA~ELs$Nwf2Db&W+ZOHXey8Ix_9B27UR&!F`e|m7uYM!? z4Vv{@-6Dw42|WA2INsWq=22?Lal-X_y9+3pb;(F`Q|aDUUzfF_?@K4)kcjt&?-i?i z&=-`vQO$t{h1p)ylC;4^&M0ksO9`yh`#txa0=!IP4_@fF8$akob8l9)1;SW+gI>#_ z`MDe{Ay^-uz_?=eg3}Q?c=cuJ$&8}PYm)(XMtSGP(NlrD5V__y7cYhO%pOVgV*PHx zgcCMX!iZc7Ua|jD#mB;|ci$bA{2|(AdxhL}+%G8AZH*6f*fP|I=VlDFuLI+~c#q38 zlX3l)DhDE)(hdh$b1dBFQ&?J-X851bT9A@p?Q2ZBtu_zj(&DUSNK@j~*6Gw=I?B;+ zal0qUWI`8c71_=Y?Z)Rw z_u~hzY&rR|;V50}i{`T&frZucd^=L+ivx>n1DRkOS>kDA&{1(5brlg`a^vkSf%JmI zXKL#T;=b82pjJsBy^(K&uaCYZt2vS%M;Pv2Q5HSs>OCfNui8YJ0glYd8JZZ5^Y#i25w|LKPm!wV!kKe(T-tE3ACk^!Wh?h-*iW2A!i(66OBF?rt%! zoyv&Xp2I|o-~E|eRe=mAY?#7=fFc~xvy1w=GM$c-rj4DGkcoHJu)^}`k^ZyLW+=Lh z^MIcIbT*ww`aX390i9R<)LFO%_UL7t<@0>CTHdEZ3sL-xIOK60%%0vjzc}k%0bAlz z{Zng^TG>51P@nUOjt#sXm~WFQ;ZQ>p-S!5=?7mWx`!j%YO|B z41S9PbBL~H19J#GjU33^PZ#%*^D~otRGY}G z`B%lWpedOM-QBpkv)t>GN|Vs9#-SwN{dshR=Z;&?*j3g*jSDH!1tS{rYQ)2sfDc|^9uTFnq zsGvcNY>Q2Vhr+qDA=qs= zmTmRX9Qolx0+}2VR>1~L6S=dhT+sAT**gjA%Y$YRp7?=&gkj7_&W9-4xN?)P2;1Bt z_h1Tvxt={LuC94xdQeRNfaV*awjr)_#TR1G%HNZUVF+e*WN+Zta5?W)Ww&hX=Vf z`1hKj&rENg!si*b3)OlNm{#L5)tSdzbXsGw>7pQjxX_}dr)hL3n;i3gzCf+JEbB7H z_#3bcZ%u0~{VMBSTC5HS=Z?7|&Z5b;%;UMaux=6T{}~2ZFYSJHLo(OCJ&+$6@-Pmg z{37mEDS;F5HZxv< ztX3Idt4)XE&W1=OiM^6sk%hm}qV?^b`3EoP`Q5=%Ar}zE@5a9((c9+sEV=5SI4)T! zHt0hwcbn&-vD;I8xViT3Vs8lCX89*?3zaA536Fl7{RHum7D=bbmeOP;trO-YbgUiQ zaG1Sg?U(!mj};OVdOdQI18YNMyS*dmJUjOibD^DwWcPtdHYHLn-+!(O)g5XIUe4t@ zMip)k|6TJgJ%&mryf?i1_A{@Hn80`H^d7+Iwt+L(%QU&#`fh>=IGMeH^;)6334^c- zSuvRZ#TQaNco_r{o(rU$%d^89K8}Ty2Q6s;&i>9XEMccDhTeh7 z5y|`eONt%9Cq}x~7=v|nNC#z|7UR=PHrFVQnk^z-rwWiG5oRJu>ZPUs{ zg^PGRX;yVwiQJMTy0WP#xtm!1d3Icd9uZgzxJXXJg#yRmVZw-LQ*Oa4y*ZL8K$tC0 zqia41?&k`!3>jIZ8~HXgE5vu3%7&FHW)VL>7fwSbo)*+O8wsT_F?9?E(Jq$u2*&j3La7>m6==Ccr=Bll*E5Fi8ZH!*aVEgeR zaopVHo-z#P1BZ?i_%pYU_Wpd{0`x(Ib;7I*r)ix0r7?(41H^5OPE?lb{1x&Gx6KnwZRM(e@AqeU@CFF>CXdji<}}NWJwoT=38~PA z-U11LPWcNzH)oB``XctM{Szu-SOXu1Ap!gb*bb}V0r&5!kR`21z*!&^hP=ECDa@{# zAlMJy2{+`~BmVY!Z@3WWj)EfgqIsR}3Rh>rVKy*-0VsoAN8blZZ*Ej%)BXN@)*anT zKhMS!1Q{{Y<-H5twf7mjOi$l>Z<^IsUBr&PZPVk_q+%}0OfgYM7W{zbVExJbfP!DW(M?xp`rD{N z9!B}(RNn$F={xCkEBhez7$!-O7|t^XsD|#-X-$V_JlP%`QDX1z$|IS7DN+fm#K@ur zC#v_5c?rygy2L~O5m63B(%bG|lmag5Gtdeq1H>(+oi7rrGG--oNO3gC{stU}e}C`( z4^C7zrKR-1-Dj;iI=833a$ur#z@Y7$cLXM>Rm$P-z!N&eY6wK=(Y<)mH7({Vc2&pK z=#ilcTn7Ua^TE$AJTN#TJ=sQ*Xs9QP74{OV&G`*Ph-`?^;LeOkeD~r9H9D%RB5)|$ z3T5dT(M&D8g@tzGIfJL`>^z;#+75w+%k z_RMrT-INZ%06~&qn=OW>E!di0C8{(vitCWTX0o8|MG(7rlgCb-Ec$c-$5Olq17Fyp zvT=7{1y2?QjZo`=zy;<&P!LflN8Pk8!aG)_ssPW@IH@)&;vtpDI%a zX`MBW`)~RVJUS*_x&zELMg&_ECvJ2tbw*^S3|m#jfTp?iMbxt#Ds<Ud z$&H2HrOiPs$eIZR#3)WV1(@CIY3&Q&z?D9Irnc6v7R(x<&~^+ih@y$rRHR|WVlLU1 zl{Tm#?PK*mfUG$warO2BuKl_DZrITxk_iZMD)@FuQ9k{uRX5|Q$@NUegQswF={L`E z5Ue6Yfs0W1V0fzPZv0Z?eJ_-B^OvKLL_g{Ws*z6 zEcX7`{wsjV{c1n{mAOUc(GHlIiO^s?JKX#_f#mDFu^}c2jZ-UNJi=6VUt7+;8y99p z{BPrkzpz2uC#UvCFqwttfn=A?gGaZGNd^nQf;m9$=5JEtZ7Bp$%u^m?p2Mm-#a-qQ9ufIW2Rr0afGO~r#33`-M2pF=~r@-xE1z(r+rGUM` zs{;Ff!D% z&07#N_xXk|q(Aw$vgzJUiTnO%7hvTOB6fqwq85hu5mWBgYE?&Jm$2(LH&xw!>!pPP zamH%FXTeyAL*;=PfgP(kBiKcGe$+9P^FLl{98Wrl(XAy0k8?#%_r;cDz2UimfwlEo z+V|jHq1zmUylAv?$d=ey0)BwNpYAYhE~m=k0@>lOXWm`V>buS5SpPK3sUVdXQ6GRa zF@E-cY`DV%*e;KKcj?o^Ne)aS9izL6s%jW(`@lO33?{H~{IMktatw&tcWN(aHJh6k z<-qF|3y>~Z0NYU`v{J(aq>kBlcSbz1WOBSrA>GmHUlpf=`UPH)Eo~`s`O#Bc5NDN2 zOWrK>R`}>NZpur@d(&S{7gHprPp?-j7E71cq{1<|FE)5i!-&pD|LjXEZwmhJ?MxxN z)GQI&v0MCY+IGB;Qp-dKY)qk6QSf2yts+HfT=z`_OC3ZStQsO#kb94i_vckxe#@g` z7!i=qnMZUU%vrJ_ItnBynHq(=P7z3>Jh=7UZ%qi@E#cq6+cZp`5J z+p6v$2oG=&3?xnqLe~imu7sNXNZ9E8c+RC7jzbLlpp$Q(r<2d51-VK*#Gn{JQ6rpi z;q7g0diH+Wq!PA5flYB zY8CpAF5plz^hE5NINsUt$ul@!Tfa1aPy+4QOH{?-=2qe&hNZ6Gl!JdkK$@jHP)BEt2jr%8VzjW$*8L z1*suwl|I;LR+2^+Wt*3!&kt^T0b8Ju8hU(-Y3K2qj0b`Xgll6^+=`rQqXlJ#8#>uS z?44`c7T9}bFY*lHNq!D~NP4;Af38j&k2jTVxhZ9A5^{~A>@I{_w_--XdZQSOpo`z? zZp=Yjx}>)D8)mtk^KM&kb9{oo6osTJ(##4$nP--TlIrt+-3~Gl^lmx`-^k}qd4XwH z&9D9Y8pGfkdnzBgifTkQFMU@&so*gP&GoOzZAbJF~Dx~Q|qT75rG>}>xSrSQ*kwX7pG{FhDH)oj&EN2BvD?h9y)+Cuba zA{h`+)rB6LDw+BUys-DoMd&o5XwUUrx-+{ZZ%o0c6q(Onrx&qnV6Rq&_7UdozwUm% zyLQbbfLUkb5|avzxr2kHV4#pb4fU*q%tf>wRU9=8pW_{_2&>4k2@W21kk5mT%V{8F zDJoN?<9X&C1{wuQ-=5KhIatyOdy-)bR`***m>ei#fpHl+xxyS{(5wXqQdq_%1FX zbL;-h_HRpvw4pmqiklE6>RWtjeGyP1*TkXiy#}7+ZBe&Reg0l*4E;x}pdmc-P`8pl z*psbsI^-HuGw2$;>YmT#&fwRPF|NYPEiW3(FBWo#d`<@tlcPNHmNeHr>QJS$R@LKL z2hLr#UXfDa#JBP7US4MaAlQ*XKDHY#y?A&_%UH+9C~$_~x<#=@UY&@Def3I?ZeL8^ z6#k$jQWbB2y{N8m0g%ZM-EVO1zrft0*+xCf z{4$xn`4%D+0|A&^VOn8IGZ?-U@GWUgi%)5uX1qu+Bq#ck4=&obSoL{$qKtsIaH=sc zguta4zT?a&cVI0MWGZ-;`*0?V~az(nKVC`1oT zlx0Zm*De-beyejwcJ9sRgK_q8%wPFu&*rjU3p(HI#lXRYOcCf5M)d-dq!*nzsAGGC-opCBF2mLfFCDhxEG}NLPE60s~pO^to zT$x7KJ}Y{|k8<37H!>6y@j!GxGKSO-4v+I)Wjad}(;V24ocRB=_vZ0Xw(TGAWhqP9 zg{-M0OP1_QBWod4_ClnR?1n5^hGZ$rog&FDS+Z8LGf}k2k{DSBWiZ8*eeFFi_j5n@ z@AjR??nd!9M*_xlDZNOCOIM*MzWUFNV^vFy$%=Ui`WER3EI3!e~#K$+=Xe#SXuN*X+jk^DcyY^ zc(xdGxwS!VEx-$0Ok|hI1s4qGtAH>K9DbD(aQDjjXY46p;wC{~9oLz%IF?sh)jgq0 zXQ>}PbvmyES(_q#oM2_Fn*^kbgLAl^wCa2BK&4tLuaOl6IDRZ~YWe{GC!3wa&<T85z`Et3fY+9kzR(6R;)^rGaT>sL^Yxtc<9EH$(0q+`}5PYkWICjZY5_?cniW(I%3uywpMnr^YrDZsF zN?iTw;?q*@_J~`D+idIUhm4Q5sYt5|7T@V0=af{!uz(lXVE`-)uD7QgK#*AgLfBW% zH(~M5AcTRu!MrGfzYoH;lK27JEv0rNgHvHgxm7sI(E<&i5ZLJL9E( z>ZMd*S&0l}A>=)O0DjI8Bf;^L`YMv;tExg>3|LxS34?ORrS$e}(6Qh~5k(b6o>a^Q zKH5p6`EryYr-g%5FqS77drA5C!=9OAf@xKvOJXSHK7SYq98TbVB2#R|dHS4|`u9Ni7XCLUBLmuPEb>bx9JUlb!Jqo{ z(cA>#wC~_baSCMG+>`I)1NT_v71K5zNNe*-qek4Iz)C!!P1m2po@;39(Szry3uveJ zXkPHSA!tnqZNH$eP&9FC_bw|@hFlux>mZoI#eRK$l!~wff+3F_`4wJ&`MJ>8daDg1 zLXiQr5+V|-^e~uE$KWU1dfQ;bfK}j$sa6%Kn~9`CwP29I;DXmJN%D?Z1m$VgN)zh) z0RxvYq~p2MKKQJ^;HBx??8SilnHNLwoNyV{$*iB`mkcPcv>y`KbfOq0GbfCZVAmF# z%Z)`o!w~VSw+*-5p^52CVNw3IP2E`i#JaaJz`YV)Eq0T9M4SyZ$TO$kkyz2E+p7Y>s|Ztx*HOjp(_d znOQy}hEDs$cn-TIoLsH*vR(1fMhDDM(cVISKk6xkvh+xq+Bt}!xcnRPXw3~Vdxulbsvw@GP_Px z({ue+&p=+^f5bP1UFKOFyYdzl!nI$53O@tIBe0b` zbbVj`9!^7a*FIid@Op|i=C^=Tvv(`Ykk$iIj8E{_uFd)@cJ1XOi=VGsnLOmCLWnBG zZ^)IeAG992V5ndRk=@la?t?W~cJ!UNDKM|P7)#^$N|g_>=LA)%uJf1k(L(aElhj!P*EGgepu42itrN-wQxzHg*y#PWp02)`iJ8Nc&tg9A{ufsry zB(IN*DeDjKk*GZ5J)BAvM&VK*F^%Vm*nE=R^Zk~vyt&!dKG+g?0b;r7g?P-G{(nJeN&1Bp_x!?_9q&nF?}8siHQ!{1^R#$ z)h1YP#VTkn45rtPT-k3V;WbNfO*8Qm^p+|jI4JuyTat_T9o)dPlzX;RN=OVJeMdOM zl>P)-x_=}A$gMMnQv_cvL!w4b0b&AoX18!Ms&S}a|Bh8~C>;FJ(1p_zh_CCPp{O_h z=dN5!A3l)t{8(GG+eHE#WCSh?d4V7 zjIWF?DzZ27xaf+wC)Q$&TiN5btwF!B_VWB%LISyMXqtJxUGylmX5$_oN+y69a84qo}#yOi!~#&Z1Q^WDB1%D|xMAL$;9%%U)j< zQ}41_l=U8B$ig<=DV=HsSLT$@@Do~fJWbSMmjfem)tYgcgQ`#U_j8+!yw@u-%Rm4< zlmJZGqI_H&JmFy*$NFf`%wcB&J*pq8(v1!1cgm`0Ar0PkUHGdm#SW6zJ%I9Fp*1Bh zene2;_^J51x7oQLI1~4+X*iYu z;H+V(l_N=+-|y$qwDUY)beFM8d^6_z>$Ae%^)1u_f)rm3Ao?RE3v-i-rMXlH`66;| z;vqYNl|jlc0U9jb49qNWeLOPPPz*=%9uN&(^}$1HMqX^+=YMwV8d_-Jo!rVeTpNM>a7EaAp0DihHljO=jdBUKB2QFX_LJP9z?>QVp|NR*{P za4vfhi$nisLx+5abeRP>^8fNF-SVzaVvP;FYV)Q>BG7{I%5~-0aovLJsJH&{GN`KBMEMpAM{wk`5 zQB>#d7aLMpsQsp~ci)Mi@*$}8>fWb{fs{vQXV(1XT6tn9tEYT4JoNU)Kg{8j4EU(v zqpM^L&Uxj@xGh_CJ#Kv@%iPX?xHN|r&jPb!tRB%II;ceC3LiIz@J5lVQ3xA8HKFX= zz%A&hG&cVbZg0qIf?v;wTKV-gMf&VVRPG;%6qSQS2-0ls96270qhqateJ6Hm=I3%ZPwQ~zWu2!G2ioU2=c&6wj9lVHs@86sgR5}hUFy=VT)+A=%1<$A?F&} zOqdJ_IYQeZR~zFoPB!WHlppI)eQKP1pIKk^)t=-|{-n z?e)>~u#Ca3Z0I7JV)KFV6zaH0*BxEXS3?ZOvgLuDA0S}t*;!{HbMd3Zs|1Vg6}_R3 zoyZE>yqwR0Pd&x1({%0o-q0Qx+SDc-i7%$CZv5?E`w#j^yr=As%HfnhdLms5O^FNE z8p9s*7=F91ACGrHa8AV@KbFf{Aj>rh>5JnE--T(A=ip@9i_wPVgRI>VroFmhL_QW9 z!mFBhHj16wwsXf7l2SzHEww>!$}a)lNBPFt2SEF)7ai8Dd=e-#=xcF|8D&nL=pFXM zXZ!CV1zxi|{|=(=?4wsNJh>M>sTUIsxm)R$GD-fr-P#4F<|@` z9bwmbr3p&&oL~{(hg?c;W&VCiq(l#$NaZcou?*MN!-@+GC~7DgI5T@_s22FC<|Htr3(PNo^~b_l)0&=R zQDaQEw5QL!QK*~SmID%~e8KuASljn$0{%X45V~`L@y2DPAA_;##CnWvs>Oi02KA8&; zbRP()6f8S?u0OM7;Tgzq(yw|Nq|}3IAid`!8NnZf5W}h-rE^*1;7_ydRZ;4w?v?&k z7o(B>3Hw^()k5mzU+mib>ORV4c7zkm(r2B`y|x}#tcqJtfR5|=R-SPBDd$fLCS$IV z8I8{k2v4b}z(8ZZ!0pN{_1!@5X7D=&&0V+7S++XU=Zq?H8R~FORAkJ}JpJuKzcW;k zpq(MI712Jb;j$E0sk>4iP@C!40hjvZY;&Vy+*x%lR zXgCa@9z~!_5j1#-X)dg{Ix;FjxUuz%`!{xLb~$vWC}b|PlQD%mHGf^@NXPj;0_4^u z%lf9w17CcIovRl_W5nB!J?9di-(*MWl3K+A%h^){r+l7d6>Lp4m{~iiT4x8c`Dw8t zZoW0n>&uFtfFfz-6)Q%G`-Ram_FP((x<5$ehkFzCZTMQ(`&o=A6<}2%#KoF;V<{6E zsE7aO8HRC&xYXTa(gG**vAop!Lo$b=N~=eBnIzCuj8wBKL)BC8&LH#Vh$XDo?|?XG z;hY&jxP?~y?)@?!Lyv#E@5w9;QI%r_Q0KTOW$+m^)H&`;+bt>@9Wq+o-cl`DMD>FM zb0O{rC5P>*^K77;2Z;4JLv7#mi2J1VbkSHHHFC|9aoBD3{26K@2Z;f}sw4Pb^oGDy z{7TzB$N!)FmYavk3+B84=34 zeEFYqB!DSESnA6t%+Y9hA6a>=LX#DYMk}(A^*`MpJayje;?eM_gt$(AIE^oy<^+10 zmhIEjqJ4=aEZ%kQPqjf6*@vBtxIwk?epd&s6MBUD(8xlD3m74FUo=KVbD^y@zjW#} z!`OT;93`0q#jdO{vIR^9oOSeN9il>#59(HPvQkJO@ zcgSiTH{HHj%!smrg##5FLLUy1-d6t#kT(POlClgQNrYZFTO^LUj9mM4U!Sk$#=C*~ zwt(Zz3T1pI;NP(IRP<=exOkwreRE3+&Sl#kMbhoG|%F4BO@i@39Y zGnr`Fkd_}>TD*oar_O88U{ zyN-}w`=moVS1;~oFk|L(L6MGOm~hqg)+V{uu8jjy8Do`47WJDpep|=zhr*ze;sduj z_uk}ArFx()K~rvrR`1Zf&hh8aQRBrMemYkENO6p__1QKpvH4hqkLJL+0&Jl z+@kFS8bGhqg?vf6hzYHsv>&`hQ7IJ(bMBNwikJC`>fjDQ^9t?>Lr&*@hMWWq_gmd# zA(^T>ME6*yv%@NrX@~GYF>>Bb+Z#3$z1zIf64(-K)N0ZE{1DFNJhJ6k0yDDFMJ8bp z=#0*(xB;o!knY91QKck7NamHG)G7<00I{N31q;l#CPV$=pr+~WY$eh7X7!s+UsUW5 za|YZlIGfcmY26)&;IB+}qdV+lIH+)} zhnW`t!2;Axf%|-IDjKs(pgUin1ub|`D17yP#|XkH?4T0zvhLO#@!dQ@f~&z9F42F9 zc^A3Z)nzZ1C zL}nj@8}c;wz?$S)owUf~dpP31Wv|aEy6)~SH?i#;-k1Bg4mHFM$uwCjfeF;GW0BBI z!dxI<7Ab7j1P#GQ2vX@7?(kJ7eX+qJFfJsd_BwQC0(=K~dN3Npr@8R3^|_2{$@JPu zTcP~Y<*c1T20E@$tIX$8NWb3j(*Zb==~e$)P~+s_Vf}4wsPVR?%rs4#WcN7EMbAFw zyCy<;NajL_Qs{(T7YHe**ZNymBlq>F_y)U15j8jxrg;S8`D%*>WOBq?3?&jPK5#Ru zX7=>kkiPMPQ9TB}Kw-MetH5{#1h>36xX#;gj-PCm)jH3O*t~C%MsQC-tjn*3Pd!(G zo2YW1+&ieU{}-#?XawIb$rP{mENN<2ol6a28YZx_KMZRze?RuBF?C9i0pxFdZu3SM z_FBE2&qsQj3<3;TK}E(a`#iR{K&P&>FQ-%NfF*QO@JEfM+Y@OwT{o*v$Tcpd?TL9e;6mmx>PE4D45 z=cJ!cMr;3sLDVw$)#C@|Gx#>(oGG`-u``dyG=e=A`5hrYNHCjzKS~Zc=mI)IMhNk2 zSu_X7jd%{su?*TZ2;u6T=o02C6F&0lX6CJllvJXM5-TRZvZix&4>)I9XTrrnwWGIu z^)2SR=}lkBay>X4@izHQF?0o1ZspS=ls4AeeR($o^Gmr6Z1E|bP$bwrF%qY*2l82m zF>cu9$)t7)x5VvN)X)<!0i5nn=49xH8MEV_5R$H zV;{qwOXau)*k_!Rc&Wbqf+Hi;x6iknYone6lj@m!=@?plv9mZ$TzgzI34WcuzE&~p3<`D1I$E1W^8n6*k6RiOfnKIP;1UqI zflJkV8_F+=wCM?Moq4dZbA|cg$^Xzq#$=K*4p(QdVv~#akMILTs1bwoS?aBmW7a~* z>^*ImTd;yw0c|u{gRevB`CzmiL6$w#Pv1nitNto?`uE@yr?O!Nz1znJ;SeL@&z3da zJBmNt2F}6f*LUvY48bR;?t#?$-(*RW3ZGgp_fm^O^T2H9gZ zTg4t7yQB|%BG5b+_&UGpMip21=4Ua?{)>){4h|8W&X*fMj-ef)r^^WCPP7T&N5J4^ zA5A*U_Ab5qC3YZ`eoSqHhVl&CF2|4SCxv_9Yg!Jv>_O4Rem1aTFB*|CAHTqjoHBpH0Moo|XzA^{0o` zXD|D|c>i44E&Y743KcFCm77LviTRG2fO7$Z!+x9#trN7f#S)R z3CBF2qvCA#T22=4v=rVxQO@~@axpf!;|NRy#dV@uMyZtZK((^dY^klsl=qZ-UloNWL%I#0R4d4 zZ+E7Sr4MfKK6(sPf|1hcS3jv?Vl^#ySlRcaEOA{1nU2DfjGcB=NahB*_jK5)_P+N! zRyT~%a|8In7i1(Rxz;!Mt8!Bq;oL6x^|~Bd&q_;F4J4A)34wSg0L+hH-e3IY>1tsO zHqQ4jLeT_GnbOZ1{_^1pc;z%3WKXm}uBt#@dkehj71B}%fdqp0{8&co34M(~(c?Wk zh!V9~1n9?-xSNEp*@;|5-(ApdPrp{9vY?)yec%{Al_Ar#!DI{zC)u*NkMN5Eo4k_K z!}|gF8NS!5mIP@hq<$T;BKCs+@t|ZD?mZTMah(-UYtdSNq8D;bX&#SvWk98Cqxdk@ z#tZ~oNC9!6V^M&DHdv~_&(HJP-S19}13fV31AMku!0!y21ys6|;XJzN#Y^o5J zv&p3AdC}ldU7kA2Qf?-)-|kjt;TKj+)e@|iqQ}6p_R6wt2Z|CPnc*@a+B7&r%})Mg!OPJpyEpI9&_^I*x!TrHg?;fr)1ikCps2*&Z1*jw+?w!f`yRoKc z7_ap%j`)LjEps!6mXd%nrF}MSSJ)^$()UJ?HlC_ev+A|qYL)s1DW$XNhsLJU-uT?& zAw=>G`pSW1$0>a9=@{L9pd(ZIIjW3lVABs?+~=u$VBNb>59(1^IMUvNk=r-|$_&}{ zf=Qa4CL~!4DOa>+@Z3#QbDOnEJAlau9_*wn|A=Zb!Kxu#Q1C*yu1q!lIMVjPYi3Ou zD(P|(Y!w2{Bx{v|GlUbo9ogH`I1l;4csii05h75n2TcSigjW?^IhB~@q;Y;~jbjx% zA7s8tMR56$>cs8fRUNMV@`7J1qB|@AvU(W8V%jxZpJP?4kkqB9>oO40{3ue6cTps` z;T7sB4N^<{@D*J}FP>%kI=`9|2|0vVeANIy?lNz4R36z@M(X74=+BF1;?;&{!n*HA z`}h7#OJ$OF)*ssmQ%UiO_sgqx&!N~;N$231ha5y+fGInj{#ilXoAdI!qriHxp-`Rk z%C}T%oHcq!%>sTE0^znW&AdZ*qibw&pFE>Fk(Eui4SNlcp9d~-Xu&=a!-bhZru`@~ z2Y0!|=$0K-k^L{hmjm^`qpQ%Ia6-`T?b)75C>P@gE{WijQAGHzGmuEGwqsl#cX4E) z-U2J~@f}kp)+8yz&m{Yu03z4LAb^O=((W-NSl-AUdFC_s9UuIHTSsX9;YLgTyw>VCG)~E zg@_j$#mwJ1%)e}AL;%%@yYiLNb(H*#$`e5{N+R~rd)9$o>sZD&)gP=pwyrl>e}ZO8 zB+}{i3H7=BF+#(#4~)&HkzoT9UGSOJQ_@!B{iFVrR!m3O0=rfrbiuQgwWUA8eKy%% z{7_PPRC{0>03_70(3VC$wbzGC$hHLdDiN5ogCh7Q~cP8;CA zkA&EAKO_t!9w-WSKdK=kSS34}F|Rm2>xy4*A_daoy3uzsWrb)L1a#avKYMTgICy)C zKB+rquu#JT@K_0=TKTul`Pn~c3zuruSWH{|7abmk5ht@#3*k4xbg0bHjNUL0pZq*9 zj2T}2VyIKE?$8+eb&RQiHZW`IjsoI1X7y%lsBgz6e)(BViGE@8>Rd+YxS`dk$3){Hx%IJm zH500B_{`OIFYX$0?odEQ`^J(N^Wz7~epc5jSUN5DkDKRX&q1g%zNJ(HV%QZ)VAXQ6 zMOl&(p-_ORQc#2n*eja`V}tiy_m^?lBdq{>4ajI*>cpvR+p&^2%D~W)0tK-1v1_&c73utK7?+n_z`B(tLt%bRrz*1T zLpynWlR`cc!t&5#PWiXLrYyqJgI+?uL}2e(8=n&i(MN+a@tgdH@=pE^`iy+7aEOgl zReSq#P@$5m5v8T3BmqV%z?`~TUzVWYB=mtLCts~~_&QbQay~iMEscg;^>*wsE255C zWQ+0YJ3m;@suk)bEqTqNuNpLOyHcI%714Nz3OW6YF>2hk@F|uxw?|?*si#?GeUy%FIrn;Y7?0_J5kwNysv94Bp>W6)|Ard# zo%WZOuFcFB(Ry;P_x#Xj3Vzu_9U5t>Qy(<{+wH*kk4Oy{$7*U%X%KxYG28A(_q6t< zFCO-4e3(0^Vnhz~K)?^T_jyx!h)E5lEXM^C=rA+|7Xb1Mp38ynw|pL9$Jt45Hsc(h z$5Q+R^|oy0$PvFoM$U84ldcxTUgdN}S(tfk@kW4mkS%wg>L+g>154x5M{EC6+suH4CK8x70rW8(lcU)sY-OzGYaQwSa+b#3Ux5r{H zE+*i576$BrGFfuqp7_@HnqLDXJ_6@EFM50l@Dom20OFpliMX5kx)z#;(<_pA1h?el ztt4Kd!pwCoc9ysNAe1{0o_C57M{xlMfv@IiVq4&{yd@noug8%H>{Y(nei$0!A)qF{ zDpKkV?5>yHfW)Pm)^dECj*Ogy5_v^<(}R7i@3&WL>?!(y!|vRJS8hw(oL>5#+sL{$ z_Ab*`?o%c>%kDJz2y|l?n6f8^7QMXh)?Ulho)+<`vCB=EJ4V|vc9RIP7?LDra9kUO zN#W=OwDxhPJaF1Iqi%^zK*M42*Y$=%i)n_?IlXCs!hzrKS&2p>Z{3BOr)*qt^iPzg zf3?Pxs|4ke4@5m`fz>`w6H}A*&|ryZECRXy$p`nd2CzG21lN1q1|CV5ouhlq*ZNyQ zTJxRKMnIo1GK9uO)$dq!j%fJ>9eC69Y9acL5$o83u9#Q1$Xh=e!rqRsN9Dp0-y9z{ z=%2`o^8$fd?%L${=USKb1u@MPGM#K$db}ej^1NzrLhv!l75eQCAV~gcTPgSjr)kkA zj0U@Mg)rtnsHWF!b9sj- z_9D!s!G$pV87=GYd=^P-(>8wN=C|UH-%YBVJVy9GT0nW28l)RQT~6PQ(k>Z`H{YBP zyRbp{5Zbu=R>;ek+6&>H)z1X+5wsA%BUahtswwZ=pfSa!?m8zCNycMNrIT3gYbQR` z_dmI`71XcEL}i8IH|*uLc{cOlF5-lr@Hu|#3!RIitlfW42?*Q4vAwfzx7klupzb*F zwu|5xlf4+&*>_tsr|K+njc$z2X}_GI!zY4%Kyvw1l}Hdo^{YGWb$k}VwAX&0KR5(P zsF;J$1J%pu3UuLo_)q?N*~Zok_Gjtl9q%Qw4;8;&eIp8KZOIPQkxv0U?4YM93vS2M z+WZHILPqwFbGk#z7J^qBPAfPAr5~ixD>|ARlD1*6leQXKey1U6iC5+?TNXc9d_=6o z(LApTh+X3_?a=odPPeMVPc%pqU zy_r4uPTnD5t9{t;YBz(55pJgY)w3gpyxGR9t(`j%C9vPf6@`fI3$+;UetBx5Cig2W zi4#s$J?cWAZJL1kOMMY7zNai0v#7xI__6ggjlF>?+@J}hy&=mlr;3c$OkHneP;!E!+Ka#O zRZ2n=FXgIH)kpADOQ*U3e+hR)3>5z`@a(kIloflzX;eQoq9kIi(M2 z1A8`b#EGA}eyE4eT+c8A6NDVft&>+cjILEwIV!y0Zk+#M1sCl#=&(1)aEKrkZ(i;B zROi#_Rob{z?``6bQRzccQbC5w4>v<^i$X+)i8fs5h&u>33V}Snqh68<$qJr(HD5yJ z%%b9hisu<>&mq}V&UvNGns0j-R62TBBhP(Po7sijL$NkE5!KoKC(`POk*xcV-vj*c z%`fTz#6>=wZl*Dm42`8mx-weI`<{=`oJ(xR7?z|Z5CdGaI`3BAFqYi4<%;dsdp&)7 zv?^f`a*})rvQUCB2F;r@9n0L6Y%<(oGS&(tLnLFQdL(UuS8-P$z=M(L#-YBN!MUS{9>fF3o4>l&Y2?G|V!8TRLVf z!xBb=d@cb&v9uP$C6%|Gom*w}+>mWlpRYU~L%u-&JahWFKNlV2>A4EoBY zEb&a35l?Bg!a*$~f$20B^?p7VRzGoi<;a2HYWc@s#)l#$Z=qX-BWHBfHJp_U?^E?!Fk%+GIN#nJ%BaZQT=j)>y^S6Qqqy6ii*{wcudFs>VHO|X~ ztAmIWF;|=I;NE~6p5LoQVpBxByRvk@C}`~ZD(ndZG{n3@V$2z&cT-p2ZmD6O>uOsVq#8ziAYBp5GJ&s8D1XvUL=Nn=Tez!L zg<4f4BNrSXd=J5~tVP4=8?tf+y%S&j(IH;`CxYt_%S3<0Ig07N7V8*(|KL{*CNv|c z?Oclr^Y)B1%VI%KHR-Cx* zN2T9C_&*kKz9!!rFAozM$_fF!U2v7Yw6nR<}&>qx|XL@5T@Tf6h~$=QEDljk@IQTKCoT7VG|G-U;2~yYl#9irzauK>eGChUw z^XU$VxHpfk*;)NI;T)$S=%=y%sm<28s^p#a*Nv*V+zLmIP?-e`kvA4M zFIcVD^_NthLhkffg}?dLxXV{i?zx?Z-1i&6d^HoBYbCJiliR;*=2vne#HNtglMso! z4v6Tn^mK>qAnTHr(*Wv~tRG9$|C?g^hMj_cIiZjc%%gmzIfQ3r%XhqzdZdlA@nsTe zUFI#l<+$NClTlt56CLVUTR3I3tUUK^2*|&78T>ZPU}g@JX~-3?Ar-w_Lf>;!S<`7G zKaN#n>4IU?+fPb&14pZL#-3cIpDQwz1W!kPn8rbYA!T>$ro>KWM$-$p&)ylB&CkK& zzM-$V|NFsj2r_ja=#UMJY0I5cY^^c2#WCYe=^@P+Qn2fjP(usNU_Ml&!?b?xZh+QL$KAmaSB-Q=G#Z2mQceus> zJOynj!fX5nX*7`jPle&Oh<$a)@q;JnB4xgTxBj2U{(6~L#;L~FWEDetc#8-Q{4}Cw zxDQdHfjAU`>czjGEGf6No3m9`9ljZ5!;U)vRR{-*J^2^&V5Np`&y9vh-v8Y&a=PhL z@QX9ciE)rD~j(@$z`>5gVa{ziKA9aKDo>`=%3|LoMB zEj7g*v5vt8*-5G)3NjG8+UtQ+FqM9=KlA7*_NL~0i*_D%+luAy?+l%-O;EhJKy^uE z|HzF{I>byDsDJwIh)=ts)_rEj>4xN1)oIWh|9S8)@2~LRQIh>W@cBHnQxqKpKcT=% z!(cR1uL&zy96vqz&nKapSrAdck4r+iK=QTM@=sb_X@dmT!Dq6TgZ*LdcK}gwNMA?O ztcg$V-|s->7iI7A)0Srf`F=VuzBrt2&I(xIf1gt(=>P9;v(=k&dmV+dtT*fpR5~5) z$pK#Oe;=H64D{Yxe7|-sP$wul_}28P8FBfl&3~^H(*6eMIniN+I$8!>D0G7tZRXZYr^{tlw#7y$a{sQ=y1FO zrS4z<&sx1G9Z$z?iVdvr=Pd(%5Yk-9yrq7>XPW|^`vUw5J@G$}RV>Q#xE;>pWQI|X z^`3-Ay_hoXC0T~He?J2!IEbF$e9vowFr+a5eOyO0;M@Q6;C7)O{hvo4==VR*@qgw0 zKY#xVW&i(qwtw+|{_p8x;= diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index 49a53b649..d11cdbd7e 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -32,7 +32,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio :maxdepth: 2 :caption: Contents: - release.md + release cuda.core cuda.bindings cuda.pathfinder diff --git a/cuda_python/docs/source/release.md b/cuda_python/docs/source/release.md deleted file mode 100644 index c73f21ef4..000000000 --- a/cuda_python/docs/source/release.md +++ /dev/null @@ -1,18 +0,0 @@ -# Release Notes - -```{toctree} ---- -maxdepth: 3 ---- - - 13.0.1 - 13.0.0 - 12.9.2 - 12.9.1 - 12.9.0 - 12.8.0 - 12.6.2 - 12.6.1 - 11.8.7 - 11.8.6 -``` diff --git a/cuda_python/docs/source/release.rst b/cuda_python/docs/source/release.rst new file mode 100644 index 000000000..c97e508c4 --- /dev/null +++ b/cuda_python/docs/source/release.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +Release Notes +============= + +.. toctree:: + :maxdepth: 3 + + 13.0.1 + 13.0.0 + 12.9.2 + 12.9.1 + 12.9.0 + 12.8.0 + 12.6.2 + 12.6.1 + 11.8.7 + 11.8.6 + diff --git a/cuda_python/docs/source/release/11.8.6-notes.md b/cuda_python/docs/source/release/11.8.6-notes.md deleted file mode 100644 index c67b71bcc..000000000 --- a/cuda_python/docs/source/release/11.8.6-notes.md +++ /dev/null @@ -1,15 +0,0 @@ -# CUDA Python 11.8.6 Release notes - -Released on January 24, 2025. - -## Included components - -- [`cuda.bindings` 11.8.6](https://nvidia.github.io/cuda-python/cuda-bindings/12.8.0/release/11.8.6-notes.html) - - -## Highlights - -- Support Python 3.13 -- Add optional dependencies on the CUDA NVRTC wheel -- Enable discovery and loading of shared libraries from CUDA wheels -- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) diff --git a/cuda_python/docs/source/release/11.8.6-notes.rst b/cuda_python/docs/source/release/11.8.6-notes.rst new file mode 100644 index 000000000..9d726c5b0 --- /dev/null +++ b/cuda_python/docs/source/release/11.8.6-notes.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 11.8.6 Release notes +================================ + +Released on January 24, 2025. + +Included components +------------------- + +* `cuda.bindings 11.8.6 `_ + +Highlights +---------- + +- Support Python 3.13 +- Add optional dependencies on the CUDA NVRTC wheel +- Enable discovery and loading of shared libraries from CUDA wheels +- ``cuda-python`` is now a meta package, currently depending only on ``cuda-bindings`` (`see RFC `_) diff --git a/cuda_python/docs/source/release/12.6.1-notes.md b/cuda_python/docs/source/release/12.6.1-notes.md deleted file mode 100644 index 9a812afc9..000000000 --- a/cuda_python/docs/source/release/12.6.1-notes.md +++ /dev/null @@ -1,12 +0,0 @@ -# CUDA Python Release notes - -Released on Oct 7, 2024 - -## Included components - -- [`cuda.bindings` 12.6.1](https://nvidia.github.io/cuda-python/cuda-bindings/12.6.1/release/12.6.1-notes.html) - - -## Hightlights -- Internal layout refactoring to prepare for the `cuda-python` metapackage ([Issue #90](https://github.com/NVIDIA/cuda-python/issues/90), - [Issue #75](https://github.com/NVIDIA/cuda-python/issues/75)) diff --git a/cuda_python/docs/source/release/12.6.1-notes.rst b/cuda_python/docs/source/release/12.6.1-notes.rst new file mode 100644 index 000000000..a882ffea6 --- /dev/null +++ b/cuda_python/docs/source/release/12.6.1-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python Release notes +========================= + +Released on Oct 7, 2024 + +Included components +------------------- + +* `cuda.bindings 12.6.1 `_ + +Hightlights +----------- +- Internal layout refactoring to prepare for the ``cuda-python`` metapackage (`Issue #90 `_, + `Issue #75 `_) diff --git a/cuda_python/docs/source/release/12.6.2-notes.md b/cuda_python/docs/source/release/12.6.2-notes.md deleted file mode 100644 index 96c90e2ad..000000000 --- a/cuda_python/docs/source/release/12.6.2-notes.md +++ /dev/null @@ -1,12 +0,0 @@ -# CUDA Python Release notes - -Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. - -## Included components - -- [`cuda.bindings` 12.6.2](https://nvidia.github.io/cuda-python/cuda-bindings/12.6.2/release/12.6.2-notes.html) - - -## Hightlights -- Resolve [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215): module `cuda.ccudart` has no attribute `__pyx_capi__` -- Resolve [Issue #226](https://github.com/NVIDIA/cuda-python/issues/226): top-level Cython source files not packaged diff --git a/cuda_python/docs/source/release/12.6.2-notes.rst b/cuda_python/docs/source/release/12.6.2-notes.rst new file mode 100644 index 000000000..b091fe1de --- /dev/null +++ b/cuda_python/docs/source/release/12.6.2-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python Release notes +========================= + +Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. + +Included components +------------------- + +* `cuda.bindings 12.6.2 `_ + +Hightlights +----------- +- Resolve `Issue #215 `_: module ``cuda.ccudart`` has no attribute ``__pyx_capi__`` +- Resolve `Issue #226 `_: top-level Cython source files not packaged diff --git a/cuda_python/docs/source/release/12.8.0-notes.md b/cuda_python/docs/source/release/12.8.0-notes.md deleted file mode 100644 index a5df49da2..000000000 --- a/cuda_python/docs/source/release/12.8.0-notes.md +++ /dev/null @@ -1,21 +0,0 @@ -# CUDA Python 12.8.0 Release notes - -Released on January 24, 2025. - -## Included components - -- [`cuda.bindings` 12.8.0](https://nvidia.github.io/cuda-python/cuda-bindings/12.8.0/release/12.8.0-notes.html) - - -## Highlights - -- Support Python 3.13 -- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) -- Add optional dependencies on CUDA NVRTC and nvJitLink wheels -- Enable discovery and loading of shared libraries from CUDA wheels -- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) - - -## Known issues - -- Updating from older versions (v12.6.2.post1 and below) via `pip install -U cuda-python` might not work. Please do a clean re-installation by uninstalling `pip uninstall -y cuda-python` followed by installing `pip install cuda-python`. diff --git a/cuda_python/docs/source/release/12.8.0-notes.rst b/cuda_python/docs/source/release/12.8.0-notes.rst new file mode 100644 index 000000000..6634c4ea6 --- /dev/null +++ b/cuda_python/docs/source/release/12.8.0-notes.rst @@ -0,0 +1,26 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +CUDA Python 12.8.0 Release notes +================================ + +Released on January 24, 2025. + +Included components +------------------- + +* `cuda.bindings 12.8.0 `_ + +Highlights +---------- + +- Support Python 3.13 +- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) +- Add optional dependencies on CUDA NVRTC and nvJitLink wheels +- Enable discovery and loading of shared libraries from CUDA wheels +- ``cuda-python`` is now a meta package, currently depending only on ``cuda-bindings`` (`see RFC `_) + +Known issues +------------ + +- Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. From b003a925259b74111714780de769e2f3ff927112 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 25 Aug 2025 12:27:11 -0700 Subject: [PATCH 061/113] Add `pygrep-hooks` in `.pre-commit-config.yaml` to catch common mistakes in `.rst` files (#899) * Copy pygrep-hooks from pybind11/.pre-commit-config.yaml * cleanup stray whitespace * Clean up cuda_core/DESCRIPTION.rst (piggy-back minor grammar fix) * Clean up cuda_python/DESCRIPTION.rst * Clean up cuda_core/docs/source/interoperability.rst * Clean up cuda_core/docs/source/release/*-notes.rst --- .pre-commit-config.yaml | 10 +++++++++- cuda_core/DESCRIPTION.rst | 4 ++-- cuda_core/docs/source/interoperability.rst | 2 +- cuda_core/docs/source/release/0.1.0-notes.rst | 2 +- cuda_core/docs/source/release/0.1.1-notes.rst | 4 ++-- cuda_core/docs/source/release/0.3.0-notes.rst | 2 +- cuda_core/docs/source/release/0.X.Y-notes.rst | 2 +- cuda_python/DESCRIPTION.rst | 10 +++++----- 8 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01595f8ca..db3968dbd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: language: python additional_dependencies: - https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl - + - id: no-markdown-in-docs-source name: Prevent markdown files in docs/source directories entry: bash -c @@ -39,6 +39,14 @@ repos: pass_filenames: false always_run: true + # Checking for common mistakes + - repo: https://github.com/pre-commit/pygrep-hooks + rev: "v1.10.0" + hooks: + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal + - repo: https://github.com/PyCQA/bandit rev: 2d0b675b04c80ae42277e10500db06a0a37bae17 # frozen: 1.8.6 hooks: diff --git a/cuda_core/DESCRIPTION.rst b/cuda_core/DESCRIPTION.rst index b9b3a6027..57229460d 100644 --- a/cuda_core/DESCRIPTION.rst +++ b/cuda_core/DESCRIPTION.rst @@ -12,7 +12,7 @@ cuda-core: Pythonic access to CUDA core functionalities * `Examples `_ * `Issue tracker `_ -`cuda.core` is currently under active development. Any feedbacks or suggestions are welcomed! +``cuda.core`` is currently under active development. Feedback and suggestions are welcome! Installation @@ -22,4 +22,4 @@ Installation pip install cuda-core[cu12] -Please refer to the `installation instructions `_ for different ways of installing `cuda.core`, including building from source. +Please refer to the `installation instructions `_ for different ways of installing ``cuda.core``, including building from source. diff --git a/cuda_core/docs/source/interoperability.rst b/cuda_core/docs/source/interoperability.rst index 1f47dc409..2d3657abe 100644 --- a/cuda_core/docs/source/interoperability.rst +++ b/cuda_core/docs/source/interoperability.rst @@ -38,7 +38,7 @@ exposing their own stream types. To address this issue, we propose the :attr:`~_stream.IsStreamT.__cuda_stream__` protocol (currently version 0) as follows: For any Python objects that are meant to be interpreted as a stream, they should add a ``__cuda_stream__`` *method* that returns a 2-tuple: The -version number (``0``) and the address of ``cudaStream_t`` (both as Python `int`): +version number (``0``) and the address of ``cudaStream_t`` (both as Python ``int``): .. code-block:: python diff --git a/cuda_core/docs/source/release/0.1.0-notes.rst b/cuda_core/docs/source/release/0.1.0-notes.rst index e954ce79e..701a90461 100644 --- a/cuda_core/docs/source/release/0.1.0-notes.rst +++ b/cuda_core/docs/source/release/0.1.0-notes.rst @@ -20,5 +20,5 @@ Limitations - All APIs are currently *experimental* and subject to change without deprecation notice. Please kindly share your feedback with us so that we can make ``cuda.core`` better! -- Source code release only; `pip`/`conda` support is coming in a future release +- Source code release only; ``pip``/``conda`` support is coming in a future release - Windows TCC mode is `not yet supported `_ diff --git a/cuda_core/docs/source/release/0.1.1-notes.rst b/cuda_core/docs/source/release/0.1.1-notes.rst index 85b22bf41..5434d726e 100644 --- a/cuda_core/docs/source/release/0.1.1-notes.rst +++ b/cuda_core/docs/source/release/0.1.1-notes.rst @@ -45,10 +45,10 @@ Limitations - All APIs are currently *experimental* and subject to change without deprecation notice. Please kindly share your feedback with us so that we can make ``cuda.core`` better! -- Using ``cuda.core`` with NVRTC or nvJitLink installed from PyPI via `pip install` is currently +- Using ``cuda.core`` with NVRTC or nvJitLink installed from PyPI via ``pip install`` is currently not supported. This will be fixed in a future release. - Some :class:`~LinkerOptions` are only available when using a modern version of CUDA. When using CUDA <12, the backend is the cuLink API which supports only a subset of the options that nvjitlink does. Further, some options aren't available on CUDA versions <12.6. - To use ``cuda.core`` with Python 3.13, it currently requires building ``cuda-python`` from source - prior to `pip install`. This extra step will be fixed soon. + prior to ``pip install``. This extra step will be fixed soon. diff --git a/cuda_core/docs/source/release/0.3.0-notes.rst b/cuda_core/docs/source/release/0.3.0-notes.rst index 7e3bfce29..379559e6c 100644 --- a/cuda_core/docs/source/release/0.3.0-notes.rst +++ b/cuda_core/docs/source/release/0.3.0-notes.rst @@ -32,7 +32,7 @@ New features - :class:`~_module.Kernel` adds :attr:`~_module.Kernel.num_arguments` and :attr:`~_module.Kernel.arguments_info` for introspection of kernel arguments. (#612) - Add pythonic access to kernel occupancy calculation functions via :attr:`Kernel.occupancy`. (#648) -- Support launching cooperative kernels by setting :attr:`LaunchConfig.cooperative_launch` to `True`. +- Support launching cooperative kernels by setting :attr:`LaunchConfig.cooperative_launch` to ``True``. - A name can be assigned to :class:`ObjectCode` instances generated by both :class:`Program` and :class:`Linker` through their respective options. - Expose :class:`Buffer`, :class:`DeviceMemoryResource`, :class:`LegacyPinnedMemoryResource`, and :class:`MemoryResource` to the top namespace. - Before this release, the internal :class:`Buffer` class had an ``__init__()`` constructor. To align with the design of cuda.core objects, diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index bc8c8a054..40fece768 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -19,7 +19,7 @@ Breaking Changes ---------------- - **LaunchConfig grid parameter interpretation**: When :attr:`LaunchConfig.cluster` is specified, the :attr:`LaunchConfig.grid` parameter now correctly represents the number of clusters instead of blocks. Previously, the grid parameter was incorrectly interpreted as blocks, causing a mismatch with the expected C++ behavior. This change ensures that ``LaunchConfig(grid=4, cluster=2, block=32)`` correctly produces 4 clusters × 2 blocks/cluster = 8 total blocks, matching the C++ equivalent ``cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32))``. -- When :class:`Buffer` is closed, :attr:`Buffer.handle` is now set to `None`. It was previously set to ``0`` by accident. +- When :class:`Buffer` is closed, :attr:`Buffer.handle` is now set to ``None``. It was previously set to ``0`` by accident. New features diff --git a/cuda_python/DESCRIPTION.rst b/cuda_python/DESCRIPTION.rst index e00114871..785559e57 100644 --- a/cuda_python/DESCRIPTION.rst +++ b/cuda_python/DESCRIPTION.rst @@ -10,22 +10,22 @@ CUDA Python is the home for accessing NVIDIA's CUDA platform from Python. It con * `cuda.core `_: Pythonic access to CUDA Runtime and other core functionalities * `cuda.bindings `_: Low-level Python bindings to CUDA C APIs * `cuda.cooperative `_: A Python package providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels -* `cuda.parallel `_: A Python package for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc, that are callable on the *host* +* `cuda.parallel `_: A Python package for easy access to CCCL's highly efficient and customizable parallel algorithms, like ``sort``, ``scan``, ``reduce``, ``transform``, etc, that are callable on the *host* * `numba.cuda `_: Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. For access to NVIDIA CPU & GPU Math Libraries, please refer to `nvmath-python `_. -CUDA Python is currently undergoing an overhaul to improve existing and bring up new components. All of the previously available functionalities from the `cuda-python` package will continue to be available, please refer to the `cuda.bindings `_ documentation for installation guide and further detail. +CUDA Python is currently undergoing an overhaul to improve existing and bring up new components. All of the previously available functionalities from the ``cuda-python`` package will continue to be available, please refer to the `cuda.bindings `_ documentation for installation guide and further detail. cuda-python as a metapackage ============================ -`cuda-python` is now a metapackage that contains a collection of subpackages. Each subpackage is versioned independently, allowing installation of each component as needed. +``cuda-python`` is now a metapackage that contains a collection of subpackages. Each subpackage is versioned independently, allowing installation of each component as needed. Subpackage: cuda.core --------------------- -The `cuda.core` package offers idiomatic, pythonic access to CUDA Runtime and other functionalities. +The ``cuda.core`` package offers idiomatic, pythonic access to CUDA Runtime and other functionalities. The goals are to @@ -38,7 +38,7 @@ The goals are to Subpackage: cuda.bindings ------------------------- -The `cuda.bindings` package is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. +The ``cuda.bindings`` package is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. The list of available interfaces are: From 17e09bfa57a713a6aca616e1e86998db7b579600 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 25 Aug 2025 16:17:47 -0400 Subject: [PATCH 062/113] Fix #789: Remove cyclical import between driver and _lib.utils (#865) * Move param_packer.cpp -> param_packer.h * Fix #789: Remove cyclical import between driver and _lib.utils * Add a test for cyclical imports * Only raise on cuda.bindings modules --- .gitignore | 1 + .../cuda/bindings/_lib/param_packer.cpp | 159 ------------ .../cuda/bindings/_lib/param_packer.h | 146 ++++++++++- .../cuda/bindings/_lib/param_packer.pxd | 2 + cuda_bindings/cuda/bindings/_lib/utils.pxd.in | 28 +- .../_lib/{utils.pyx.in => utils.pxi.in} | 131 +++++----- cuda_bindings/cuda/bindings/driver.pxd.in | 11 +- cuda_bindings/cuda/bindings/driver.pyx.in | 198 +++++++------- cuda_bindings/cuda/bindings/nvrtc.pxd.in | 3 +- cuda_bindings/cuda/bindings/nvrtc.pyx.in | 6 +- cuda_bindings/cuda/bindings/runtime.pxd.in | 7 +- cuda_bindings/cuda/bindings/runtime.pyx.in | 242 +++++++++--------- cuda_bindings/setup.py | 1 - cuda_bindings/tests/test_utils.py | 28 ++ .../tests/utils/check_cyclical_import.py | 40 +++ 15 files changed, 530 insertions(+), 473 deletions(-) delete mode 100644 cuda_bindings/cuda/bindings/_lib/param_packer.cpp rename cuda_bindings/cuda/bindings/_lib/{utils.pyx.in => utils.pxi.in} (91%) create mode 100644 cuda_bindings/tests/utils/check_cyclical_import.py diff --git a/.gitignore b/.gitignore index 656dd8916..a9e5941f6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ cache_driver cache_runtime cache_nvrtc +cuda_bindings/cuda/bindings/_lib/utils.pxi # CUDA Python specific (auto-generated) cuda_bindings/cuda/bindings/_bindings/cydriver.pxd diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.cpp b/cuda_bindings/cuda/bindings/_lib/param_packer.cpp deleted file mode 100644 index 6f99c29e3..000000000 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -#include -#include "param_packer.h" - -#include -#include -#include -#include - -PyObject* enum_module = nullptr; -PyTypeObject* enum_Enum = nullptr; - -PyObject* ctypes_module = nullptr; -PyObject* ctypes_addressof = nullptr; -PyObject* addressof_param_tuple = nullptr; - -PyTypeObject* ctypes_c_char = nullptr; -PyTypeObject* ctypes_c_bool = nullptr; -PyTypeObject* ctypes_c_wchar = nullptr; -PyTypeObject* ctypes_c_byte = nullptr; -PyTypeObject* ctypes_c_ubyte = nullptr; -PyTypeObject* ctypes_c_short = nullptr; -PyTypeObject* ctypes_c_ushort = nullptr; -PyTypeObject* ctypes_c_int = nullptr; -PyTypeObject* ctypes_c_uint = nullptr; -PyTypeObject* ctypes_c_long = nullptr; -PyTypeObject* ctypes_c_ulong = nullptr; -PyTypeObject* ctypes_c_longlong = nullptr; -PyTypeObject* ctypes_c_ulonglong = nullptr; -PyTypeObject* ctypes_c_size_t = nullptr; -PyTypeObject* ctypes_c_float = nullptr; -PyTypeObject* ctypes_c_double = nullptr; -PyTypeObject* ctypes_c_void_p = nullptr; - -PyTypeObject* ctypes_c_ssize_t = nullptr; -PyTypeObject* ctypes_c_longdouble = nullptr; -PyTypeObject* ctypes_c_char_p = nullptr; -PyTypeObject* ctypes_c_wchar_p = nullptr; -PyTypeObject* ctypes_c_structure = nullptr; - -void fetch_ctypes() -{ - ctypes_module = PyImport_ImportModule("ctypes"); - if (ctypes_module == nullptr) - throw std::runtime_error("Cannot import ctypes module"); - // get method addressof - PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); - if (ctypes_dict == nullptr) - throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); - // supportedtypes - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); - ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); - ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); - ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); - ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); - ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); - ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); - ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); - ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); - ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); - ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); - ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); - ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); - ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); - ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp -} - - -// (target type, source type) -std::map, std::function> m_feeders; - -void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) -{ - if (target_t == ctypes_c_int) - { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int*)ptr) = (int)PyLong_AsLong(value); - return sizeof(int); - }; - return; - } - } else if (target_t == ctypes_c_bool) { - if (source_t == &PyBool_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((bool*)ptr) = (value == Py_True); - return sizeof(bool); - }; - return; - } - } else if (target_t == ctypes_c_byte) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); - return sizeof(int8_t); - }; - return; - } - } else if (target_t == ctypes_c_double) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((double*)ptr) = (double)PyFloat_AsDouble(value); - return sizeof(double); - }; - return; - } - } else if (target_t == ctypes_c_float) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((float*)ptr) = (float)PyFloat_AsDouble(value); - return sizeof(float); - }; - return; - } - } else if (target_t == ctypes_c_longlong) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((long long*)ptr) = (long long)PyLong_AsLongLong(value); - return sizeof(long long); - }; - return; - } - } -} - -int feed(void* ptr, PyObject* value, PyObject* type) -{ - PyTypeObject* pto = (PyTypeObject*)type; - if (ctypes_c_int == nullptr) - fetch_ctypes(); - auto found = m_feeders.find({pto,value->ob_type}); - if (found == m_feeders.end()) - { - populate_feeders(pto, value->ob_type); - found = m_feeders.find({pto,value->ob_type}); - } - if (found != m_feeders.end()) - { - return found->second(ptr, value); - } - return 0; -} diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.h b/cuda_bindings/cuda/bindings/_lib/param_packer.h index c69f47498..96c56b4fe 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.h +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.h @@ -1,12 +1,152 @@ // SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -// + // Please refer to the NVIDIA end user license agreement (EULA) associated // with this source code for terms and conditions that govern your use of // this software. Any use, reproduction, disclosure, or distribution of // this software and related documentation outside the terms of the EULA // is strictly prohibited. -#pragma once + #include -int feed(void* ptr, PyObject* value, PyObject* type); +#include +#include +#include +#include + +static PyObject* ctypes_module = nullptr; + +static PyTypeObject* ctypes_c_char = nullptr; +static PyTypeObject* ctypes_c_bool = nullptr; +static PyTypeObject* ctypes_c_wchar = nullptr; +static PyTypeObject* ctypes_c_byte = nullptr; +static PyTypeObject* ctypes_c_ubyte = nullptr; +static PyTypeObject* ctypes_c_short = nullptr; +static PyTypeObject* ctypes_c_ushort = nullptr; +static PyTypeObject* ctypes_c_int = nullptr; +static PyTypeObject* ctypes_c_uint = nullptr; +static PyTypeObject* ctypes_c_long = nullptr; +static PyTypeObject* ctypes_c_ulong = nullptr; +static PyTypeObject* ctypes_c_longlong = nullptr; +static PyTypeObject* ctypes_c_ulonglong = nullptr; +static PyTypeObject* ctypes_c_size_t = nullptr; +static PyTypeObject* ctypes_c_float = nullptr; +static PyTypeObject* ctypes_c_double = nullptr; +static PyTypeObject* ctypes_c_void_p = nullptr; + +static void fetch_ctypes() +{ + ctypes_module = PyImport_ImportModule("ctypes"); + if (ctypes_module == nullptr) + throw std::runtime_error("Cannot import ctypes module"); + // get method addressof + PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); + if (ctypes_dict == nullptr) + throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); + // supportedtypes + ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); + ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); + ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); + ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); + ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); + ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); + ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); + ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); + ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); + ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); + ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); + ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); + ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); + ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); + ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); + ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); + ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp +} + + +// (target type, source type) +static std::map, std::function> m_feeders; + +static void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) +{ + if (target_t == ctypes_c_int) + { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int*)ptr) = (int)PyLong_AsLong(value); + return sizeof(int); + }; + return; + } + } else if (target_t == ctypes_c_bool) { + if (source_t == &PyBool_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((bool*)ptr) = (value == Py_True); + return sizeof(bool); + }; + return; + } + } else if (target_t == ctypes_c_byte) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); + return sizeof(int8_t); + }; + return; + } + } else if (target_t == ctypes_c_double) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((double*)ptr) = (double)PyFloat_AsDouble(value); + return sizeof(double); + }; + return; + } + } else if (target_t == ctypes_c_float) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((float*)ptr) = (float)PyFloat_AsDouble(value); + return sizeof(float); + }; + return; + } + } else if (target_t == ctypes_c_longlong) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((long long*)ptr) = (long long)PyLong_AsLongLong(value); + return sizeof(long long); + }; + return; + } + } +} + +static int feed(void* ptr, PyObject* value, PyObject* type) +{ + PyTypeObject* pto = (PyTypeObject*)type; + if (ctypes_c_int == nullptr) + fetch_ctypes(); + auto found = m_feeders.find({pto,value->ob_type}); + if (found == m_feeders.end()) + { + populate_feeders(pto, value->ob_type); + found = m_feeders.find({pto,value->ob_type}); + } + if (found != m_feeders.end()) + { + return found->second(ptr, value); + } + return 0; +} diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd index 82b0d9497..ad7fd9566 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd @@ -1,5 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Include "param_packer.h" so its contents get compiled into every +# Cython extension module that depends on param_packer.pxd. cdef extern from "param_packer.h": int feed(void* ptr, object o, object ct) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/utils.pxd.in index b66ac71f0..d317e69e8 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxd.in @@ -6,7 +6,7 @@ cimport cuda.bindings.cydriver as cydriver cimport cuda.bindings.cyruntime as cyruntime from libcpp.vector cimport vector -cdef class HelperKernelParams: +cdef class _HelperKernelParams: cdef Py_buffer _pybuffer cdef bint _pyobj_acquired cdef void** _ckernelParams @@ -14,13 +14,13 @@ cdef class HelperKernelParams: cdef int _length cdef bint _malloc_list_created -cdef class HelperInputVoidPtr: +cdef class _HelperInputVoidPtr: cdef Py_buffer _pybuffer cdef void* _cptr cdef bint _pyobj_acquired {{if 'CUmemPool_attribute_enum' in found_types}} -cdef class HelperCUmemPool_attribute: +cdef class _HelperCUmemPool_attribute: cdef void* _cptr cdef cydriver.CUmemPool_attribute_enum _attr cdef bint _is_getter @@ -31,7 +31,7 @@ cdef class HelperCUmemPool_attribute: {{endif}} {{if 'CUmem_range_attribute_enum' in found_types}} -cdef class HelperCUmem_range_attribute: +cdef class _HelperCUmem_range_attribute: cdef void* _cptr cdef cydriver.CUmem_range_attribute_enum _attr cdef size_t _data_size @@ -42,7 +42,7 @@ cdef class HelperCUmem_range_attribute: {{endif}} {{if 'CUpointer_attribute_enum' in found_types}} -cdef class HelperCUpointer_attribute: +cdef class _HelperCUpointer_attribute: cdef void* _cptr cdef cydriver.CUpointer_attribute_enum _attr cdef bint _is_getter @@ -60,7 +60,7 @@ cdef class HelperCUpointer_attribute: {{endif}} {{if 'CUgraphMem_attribute_enum' in found_types}} -cdef class HelperCUgraphMem_attribute: +cdef class _HelperCUgraphMem_attribute: cdef void* _cptr cdef cydriver.CUgraphMem_attribute_enum _attr cdef bint _is_getter @@ -70,7 +70,7 @@ cdef class HelperCUgraphMem_attribute: {{endif}} {{if 'CUjit_option_enum' in found_types}} -cdef class HelperCUjit_option: +cdef class _HelperCUjit_option: cdef void* _cptr cdef cydriver.CUjit_option_enum _attr @@ -83,11 +83,11 @@ cdef class HelperCUjit_option: cdef int _int cdef cydriver.CUjit_cacheMode_enum _cacheMode cdef vector[char*] _charstarstar # list of names - cdef InputVoidPtrPtrHelper _voidstarstar # list of addresses + cdef _InputVoidPtrPtrHelper _voidstarstar # list of addresses {{endif}} {{if 'cudaJitOption' in found_types}} -cdef class HelperCudaJitOption: +cdef class _HelperCudaJitOption: cdef void* _cptr cdef cyruntime.cudaJitOption _attr @@ -101,7 +101,7 @@ cdef class HelperCudaJitOption: {{endif}} {{if 'CUlibraryOption_enum' in found_types}} -cdef class HelperCUlibraryOption: +cdef class _HelperCUlibraryOption: cdef void* _cptr cdef cydriver.CUlibraryOption_enum _attr @@ -110,7 +110,7 @@ cdef class HelperCUlibraryOption: {{endif}} {{if 'cudaLibraryOption' in found_types}} -cdef class HelperCudaLibraryOption: +cdef class _HelperCudaLibraryOption: cdef void* _cptr cdef cyruntime.cudaLibraryOption _attr @@ -119,7 +119,7 @@ cdef class HelperCudaLibraryOption: {{endif}} {{if 'CUmemAllocationHandleType_enum' in found_types}} -cdef class HelperCUmemAllocationHandleType: +cdef class _HelperCUmemAllocationHandleType: cdef void* _cptr cdef cydriver.CUmemAllocationHandleType_enum _type @@ -132,12 +132,12 @@ cdef class HelperCUmemAllocationHandleType: {{endif}} {{endif}} -cdef class InputVoidPtrPtrHelper: +cdef class _InputVoidPtrPtrHelper: cdef void** _cptr {{if 'CUcoredumpSettings_enum' in found_types}} -cdef class HelperCUcoredumpSettings: +cdef class _HelperCUcoredumpSettings: cdef void* _cptr cdef cydriver.CUcoredumpSettings_enum _attrib cdef bint _is_getter diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in similarity index 91% rename from cuda_bindings/cuda/bindings/_lib/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/utils.pxi.in index da38dd450..0a9f2e4e3 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in @@ -6,42 +6,39 @@ from libc.stdlib cimport calloc, free from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t from libc.stddef cimport wchar_t from libc.string cimport memcpy -from enum import Enum -from typing import List, Tuple -import ctypes +from enum import Enum as _Enum +import ctypes as _ctypes cimport cuda.bindings.cydriver as cydriver -import cuda.bindings.driver as driver +import cuda.bindings.driver as _driver cimport cuda.bindings._lib.param_packer as param_packer -ctypedef unsigned long long void_ptr - -cdef void* callocWrapper(length, size): +cdef void* _callocWrapper(length, size): cdef void* out = calloc(length, size) if out is NULL: raise MemoryError('Failed to allocated length x size memory: {}x{}'.format(length, size)) return out -cdef class HelperKernelParams: +cdef class _HelperKernelParams: supported_types = { # excluding void_p and None, which are handled specially - ctypes.c_bool, - ctypes.c_char, - ctypes.c_wchar, - ctypes.c_byte, - ctypes.c_ubyte, - ctypes.c_short, - ctypes.c_ushort, - ctypes.c_int, - ctypes.c_uint, - ctypes.c_long, - ctypes.c_ulong, - ctypes.c_longlong, - ctypes.c_ulonglong, - ctypes.c_size_t, - ctypes.c_float, - ctypes.c_double + _ctypes.c_bool, + _ctypes.c_char, + _ctypes.c_wchar, + _ctypes.c_byte, + _ctypes.c_ubyte, + _ctypes.c_short, + _ctypes.c_ushort, + _ctypes.c_int, + _ctypes.c_uint, + _ctypes.c_long, + _ctypes.c_ulong, + _ctypes.c_longlong, + _ctypes.c_ulonglong, + _ctypes.c_size_t, + _ctypes.c_float, + _ctypes.c_double } - max_param_size = max(ctypes.sizeof(max(HelperKernelParams.supported_types, key=lambda t:ctypes.sizeof(t))), sizeof(void_ptr)) + max_param_size = max(_ctypes.sizeof(max(_HelperKernelParams.supported_types, key=lambda t:_ctypes.sizeof(t))), sizeof(void_ptr)) def __cinit__(self, kernelParams): self._pyobj_acquired = False @@ -58,14 +55,14 @@ cdef class HelperKernelParams: raise RuntimeError("Argument 'kernelParams' failed to retrieve buffer through Buffer Protocol") self._pyobj_acquired = True self._ckernelParams = self._pybuffer.buf - elif isinstance(kernelParams, (Tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (Tuple)) and isinstance(kernelParams[1], (Tuple)): + elif isinstance(kernelParams, (tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (tuple)) and isinstance(kernelParams[1], (tuple)): # Hard run, construct and fill out contigues memory using provided kernel values and types based if len(kernelParams[0]) != len(kernelParams[1]): raise TypeError("Argument 'kernelParams' has tuples with different length") if len(kernelParams[0]) != 0: self._length = len(kernelParams[0]) - self._ckernelParams = callocWrapper(len(kernelParams[0]), sizeof(void*)) - self._ckernelParamsData = callocWrapper(len(kernelParams[0]), HelperKernelParams.max_param_size) + self._ckernelParams = _callocWrapper(len(kernelParams[0]), sizeof(void*)) + self._ckernelParamsData = _callocWrapper(len(kernelParams[0]), _HelperKernelParams.max_param_size) self._malloc_list_created = True idx = 0 @@ -75,44 +72,44 @@ cdef class HelperKernelParams: # special cases for None if callable(getattr(value, 'getPtr', None)): self._ckernelParams[idx] = value.getPtr() - elif isinstance(value, (ctypes.Structure)): - self._ckernelParams[idx] = ctypes.addressof(value) - elif isinstance(value, (Enum)): + elif isinstance(value, (_ctypes.Structure)): + self._ckernelParams[idx] = _ctypes.addressof(value) + elif isinstance(value, (_Enum)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) (self._ckernelParams[idx])[0] = value.value data_idx += sizeof(int) else: - raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(ctypes.Structure), type(ctypes.c_void_p))) - elif ctype in HelperKernelParams.supported_types: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(_ctypes.Structure), type(_ctypes.c_void_p))) + elif ctype in _HelperKernelParams.supported_types: self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) # handle case where a float is passed as a double - if ctype == ctypes.c_double and isinstance(value, ctypes.c_float): + if ctype == _ctypes.c_double and isinstance(value, _ctypes.c_float): value = ctype(value.value) if not isinstance(value, ctype): # make it a ctype size = param_packer.feed(self._ckernelParams[idx], value, ctype) if size == 0: # feed failed value = ctype(value) - size = ctypes.sizeof(ctype) - addr = (ctypes.addressof(value)) + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) memcpy(self._ckernelParams[idx], addr, size) else: - size = ctypes.sizeof(ctype) - addr = (ctypes.addressof(value)) + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) memcpy(self._ckernelParams[idx], addr, size) data_idx += size - elif ctype == ctypes.c_void_p: + elif ctype == _ctypes.c_void_p: # special cases for void_p - if isinstance(value, (int, ctypes.c_void_p)): + if isinstance(value, (int, _ctypes.c_void_p)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) - (self._ckernelParams[idx])[0] = value.value if isinstance(value, (ctypes.c_void_p)) else value + (self._ckernelParams[idx])[0] = value.value if isinstance(value, (_ctypes.c_void_p)) else value data_idx += sizeof(void_ptr) elif callable(getattr(value, 'getPtr', None)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) (self._ckernelParams[idx])[0] = value.getPtr() data_idx += sizeof(void_ptr) else: - raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(int), type(ctypes.c_void_p))) + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(int), type(_ctypes.c_void_p))) else: raise TypeError("Unsupported type: " + str(type(ctype))) idx += 1 @@ -130,7 +127,7 @@ cdef class HelperKernelParams: def ckernelParams(self): return self._ckernelParams -cdef class HelperInputVoidPtr: +cdef class _HelperInputVoidPtr: def __cinit__(self, ptr): self._pyobj_acquired = False if ptr is None: @@ -138,7 +135,7 @@ cdef class HelperInputVoidPtr: elif isinstance(ptr, (int)): # Easy run, user gave us an already configured void** address self._cptr = ptr - elif isinstance(ptr, (driver.CUdeviceptr)): + elif isinstance(ptr, (_driver.CUdeviceptr)): self._cptr = int(ptr) elif PyObject_CheckBuffer(ptr): # Easy run, get address from Python Buffer Protocol @@ -160,7 +157,7 @@ cdef class HelperInputVoidPtr: {{if 'CUmemPool_attribute_enum' in found_types}} -cdef class HelperCUmemPool_attribute: +cdef class _HelperCUmemPool_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value @@ -175,7 +172,7 @@ cdef class HelperCUmemPool_attribute: {{if 'CU_MEMPOOL_ATTR_USED_MEM_CURRENT'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT,{{endif}} {{if 'CU_MEMPOOL_ATTR_USED_MEM_HIGH'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = driver.cuuint64_t() + self._cuuint64_t_val = _driver.cuuint64_t() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -206,7 +203,7 @@ cdef class HelperCUmemPool_attribute: {{endif}} {{if 'CUmem_range_attribute_enum' in found_types}} -cdef class HelperCUmem_range_attribute: +cdef class _HelperCUmem_range_attribute: def __cinit__(self, attr, data_size): self._data_size = data_size self._attr = attr.value @@ -215,7 +212,7 @@ cdef class HelperCUmem_range_attribute: {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,{{endif}}): self._cptr = &self._int_val elif self._attr in ({{if 'CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,{{endif}}): - self._cptr = callocWrapper(1, self._data_size) + self._cptr = _callocWrapper(1, self._data_size) self._int_val_list = self._cptr else: raise TypeError('Unsupported attribute: {}'.format(attr.name)) @@ -240,13 +237,13 @@ cdef class HelperCUmem_range_attribute: {{endif}} {{if 'CUpointer_attribute_enum' in found_types}} -cdef class HelperCUpointer_attribute: +cdef class _HelperCUpointer_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value if self._attr in ({{if 'CU_POINTER_ATTRIBUTE_CONTEXT'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,{{endif}}): if self._is_getter: - self._ctx = driver.CUcontext() + self._ctx = _driver.CUcontext() self._cptr = self._ctx.getPtr() else: self._cptr = init_value.getPtr() @@ -260,7 +257,7 @@ cdef class HelperCUpointer_attribute: elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_DEVICE_POINTER'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER,{{endif}} {{if 'CU_POINTER_ATTRIBUTE_RANGE_START_ADDR'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,{{endif}}): if self._is_getter: - self._devptr = driver.CUdeviceptr() + self._devptr = _driver.CUdeviceptr() self._cptr = self._devptr.getPtr() else: self._cptr = init_value.getPtr() @@ -269,7 +266,7 @@ cdef class HelperCUpointer_attribute: self._cptr = &self._void elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_P2P_TOKENS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,{{endif}}): if self._is_getter: - self._token = driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS() + self._token = _driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS() self._cptr = self._token.getPtr() else: self._cptr = init_value.getPtr() @@ -287,7 +284,7 @@ cdef class HelperCUpointer_attribute: self._cptr = &self._size elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,{{endif}}): if self._is_getter: - self._mempool = driver.CUmemoryPool() + self._mempool = _driver.CUmemoryPool() self._cptr = self._mempool.getPtr() else: self._cptr = init_value.getPtr() @@ -334,7 +331,7 @@ cdef class HelperCUpointer_attribute: {{endif}} {{if 'CUgraphMem_attribute_enum' in found_types}} -cdef class HelperCUgraphMem_attribute: +cdef class _HelperCUgraphMem_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value @@ -343,7 +340,7 @@ cdef class HelperCUgraphMem_attribute: {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT,{{endif}} {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = driver.cuuint64_t() + self._cuuint64_t_val = _driver.cuuint64_t() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -369,7 +366,7 @@ cdef class HelperCUgraphMem_attribute: {{endif}} {{if 'CUjit_option_enum' in found_types}} -cdef class HelperCUjit_option: +cdef class _HelperCUjit_option: def __cinit__(self, attr, init_value): self._attr = attr.value if self._attr in ({{if 'CU_JIT_MAX_REGISTERS' in found_values}}cydriver.CUjit_option_enum.CU_JIT_MAX_REGISTERS,{{endif}} @@ -418,8 +415,8 @@ cdef class HelperCUjit_option: self._charstarstar = init_value self._cptr = &self._charstarstar[0] elif self._attr in ({{if 'CU_JIT_GLOBAL_SYMBOL_ADDRESSES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES,{{endif}}): - pylist = [HelperInputVoidPtr(val) for val in init_value] - self._voidstarstar = InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(val) for val in init_value] + self._voidstarstar = _InputVoidPtrPtrHelper(pylist) self._cptr = self._voidstarstar.cptr else: raise TypeError('Unsupported attribute: {}'.format(attr.name)) @@ -434,7 +431,7 @@ cdef class HelperCUjit_option: {{if 'cudaJitOption' in found_types}} -cdef class HelperCudaJitOption: +cdef class _HelperCudaJitOption: def __cinit__(self, attr, init_value): self._attr = attr.value if self._attr in ({{if 'cudaJitMaxRegisters' in found_values}}cyruntime.cudaJitOption.cudaJitMaxRegisters,{{endif}} @@ -479,7 +476,7 @@ cdef class HelperCudaJitOption: {{if 'CUlibraryOption_enum' in found_types}} -cdef class HelperCUlibraryOption: +cdef class _HelperCUlibraryOption: def __cinit__(self, attr, init_value): self._attr = attr.value if False: @@ -506,7 +503,7 @@ cdef class HelperCUlibraryOption: {{if 'cudaLibraryOption' in found_types}} -cdef class HelperCudaLibraryOption: +cdef class _HelperCudaLibraryOption: def __cinit__(self, attr, init_value): self._attr = attr.value if False: @@ -533,7 +530,7 @@ cdef class HelperCudaLibraryOption: {{if 'CUmemAllocationHandleType_enum' in found_types}} -cdef class HelperCUmemAllocationHandleType: +cdef class _HelperCUmemAllocationHandleType: def __cinit__(self, attr): self._type = attr.value if False: @@ -556,7 +553,7 @@ cdef class HelperCUmemAllocationHandleType: {{endif}} {{if 'CU_MEM_HANDLE_TYPE_FABRIC' in found_values}} elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): - self._mem_fabric_handle = driver.CUmemFabricHandle() + self._mem_fabric_handle = _driver.CUmemFabricHandle() self._cptr = self._mem_fabric_handle.getPtr() {{endif}} else: @@ -596,9 +593,9 @@ cdef class HelperCUmemAllocationHandleType: raise TypeError('Unsupported attribute: {}'.format(self._type)) {{endif}} -cdef class InputVoidPtrPtrHelper: +cdef class _InputVoidPtrPtrHelper: def __cinit__(self, lst): - self._cptr = callocWrapper(len(lst), sizeof(void*)) + self._cptr = _callocWrapper(len(lst), sizeof(void*)) for idx in range(len(lst)): self._cptr[idx] = lst[idx].cptr @@ -611,14 +608,14 @@ cdef class InputVoidPtrPtrHelper: {{if 'CUcoredumpSettings_enum' in found_types}} -cdef class HelperCUcoredumpSettings: +cdef class _HelperCUcoredumpSettings: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attrib = attr.value if self._attrib in ({{if 'CU_COREDUMP_FILE' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE,{{endif}} {{if 'CU_COREDUMP_PIPE' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,{{endif}}): if self._is_getter: - self._charstar = callocWrapper(1024, 1) + self._charstar = _callocWrapper(1024, 1) self._cptr = self._charstar self._size = 1024 else: diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in index 4e2a8bf32..ee01d5b58 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cydriver as cydriver -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" {{if 'CUcontext' in found_types}} @@ -1164,7 +1165,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st' in found_struct}} @@ -1237,7 +1238,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} cdef CUkernel _kern @@ -1316,7 +1317,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} cdef CUkernel _kern @@ -3201,7 +3202,7 @@ cdef class CUDA_LAUNCH_PARAMS_st: cdef CUstream _hStream {{endif}} {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 196c5365e..975153c58 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -17,6 +17,8 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -9546,7 +9548,7 @@ cdef class CUaccessPolicyWindow_st: return self._pvt_ptr[0].base_ptr @base_ptr.setter def base_ptr(self, base_ptr): - _cbase_ptr = utils.HelperInputVoidPtr(base_ptr) + _cbase_ptr = _HelperInputVoidPtr(base_ptr) self._pvt_ptr[0].base_ptr = _cbase_ptr.cptr {{endif}} {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} @@ -9799,7 +9801,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} @@ -10052,7 +10054,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} @@ -10339,7 +10341,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} @@ -10798,7 +10800,7 @@ cdef class CUDA_HOST_NODE_PARAMS_st: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -10879,7 +10881,7 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -12758,7 +12760,7 @@ cdef class CUctxCigParam_st: return self._pvt_ptr[0].sharedData @sharedData.setter def sharedData(self, sharedData): - _csharedData = utils.HelperInputVoidPtr(sharedData) + _csharedData = _HelperInputVoidPtr(sharedData) self._pvt_ptr[0].sharedData = _csharedData.cptr {{endif}} {{endif}} @@ -12962,7 +12964,7 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: return self._pvt_ptr[0].functionTable @functionTable.setter def functionTable(self, functionTable): - _cfunctionTable = utils.HelperInputVoidPtr(functionTable) + _cfunctionTable = _HelperInputVoidPtr(functionTable) self._pvt_ptr[0].functionTable = _cfunctionTable.cptr {{endif}} {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} @@ -12979,7 +12981,7 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: return self._pvt_ptr[0].dataTable @dataTable.setter def dataTable(self, dataTable): - _cdataTable = utils.HelperInputVoidPtr(dataTable) + _cdataTable = _HelperInputVoidPtr(dataTable) self._pvt_ptr[0].dataTable = _cdataTable.cptr {{endif}} {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} @@ -13226,7 +13228,7 @@ cdef class CUDA_MEMCPY2D_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} @@ -13304,7 +13306,7 @@ cdef class CUDA_MEMCPY2D_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} @@ -13709,7 +13711,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} @@ -13753,7 +13755,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].reserved0 @reserved0.setter def reserved0(self, reserved0): - _creserved0 = utils.HelperInputVoidPtr(reserved0) + _creserved0 = _HelperInputVoidPtr(reserved0) self._pvt_ptr[0].reserved0 = _creserved0.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} @@ -13820,7 +13822,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} @@ -13864,7 +13866,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].reserved1 @reserved1.setter def reserved1(self, reserved1): - _creserved1 = utils.HelperInputVoidPtr(reserved1) + _creserved1 = _HelperInputVoidPtr(reserved1) self._pvt_ptr[0].reserved1 = _creserved1.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} @@ -14257,7 +14259,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} @@ -14376,7 +14378,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} @@ -16552,7 +16554,7 @@ cdef class CUDA_LAUNCH_PARAMS_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{endif}} @@ -16609,7 +16611,7 @@ cdef class anon_struct12: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} @@ -16618,7 +16620,7 @@ cdef class anon_struct12: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -16704,7 +16706,7 @@ cdef class anon_union5: return self._pvt_ptr[0].handle.nvSciBufObject @nvSciBufObject.setter def nvSciBufObject(self, nvSciBufObject): - _cnvSciBufObject = utils.HelperInputVoidPtr(nvSciBufObject) + _cnvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) self._pvt_ptr[0].handle.nvSciBufObject = _cnvSciBufObject.cptr {{endif}} {{endif}} @@ -17102,7 +17104,7 @@ cdef class anon_struct13: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} @@ -17111,7 +17113,7 @@ cdef class anon_struct13: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -17197,7 +17199,7 @@ cdef class anon_union6: return self._pvt_ptr[0].handle.nvSciSyncObj @nvSciSyncObj.setter def nvSciSyncObj(self, nvSciSyncObj): - _cnvSciSyncObj = utils.HelperInputVoidPtr(nvSciSyncObj) + _cnvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) self._pvt_ptr[0].handle.nvSciSyncObj = _cnvSciSyncObj.cptr {{endif}} {{endif}} @@ -17411,7 +17413,7 @@ cdef class anon_union7: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.reserved' in found_struct}} @@ -17773,7 +17775,7 @@ cdef class anon_union8: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.reserved' in found_struct}} @@ -19573,7 +19575,7 @@ cdef class CUmemAllocationProp_st: return self._pvt_ptr[0].win32HandleMetaData @win32HandleMetaData.setter def win32HandleMetaData(self, win32HandleMetaData): - _cwin32HandleMetaData = utils.HelperInputVoidPtr(win32HandleMetaData) + _cwin32HandleMetaData = _HelperInputVoidPtr(win32HandleMetaData) self._pvt_ptr[0].win32HandleMetaData = _cwin32HandleMetaData.cptr {{endif}} {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} @@ -20024,7 +20026,7 @@ cdef class CUmemPoolProps_st: return self._pvt_ptr[0].win32SecurityAttributes @win32SecurityAttributes.setter def win32SecurityAttributes(self, win32SecurityAttributes): - _cwin32SecurityAttributes = utils.HelperInputVoidPtr(win32SecurityAttributes) + _cwin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) self._pvt_ptr[0].win32SecurityAttributes = _cwin32SecurityAttributes.cptr {{endif}} {{if 'CUmemPoolProps_st.maxSize' in found_struct}} @@ -22246,7 +22248,7 @@ cdef class CUmemDecompressParams_st: return self._pvt_ptr[0].src @src.setter def src(self, src): - _csrc = utils.HelperInputVoidPtr(src) + _csrc = _HelperInputVoidPtr(src) self._pvt_ptr[0].src = _csrc.cptr {{endif}} {{if 'CUmemDecompressParams_st.dst' in found_struct}} @@ -22255,7 +22257,7 @@ cdef class CUmemDecompressParams_st: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'CUmemDecompressParams_st.algo' in found_struct}} @@ -23831,7 +23833,7 @@ def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): else: pdev = int(CUdevice(dev)) cydev = pdev - cynvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList) + cynvSciSyncAttrList = _HelperInputVoidPtr(nvSciSyncAttrList) cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cydriver.cuDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, cydev, flags) @@ -25937,7 +25939,7 @@ def cuModuleLoadData(image): :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` """ cdef CUmodule module = CUmodule() - cyimage = utils.HelperInputVoidPtr(image) + cyimage = _HelperInputVoidPtr(image) cdef void* cyimage_ptr = cyimage.cptr with nogil: err = cydriver.cuModuleLoadData(module._pvt_ptr, cyimage_ptr) @@ -25984,13 +25986,13 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[ if not all(isinstance(_x, (CUjit_option)) for _x in options): raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") cdef CUmodule module = CUmodule() - cyimage = utils.HelperInputVoidPtr(image) + cyimage = _HelperInputVoidPtr(image) cdef void* cyimage_ptr = cyimage.cptr if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuModuleLoadDataEx(module._pvt_ptr, cyimage_ptr, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -26033,7 +26035,7 @@ def cuModuleLoadFatBinary(fatCubin): :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleUnload` """ cdef CUmodule module = CUmodule() - cyfatCubin = utils.HelperInputVoidPtr(fatCubin) + cyfatCubin = _HelperInputVoidPtr(fatCubin) cdef void* cyfatCubin_ptr = cyfatCubin.cptr with nogil: err = cydriver.cuModuleLoadFatBinary(module._pvt_ptr, cyfatCubin_ptr) @@ -26357,8 +26359,8 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr cdef CUlinkState stateOut = CUlinkState() with nogil: @@ -26432,13 +26434,13 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, pstate = int(CUlinkState(state)) cystate = pstate cdef cydriver.CUjitInputType cytypename = typename.value - cydata = utils.HelperInputVoidPtr(data) + cydata = _HelperInputVoidPtr(data) cdef void* cydata_ptr = cydata.cptr if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddData(cystate, cytypename, cydata_ptr, size, name, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -26507,8 +26509,8 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddFile(cystate, cytypename, path, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -26768,17 +26770,17 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() - cycode = utils.HelperInputVoidPtr(code) + cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr cdef vector[cydriver.CUjit_option] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cydriver.CUlibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -26868,14 +26870,14 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_opti raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() cdef vector[cydriver.CUjit_option] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cydriver.CUlibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -28081,7 +28083,7 @@ def cuMemFreeHost(p): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaFreeHost` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemFreeHost(cyp_ptr) @@ -28235,7 +28237,7 @@ def cuMemHostGetDevicePointer(p, unsigned int Flags): :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaHostGetDevicePointer` """ cdef CUdeviceptr pdptr = CUdeviceptr() - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostGetDevicePointer(pdptr._pvt_ptr, cyp_ptr, Flags) @@ -28274,7 +28276,7 @@ def cuMemHostGetFlags(p): :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cudaHostGetFlags` """ cdef unsigned int pFlags = 0 - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostGetFlags(&pFlags, cyp_ptr) @@ -28493,7 +28495,7 @@ def cuDeviceRegisterAsyncNotification(device, callbackFunc, userData): else: pdevice = int(CUdevice(device)) cydevice = pdevice - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuAsyncCallbackData *cbData = NULL @@ -29029,7 +29031,7 @@ def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): -------- :py:obj:`~.cuMemHostUnregister`, :py:obj:`~.cuMemHostGetFlags`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cudaHostRegister` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostRegister(cyp_ptr, bytesize, Flags) @@ -29062,7 +29064,7 @@ def cuMemHostUnregister(p): -------- :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cudaHostUnregister` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostUnregister(cyp_ptr) @@ -29228,7 +29230,7 @@ def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): else: pdstDevice = int(CUdeviceptr(dstDevice)) cydstDevice = pdstDevice - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoD(cydstDevice, cysrcHost_ptr, ByteCount) @@ -29271,7 +29273,7 @@ def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): else: psrcDevice = int(CUdeviceptr(srcDevice)) cysrcDevice = psrcDevice - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoH(cydstHost_ptr, cysrcDevice, ByteCount) @@ -29472,7 +29474,7 @@ def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): else: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoA(cydstArray, dstOffset, cysrcHost_ptr, ByteCount) @@ -29518,7 +29520,7 @@ def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): else: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoH(cydstHost_ptr, cysrcArray, srcOffset, ByteCount) @@ -30185,7 +30187,7 @@ def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): else: pdstDevice = int(CUdeviceptr(dstDevice)) cydstDevice = pdstDevice - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoDAsync(cydstDevice, cysrcHost_ptr, ByteCount, cyhStream) @@ -30238,7 +30240,7 @@ def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): else: psrcDevice = int(CUdeviceptr(srcDevice)) cysrcDevice = psrcDevice - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoHAsync(cydstHost_ptr, cysrcDevice, ByteCount, cyhStream) @@ -30353,7 +30355,7 @@ def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hSt else: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoAAsync(cydstArray, dstOffset, cysrcHost_ptr, ByteCount, cyhStream) @@ -30409,7 +30411,7 @@ def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hSt else: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoHAsync(cydstHost_ptr, cysrcArray, srcOffset, ByteCount, cyhStream) @@ -33314,7 +33316,7 @@ def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHa else: phandle = int(CUmemGenericAllocationHandle(handle)) cyhandle = phandle - cdef utils.HelperCUmemAllocationHandleType cyshareableHandle = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -33364,7 +33366,7 @@ def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAlloca Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return CUDA_ERROR_NOT_SUPPORTED. There is no guarantee that the contents of `handle` will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation. """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cyosHandle = utils.HelperInputVoidPtr(osHandle) + cyosHandle = _HelperInputVoidPtr(osHandle) cdef void* cyosHandle_ptr = cyosHandle.cptr cdef cydriver.CUmemAllocationHandleType cyshHandleType = shHandleType.value with nogil: @@ -33484,7 +33486,7 @@ def cuMemRetainAllocationHandle(addr): The address `addr`, can be any address in a range previously mapped by :py:obj:`~.cuMemMap`, and not necessarily the start address. """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cyaddr = utils.HelperInputVoidPtr(addr) + cyaddr = _HelperInputVoidPtr(addr) cdef void* cyaddr_ptr = cyaddr.cptr with nogil: err = cydriver.cuMemRetainAllocationHandle(handle._pvt_ptr, cyaddr_ptr) @@ -33713,7 +33715,7 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef cydriver.CUmemPool_attribute cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuMemPoolSetAttribute(cypool, cyattr, cyvalue_ptr) @@ -33795,7 +33797,7 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef cydriver.CUmemPool_attribute cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuMemPoolGetAttribute(cypool, cyattr, cyvalue_ptr) @@ -34301,7 +34303,7 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation else: ppool = int(CUmemoryPool(pool)) cypool = ppool - cdef utils.HelperCUmemAllocationHandleType cyhandle_out = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyhandle_out = _HelperCUmemAllocationHandleType(handleType) cdef void* cyhandle_out_ptr = cyhandle_out.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -34350,7 +34352,7 @@ def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAlloca Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool or :py:obj:`~.cuMemAllocFromPoolAsync` calls. """ cdef CUmemoryPool pool_out = CUmemoryPool() - cyhandle = utils.HelperInputVoidPtr(handle) + cyhandle = _HelperInputVoidPtr(handle) cdef void* cyhandle_ptr = cyhandle.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -35030,7 +35032,7 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): else: pptr = int(CUdeviceptr(ptr)) cyptr = pptr - cdef utils.HelperCUpointer_attribute cydata = utils.HelperCUpointer_attribute(attribute, 0, is_getter=True) + cdef _HelperCUpointer_attribute cydata = _HelperCUpointer_attribute(attribute, 0, is_getter=True) cdef void* cydata_ptr = cydata.cptr cdef cydriver.CUpointer_attribute cyattribute = attribute.value with nogil: @@ -35848,7 +35850,7 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att else: pdevPtr = int(CUdeviceptr(devPtr)) cydevPtr = pdevPtr - cdef utils.HelperCUmem_range_attribute cydata = utils.HelperCUmem_range_attribute(attribute, dataSize) + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) cdef void* cydata_ptr = cydata.cptr cdef cydriver.CUmem_range_attribute cyattribute = attribute.value with nogil: @@ -35931,8 +35933,8 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUmem_range_attribute] or List[cydriver.CUmem_range_attribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") - pylist = [utils.HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr cdef vector[size_t] cydataSizes = dataSizes cdef vector[cydriver.CUmem_range_attribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] @@ -35993,7 +35995,7 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): else: pptr = int(CUdeviceptr(ptr)) cyptr = pptr - cdef utils.HelperCUpointer_attribute cyvalue = utils.HelperCUpointer_attribute(attribute, value, is_getter=False) + cdef _HelperCUpointer_attribute cyvalue = _HelperCUpointer_attribute(attribute, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef cydriver.CUpointer_attribute cyattribute = attribute.value with nogil: @@ -36085,8 +36087,8 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUpointer_attribute] or List[cydriver.CUpointer_attribute]") if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) cdef vector[cydriver.CUpointer_attribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] - pylist = [utils.HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr with nogil: err = cydriver.cuPointerGetAttributes(numAttributes, cyattributes.data(), cyvoidStarHelper_ptr, cyptr) @@ -36684,7 +36686,7 @@ def cuStreamAddCallback(hStream, callback, userData, unsigned int flags): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuStreamCallbackData *cbData = NULL @@ -39793,7 +39795,7 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int else: pf = int(CUfunction(f)) cyf = pf - cykernelParams = utils.HelperKernelParams(kernelParams) + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr, extra) @@ -40034,7 +40036,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt pf = int(CUfunction(f)) cyf = pf cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL - cykernelParams = utils.HelperKernelParams(kernelParams) + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernelEx(cyconfig_ptr, cyf, cykernelParams_ptr, extra) @@ -40147,7 +40149,7 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u else: pf = int(CUfunction(f)) cyf = pf - cykernelParams = utils.HelperKernelParams(kernelParams) + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchCooperativeKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr) @@ -40420,7 +40422,7 @@ def cuLaunchHostFunc(hStream, fn, userData): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuHostCallbackData *cbData = NULL @@ -40688,7 +40690,7 @@ def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): else: phfunc = int(CUfunction(hfunc)) cyhfunc = phfunc - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cydriver.cuParamSetv(cyhfunc, offset, cyptr_ptr, numbytes) @@ -43163,7 +43165,7 @@ def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): pdevice = int(CUdevice(device)) cydevice = pdevice cdef cydriver.CUgraphMem_attribute cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuDeviceGetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) @@ -43215,7 +43217,7 @@ def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, v pdevice = int(CUdevice(device)) cydevice = pdevice cdef cydriver.CUgraphMem_attribute cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuDeviceSetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) @@ -45574,7 +45576,7 @@ def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int pdestroy = int(CUhostFn(destroy)) cydestroy = pdestroy cdef CUuserObject object_out = CUuserObject() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cydriver.cuUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) @@ -48667,7 +48669,7 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -49024,7 +49026,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -49352,7 +49354,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -49433,7 +49435,7 @@ def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` """ cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap != None else NULL - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr with nogil: err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress_ptr) @@ -50358,7 +50360,7 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, 0, is_getter=True) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -50474,7 +50476,7 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, 0, is_getter=True) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -50597,7 +50599,7 @@ def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, value, is_getter=False) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -50723,7 +50725,7 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, value, is_getter=False) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -51585,7 +51587,7 @@ def cuLogsRegisterCallback(callbackFunc, userData): else: pcallbackFunc = int(CUlogsCallback(callbackFunc)) cycallbackFunc = pcallbackFunc - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuLogsCallbackData *cbData = NULL diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/cuda/bindings/nvrtc.pxd.in index c9f797520..e1f030921 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cynvrtc as cynvrtc -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" {{if 'nvrtcProgram' in found_types}} diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index f852867a3..e2e2fb361 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -15,6 +15,8 @@ from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -1026,9 +1028,9 @@ def nvrtcSetFlowCallback(prog, callback, payload): else: pprog = int(nvrtcProgram(prog)) cyprog = pprog - cycallback = utils.HelperInputVoidPtr(callback) + cycallback = _HelperInputVoidPtr(callback) cdef void* cycallback_ptr = cycallback.cptr - cypayload = utils.HelperInputVoidPtr(payload) + cypayload = _HelperInputVoidPtr(payload) cdef void* cypayload_ptr = cypayload.cptr with nogil: err = cynvrtc.nvrtcSetFlowCallback(cyprog, cycallback_ptr, cypayload_ptr) diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in index 29687849b..05a7b8df5 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd.in +++ b/cuda_bindings/cuda/bindings/runtime.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings.cyruntime as cyruntime -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" cimport cuda.bindings.driver as driver {{if 'cudaArray_t' in found_types}} @@ -2948,7 +2949,7 @@ cdef class cudaKernelNodeParams: cdef dim3 _blockDim {{endif}} {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'cudaKernelNodeParamsV2' in found_struct}} @@ -2998,7 +2999,7 @@ cdef class cudaKernelNodeParamsV2: cdef dim3 _blockDim {{endif}} {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'cudaExternalSemaphoreSignalNodeParams' in found_struct}} diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index ced5d39a6..f17436058 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -17,6 +17,8 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -6578,7 +6580,7 @@ cdef class cudaPitchedPtr: return self._pvt_ptr[0].ptr @ptr.setter def ptr(self, ptr): - _cptr = utils.HelperInputVoidPtr(ptr) + _cptr = _HelperInputVoidPtr(ptr) self._pvt_ptr[0].ptr = _cptr.cptr {{endif}} {{if 'cudaPitchedPtr.pitch' in found_struct}} @@ -7415,7 +7417,7 @@ cdef class cudaMemsetParams: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'cudaMemsetParams.pitch' in found_struct}} @@ -7556,7 +7558,7 @@ cdef class cudaMemsetParamsV2: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'cudaMemsetParamsV2.pitch' in found_struct}} @@ -7698,7 +7700,7 @@ cdef class cudaAccessPolicyWindow: return self._pvt_ptr[0].base_ptr @base_ptr.setter def base_ptr(self, base_ptr): - _cbase_ptr = utils.HelperInputVoidPtr(base_ptr) + _cbase_ptr = _HelperInputVoidPtr(base_ptr) self._pvt_ptr[0].base_ptr = _cbase_ptr.cptr {{endif}} {{if 'cudaAccessPolicyWindow.num_bytes' in found_struct}} @@ -7815,7 +7817,7 @@ cdef class cudaHostNodeParams: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -7896,7 +7898,7 @@ cdef class cudaHostNodeParamsV2: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -8082,7 +8084,7 @@ cdef class anon_struct3: return self._pvt_ptr[0].res.linear.devPtr @devPtr.setter def devPtr(self, devPtr): - _cdevPtr = utils.HelperInputVoidPtr(devPtr) + _cdevPtr = _HelperInputVoidPtr(devPtr) self._pvt_ptr[0].res.linear.devPtr = _cdevPtr.cptr {{endif}} {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} @@ -8188,7 +8190,7 @@ cdef class anon_struct4: return self._pvt_ptr[0].res.pitch2D.devPtr @devPtr.setter def devPtr(self, devPtr): - _cdevPtr = utils.HelperInputVoidPtr(devPtr) + _cdevPtr = _HelperInputVoidPtr(devPtr) self._pvt_ptr[0].res.pitch2D.devPtr = _cdevPtr.cptr {{endif}} {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} @@ -8808,7 +8810,7 @@ cdef class cudaPointerAttributes: return self._pvt_ptr[0].devicePointer @devicePointer.setter def devicePointer(self, devicePointer): - _cdevicePointer = utils.HelperInputVoidPtr(devicePointer) + _cdevicePointer = _HelperInputVoidPtr(devicePointer) self._pvt_ptr[0].devicePointer = _cdevicePointer.cptr {{endif}} {{if 'cudaPointerAttributes.hostPointer' in found_struct}} @@ -8817,7 +8819,7 @@ cdef class cudaPointerAttributes: return self._pvt_ptr[0].hostPointer @hostPointer.setter def hostPointer(self, hostPointer): - _chostPointer = utils.HelperInputVoidPtr(hostPointer) + _chostPointer = _HelperInputVoidPtr(hostPointer) self._pvt_ptr[0].hostPointer = _chostPointer.cptr {{endif}} {{if 'cudaPointerAttributes.reserved' in found_struct}} @@ -9494,7 +9496,7 @@ cdef class cudaMemPoolProps: return self._pvt_ptr[0].win32SecurityAttributes @win32SecurityAttributes.setter def win32SecurityAttributes(self, win32SecurityAttributes): - _cwin32SecurityAttributes = utils.HelperInputVoidPtr(win32SecurityAttributes) + _cwin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) self._pvt_ptr[0].win32SecurityAttributes = _cwin32SecurityAttributes.cptr {{endif}} {{if 'cudaMemPoolProps.maxSize' in found_struct}} @@ -9723,7 +9725,7 @@ cdef class cudaMemAllocNodeParams: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -9872,7 +9874,7 @@ cdef class cudaMemAllocNodeParamsV2: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -9923,7 +9925,7 @@ cdef class cudaMemFreeNodeParams: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -10206,7 +10208,7 @@ cdef class anon_struct6: return self._pvt_ptr[0].op.ptr.ptr @ptr.setter def ptr(self, ptr): - _cptr = utils.HelperInputVoidPtr(ptr) + _cptr = _HelperInputVoidPtr(ptr) self._pvt_ptr[0].op.ptr.ptr = _cptr.cptr {{endif}} {{if 'cudaMemcpy3DOperand.op.ptr.rowLength' in found_struct}} @@ -12613,7 +12615,7 @@ cdef class anon_struct8: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} @@ -12622,7 +12624,7 @@ cdef class anon_struct8: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -12708,7 +12710,7 @@ cdef class anon_union2: return self._pvt_ptr[0].handle.nvSciBufObject @nvSciBufObject.setter def nvSciBufObject(self, nvSciBufObject): - _cnvSciBufObject = utils.HelperInputVoidPtr(nvSciBufObject) + _cnvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) self._pvt_ptr[0].handle.nvSciBufObject = _cnvSciBufObject.cptr {{endif}} {{endif}} @@ -13146,7 +13148,7 @@ cdef class anon_struct9: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} @@ -13155,7 +13157,7 @@ cdef class anon_struct9: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -13241,7 +13243,7 @@ cdef class anon_union3: return self._pvt_ptr[0].handle.nvSciSyncObj @nvSciSyncObj.setter def nvSciSyncObj(self, nvSciSyncObj): - _cnvSciSyncObj = utils.HelperInputVoidPtr(nvSciSyncObj) + _cnvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) self._pvt_ptr[0].handle.nvSciSyncObj = _cnvSciSyncObj.cptr {{endif}} {{endif}} @@ -13455,7 +13457,7 @@ cdef class anon_union4: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.reserved' in found_struct}} @@ -13817,7 +13819,7 @@ cdef class anon_union5: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.reserved' in found_struct}} @@ -14173,7 +14175,7 @@ cdef class cudalibraryHostUniversalFunctionAndDataTable: return self._pvt_ptr[0].functionTable @functionTable.setter def functionTable(self, functionTable): - _cfunctionTable = utils.HelperInputVoidPtr(functionTable) + _cfunctionTable = _HelperInputVoidPtr(functionTable) self._pvt_ptr[0].functionTable = _cfunctionTable.cptr {{endif}} {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionWindowSize' in found_struct}} @@ -14190,7 +14192,7 @@ cdef class cudalibraryHostUniversalFunctionAndDataTable: return self._pvt_ptr[0].dataTable @dataTable.setter def dataTable(self, dataTable): - _cdataTable = utils.HelperInputVoidPtr(dataTable) + _cdataTable = _HelperInputVoidPtr(dataTable) self._pvt_ptr[0].dataTable = _cdataTable.cptr {{endif}} {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataWindowSize' in found_struct}} @@ -14305,7 +14307,7 @@ cdef class cudaKernelNodeParams: return self._pvt_ptr[0].func @func.setter def func(self, func): - _cfunc = utils.HelperInputVoidPtr(func) + _cfunc = _HelperInputVoidPtr(func) self._pvt_ptr[0].func = _cfunc.cptr {{endif}} {{if 'cudaKernelNodeParams.gridDim' in found_struct}} @@ -14338,7 +14340,7 @@ cdef class cudaKernelNodeParams: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'cudaKernelNodeParams.extra' in found_struct}} @@ -14453,7 +14455,7 @@ cdef class cudaKernelNodeParamsV2: return self._pvt_ptr[0].func @func.setter def func(self, func): - _cfunc = utils.HelperInputVoidPtr(func) + _cfunc = _HelperInputVoidPtr(func) self._pvt_ptr[0].func = _cfunc.cptr {{endif}} {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} @@ -14486,7 +14488,7 @@ cdef class cudaKernelNodeParamsV2: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'cudaKernelNodeParamsV2.extra' in found_struct}} @@ -16137,7 +16139,7 @@ cdef class anon_struct16: return self._pvt_ptr[0].updateData.param.pValue @pValue.setter def pValue(self, pValue): - _cpValue = utils.HelperInputVoidPtr(pValue) + _cpValue = _HelperInputVoidPtr(pValue) self._pvt_ptr[0].updateData.param.pValue = _cpValue.cptr {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} @@ -19104,7 +19106,7 @@ def cudaIpcGetMemHandle(devPtr): :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cuIpcGetMemHandle` """ cdef cudaIpcMemHandle_t handle = cudaIpcMemHandle_t() - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaIpcGetMemHandle(handle._pvt_ptr, cydevPtr_ptr) @@ -19222,7 +19224,7 @@ def cudaIpcCloseMemHandle(devPtr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaIpcCloseMemHandle(cydevPtr_ptr) @@ -19337,7 +19339,7 @@ def cudaDeviceRegisterAsyncNotification(int device, callbackFunc, userData): else: pcallbackFunc = int(cudaAsyncCallback(callbackFunc)) cycallbackFunc = pcallbackFunc - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaAsyncCallbackData *cbData = NULL @@ -19976,7 +19978,7 @@ def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags): -------- :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` """ - cynvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList) + cynvSciSyncAttrList = _HelperInputVoidPtr(nvSciSyncAttrList) cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cyruntime.cudaDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, device, flags) @@ -21086,7 +21088,7 @@ def cudaStreamAddCallback(stream, callback, userData, unsigned int flags): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaStreamCallbackData *cbData = NULL @@ -21285,7 +21287,7 @@ def cudaStreamAttachMemAsync(stream, devPtr, size_t length, unsigned int flags): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaStreamAttachMemAsync(cystream, cydevPtr_ptr, length, flags) @@ -23097,7 +23099,7 @@ def cudaFuncSetCacheConfig(func, cacheConfig not None : cudaFuncCache): ----- This API does not accept a :py:obj:`~.cudaKernel_t` casted as void*. If cache config modification is required for a :py:obj:`~.cudaKernel_t` (or a global function), it can be replaced with a call to :py:obj:`~.cudaFuncSetAttributes` with the attribute :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout` to specify a more granular L1 cache and shared memory split configuration. """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaFuncCache cycacheConfig = cacheConfig.value with nogil: @@ -23140,7 +23142,7 @@ def cudaFuncGetAttributes(func): :py:obj:`~.cudaFuncSetCacheConfig (C API)`, cudaFuncGetAttributes (C++ API), :py:obj:`~.cudaLaunchKernel (C API)`, :py:obj:`~.cuFuncGetAttribute` """ cdef cudaFuncAttributes attr = cudaFuncAttributes() - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaFuncGetAttributes(attr._pvt_ptr, cyfunc_ptr) @@ -23227,7 +23229,7 @@ def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue` """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaFuncAttribute cyattr = attr.value with nogil: @@ -23328,7 +23330,7 @@ def cudaLaunchHostFunc(stream, fn, userData): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaStreamHostCallbackData *cbData = NULL @@ -23405,7 +23407,7 @@ def cudaFuncSetSharedMemConfig(func, config not None : cudaSharedMemConfig): -------- :py:obj:`~.cudaDeviceSetSharedMemConfig`, :py:obj:`~.cudaDeviceGetSharedMemConfig`, :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuFuncSetSharedMemConfig` """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaSharedMemConfig cyconfig = config.value with nogil: @@ -23443,7 +23445,7 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dy :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` """ cdef int numBlocks = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize) @@ -23482,7 +23484,7 @@ def cudaOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), :py:obj:`~.cudaOccupancyAvailableDynamicSMemPerBlock` """ cdef size_t dynamicSmemSize = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc_ptr, numBlocks, blockSize) @@ -23538,7 +23540,7 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` """ cdef int numBlocks = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize, flags) @@ -23944,7 +23946,7 @@ def cudaFree(devPtr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaMallocFromPoolAsync` :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaFreeAsync` :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFree` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFree(cydevPtr_ptr) @@ -23975,7 +23977,7 @@ def cudaFreeHost(ptr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFreeHost` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaFreeHost(cyptr_ptr) @@ -24251,7 +24253,7 @@ def cudaHostRegister(ptr, size_t size, unsigned int flags): -------- :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cudaHostGetFlags`, :py:obj:`~.cudaHostGetDevicePointer`, :py:obj:`~.cuMemHostRegister` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostRegister(cyptr_ptr, size, flags) @@ -24284,7 +24286,7 @@ def cudaHostUnregister(ptr): -------- :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cuMemHostUnregister` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostUnregister(cyptr_ptr) @@ -24344,7 +24346,7 @@ def cudaHostGetDevicePointer(pHost, unsigned int flags): :py:obj:`~.cudaSetDeviceFlags`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer` """ cdef void_ptr pDevice = 0 - cypHost = utils.HelperInputVoidPtr(pHost) + cypHost = _HelperInputVoidPtr(pHost) cdef void* cypHost_ptr = cypHost.cptr with nogil: err = cyruntime.cudaHostGetDevicePointer(&pDevice, cypHost_ptr, flags) @@ -24379,7 +24381,7 @@ def cudaHostGetFlags(pHost): :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetFlags` """ cdef unsigned int pFlags = 0 - cypHost = utils.HelperInputVoidPtr(pHost) + cypHost = _HelperInputVoidPtr(pHost) cdef void* cypHost_ptr = cypHost.cptr with nogil: err = cyruntime.cudaHostGetFlags(&pFlags, cypHost_ptr) @@ -25403,9 +25405,9 @@ def cudaMemcpy(dst, src, size_t count, kind not None : cudaMemcpyKind): -------- :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpy` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25452,9 +25454,9 @@ def cudaMemcpyPeer(dst, int dstDevice, src, int srcDevice, size_t count): -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpyPeer` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeer(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count) @@ -25511,9 +25513,9 @@ def cudaMemcpy2D(dst, size_t dpitch, src, size_t spitch, size_t width, size_t he -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25580,7 +25582,7 @@ def cudaMemcpy2DToArray(dst, size_t wOffset, size_t hOffset, src, size_t spitch, else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25647,7 +25649,7 @@ def cudaMemcpy2DFromArray(dst, size_t dpitch, src, size_t wOffset, size_t hOffse else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25788,9 +25790,9 @@ def cudaMemcpyAsync(dst, src, size_t count, kind not None : cudaMemcpyKind, stre else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25845,9 +25847,9 @@ def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, st else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeerAsync(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count, cystream) @@ -25975,11 +25977,11 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") srcs = [] if srcs is None else srcs dsts = [] if dsts is None else dsts - pylist = [utils.HelperInputVoidPtr(pydsts) for pydsts in dsts] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdsts = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pydsts) for pydsts in dsts] + cdef _InputVoidPtrPtrHelper voidStarHelperdsts = _InputVoidPtrPtrHelper(pylist) cdef const void** cydsts_ptr = voidStarHelperdsts.cptr - pylist = [utils.HelperInputVoidPtr(pysrcs) for pysrcs in srcs] - cdef utils.InputVoidPtrPtrHelper voidStarHelpersrcs = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pysrcs) for pysrcs in srcs] + cdef _InputVoidPtrPtrHelper voidStarHelpersrcs = _InputVoidPtrPtrHelper(pylist) cdef const void** cysrcs_ptr = voidStarHelpersrcs.cptr cdef vector[size_t] cysizes = sizes if count > len(dsts): raise RuntimeError("List is too small: " + str(len(dsts)) + " < " + str(count)) @@ -26205,9 +26207,9 @@ def cudaMemcpy2DAsync(dst, size_t dpitch, src, size_t spitch, size_t width, size else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26295,7 +26297,7 @@ def cudaMemcpy2DToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t sp else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26382,7 +26384,7 @@ def cudaMemcpy2DFromArrayAsync(dst, size_t dpitch, src, size_t wOffset, size_t h else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26420,7 +26422,7 @@ def cudaMemset(devPtr, int value, size_t count): -------- :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset(cydevPtr_ptr, value, count) @@ -26464,7 +26466,7 @@ def cudaMemset2D(devPtr, size_t pitch, int value, size_t width, size_t height): -------- :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2D(cydevPtr_ptr, pitch, value, width, height) @@ -26571,7 +26573,7 @@ def cudaMemsetAsync(devPtr, int value, size_t count, stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemsetAsync(cydevPtr_ptr, value, count, cystream) @@ -26631,7 +26633,7 @@ def cudaMemset2DAsync(devPtr, size_t pitch, int value, size_t width, size_t heig else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2DAsync(cydevPtr_ptr, pitch, value, width, height, cystream) @@ -26818,7 +26820,7 @@ def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocati else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemPrefetchAsync(cydevPtr_ptr, count, location._pvt_ptr[0], flags, cystream) @@ -26909,8 +26911,8 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : if not all(isinstance(_x, (int)) for _x in sizes): raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") dptrs = [] if dptrs is None else dptrs - pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr cdef vector[size_t] cysizes = sizes if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) @@ -26997,8 +26999,8 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : T if not all(isinstance(_x, (int)) for _x in sizes): raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") dptrs = [] if dptrs is None else dptrs - pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr cdef vector[size_t] cysizes = sizes if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) @@ -27100,8 +27102,8 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]] if not all(isinstance(_x, (int)) for _x in sizes): raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") dptrs = [] if dptrs is None else dptrs - pylist = [utils.HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdptrs = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] + cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) cdef void** cydptrs_ptr = voidStarHelperdptrs.cptr cdef vector[size_t] cysizes = sizes if count > len(dptrs): raise RuntimeError("List is too small: " + str(len(dptrs)) + " < " + str(count)) @@ -27314,7 +27316,7 @@ def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, loca -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr cdef cyruntime.cudaMemoryAdvise cyadvice = advice.value with nogil: @@ -27460,10 +27462,10 @@ def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeA -------- :py:obj:`~.cudaMemRangeGetAttributes`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cuMemRangeGetAttribute` """ - cdef utils.HelperCUmem_range_attribute cydata = utils.HelperCUmem_range_attribute(attribute, dataSize) + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) cdef void* cydata_ptr = cydata.cptr cdef cyruntime.cudaMemRangeAttribute cyattribute = attribute.value - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr_ptr, count) @@ -27537,14 +27539,14 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cyruntime.cudaMemRangeAttribute] or List[cyruntime.cudaMemRangeAttribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") - pylist = [utils.HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr cdef vector[size_t] cydataSizes = dataSizes cdef vector[cyruntime.cudaMemRangeAttribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] if numAttributes > len(dataSizes): raise RuntimeError("List is too small: " + str(len(dataSizes)) + " < " + str(numAttributes)) if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr_ptr, count) @@ -27604,7 +27606,7 @@ def cudaMemcpyToArray(dst, size_t wOffset, size_t hOffset, src, size_t count, ki else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -27663,7 +27665,7 @@ def cudaMemcpyFromArray(dst, src, size_t wOffset, size_t hOffset, size_t count, else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -27809,7 +27811,7 @@ def cudaMemcpyToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t coun else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -27885,7 +27887,7 @@ def cudaMemcpyFromArrayAsync(dst, src, size_t wOffset, size_t hOffset, size_t co else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -27987,7 +27989,7 @@ def cudaFreeAsync(devPtr, hStream): else: phStream = int(cudaStream_t(hStream)) cyhStream = phStream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFreeAsync(cydevPtr_ptr, cyhStream) @@ -28113,7 +28115,7 @@ def cudaMemPoolSetAttribute(memPool, attr not None : cudaMemPoolAttr, value): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemPoolAttr cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaMemPoolSetAttribute(cymemPool, cyattr, cyvalue_ptr) @@ -28195,7 +28197,7 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemPoolAttr cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaMemPoolGetAttribute(cymemPool, cyattr, cyvalue_ptr) @@ -28703,7 +28705,7 @@ def cudaMemPoolExportToShareableHandle(memPool, handleType not None : cudaMemAll else: pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool - cdef utils.HelperCUmemAllocationHandleType cyshareableHandle = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cyruntime.cudaMemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -28747,7 +28749,7 @@ def cudaMemPoolImportFromShareableHandle(shareableHandle, handleType not None : Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in :py:obj:`~.cudaDeviceSetMemPool` or :py:obj:`~.cudaMallocFromPoolAsync` calls. """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cyshareableHandle = utils.HelperInputVoidPtr(shareableHandle) + cyshareableHandle = _HelperInputVoidPtr(shareableHandle) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cyruntime.cudaMemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -28785,7 +28787,7 @@ def cudaMemPoolExportPointer(ptr): :py:obj:`~.cuMemPoolExportPointer`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolImportPointer` """ cdef cudaMemPoolPtrExportData exportData = cudaMemPoolPtrExportData() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaMemPoolExportPointer(exportData._pvt_ptr, cyptr_ptr) @@ -28910,7 +28912,7 @@ def cudaPointerGetAttributes(ptr): In CUDA 11.0 forward passing host pointer will return :py:obj:`~.cudaMemoryTypeUnregistered` in :py:obj:`~.cudaPointerAttributes.type` and call will return :py:obj:`~.cudaSuccess`. """ cdef cudaPointerAttributes attributes = cudaPointerAttributes() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaPointerGetAttributes(attributes._pvt_ptr, cyptr_ptr) @@ -30113,7 +30115,7 @@ def cudaLogsRegisterCallback(callbackFunc, userData): else: pcallbackFunc = int(cudaLogsCallback_t(callbackFunc)) cycallbackFunc = pcallbackFunc - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaLogsCallbackHandle callback_out = cudaLogsCallbackHandle() with nogil: @@ -30811,9 +30813,9 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -30955,9 +30957,9 @@ def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -32339,7 +32341,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cydptr = utils.HelperInputVoidPtr(dptr) + cydptr = _HelperInputVoidPtr(dptr) cdef void* cydptr_ptr = cydptr.cptr with nogil: err = cyruntime.cudaGraphAddMemFreeNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cydptr_ptr) @@ -32462,7 +32464,7 @@ def cudaDeviceGetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` """ cdef cyruntime.cudaGraphMemAttributeType cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaDeviceGetGraphMemAttribute(device, cyattr, cyvalue_ptr) @@ -32506,7 +32508,7 @@ def cudaDeviceSetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` """ cdef cyruntime.cudaGraphMemAttributeType cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaDeviceSetGraphMemAttribute(device, cyattr, cyvalue_ptr) @@ -33860,9 +33862,9 @@ def cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, size_t count, else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -34875,7 +34877,7 @@ def cudaUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned in pdestroy = int(cudaHostFn_t(destroy)) cydestroy = pdestroy cdef cudaUserObject_t object_out = cudaUserObject_t() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) @@ -35620,17 +35622,17 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() - cycode = utils.HelperInputVoidPtr(code) + cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr cdef vector[cyruntime.cudaJitOption] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -35720,14 +35722,14 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitO raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() cdef vector[cyruntime.cudaJitOption] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -36217,7 +36219,7 @@ def cudaGetKernel(entryFuncAddr): cudaGetKernel (C++ API) """ cdef cudaKernel_t kernelPtr = cudaKernel_t() - cyentryFuncAddr = utils.HelperInputVoidPtr(entryFuncAddr) + cyentryFuncAddr = _HelperInputVoidPtr(entryFuncAddr) cdef void* cyentryFuncAddr_ptr = cyentryFuncAddr.cptr with nogil: err = cyruntime.cudaGetKernel(kernelPtr._pvt_ptr, cyentryFuncAddr_ptr) @@ -36257,7 +36259,7 @@ def make_cudaPitchedPtr(d, size_t p, size_t xsz, size_t ysz): -------- make_cudaExtent, make_cudaPos """ - cyd = utils.HelperInputVoidPtr(d) + cyd = _HelperInputVoidPtr(d) cdef void* cyd_ptr = cyd.cptr with nogil: err = cyruntime.make_cudaPitchedPtr(cyd_ptr, p, xsz, ysz) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 8ebd68a75..486452a24 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -343,7 +343,6 @@ def do_cythonize(extensions): (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils - (["cuda/bindings/_lib/utils.pyx", "cuda/bindings/_lib/param_packer.cpp"], None), (["cuda/bindings/_lib/cyruntime/cyruntime.pyx"], None), (["cuda/bindings/_lib/cyruntime/utils.pyx"], None), (["cuda/bindings/utils/*.pyx"], None), diff --git a/cuda_bindings/tests/test_utils.py b/cuda_bindings/tests/test_utils.py index 3da7272ed..7ed4fd753 100644 --- a/cuda_bindings/tests/test_utils.py +++ b/cuda_bindings/tests/test_utils.py @@ -2,6 +2,9 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import random +import subprocess # nosec B404 +import sys +from pathlib import Path import pytest @@ -87,3 +90,28 @@ def test_get_handle(target): def test_get_handle_error(target): with pytest.raises(TypeError) as e: handle = get_cuda_native_handle(target) + + +@pytest.mark.parametrize( + "module", + [ + # Top-level modules for external Python use + # TODO: Import cycle detected: (('numeric',), ''), stack: [((), + # 'cuda.bindings.cufile'), ((), 'cuda.bindings.cycufile'), + # (('show_config',), 'numpy.__config__'), (('__cpu_features__', + # '__cpu_baseline__', '__cpu_dispatch__'), + # 'numpy._core._multiarray_umath'), (('numeric',), ''), + # (('shape_base',), '')] + # "cufile", + "driver", + "nvjitlink", + "nvrtc", + "nvvm", + # TODO: cuda.bindings.cyruntime -> cuda.bindings._lib.cyruntime.cyruntime cycle + # "runtime", + ], +) +def test_cyclical_imports(module): + subprocess.check_call( # nosec B603 + [sys.executable, Path(__file__).parent / "utils" / "check_cyclical_import.py", f"cuda.bindings.{module}"], + ) diff --git a/cuda_bindings/tests/utils/check_cyclical_import.py b/cuda_bindings/tests/utils/check_cyclical_import.py new file mode 100644 index 000000000..4466a5c76 --- /dev/null +++ b/cuda_bindings/tests/utils/check_cyclical_import.py @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +""" +Tests whether importing a specific module leads to cyclical imports. + +See https://github.com/NVIDIA/cuda-python/issues/789 for more info. +""" + +import argparse + +orig_import = __builtins__.__import__ + +import_stack = [] + + +def import_hook(name, globals=None, locals=None, fromlist=(), *args, **kwargs): + """Approximate a custom import system that does not allow import cycles.""" + + stack_entry = (tuple(fromlist) if fromlist is not None else None, name) + if stack_entry in import_stack and name.startswith("cuda.bindings."): + raise ImportError(f"Import cycle detected: {stack_entry}, stack: {import_stack}") + import_stack.append(stack_entry) + res = orig_import(name, globals, locals, fromlist, *args, **kwargs) + import_stack.pop() + return res + + +__builtins__.__import__ = import_hook + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "module", + type=str, + ) + args = parser.parse_args() + + __import__(args.module) From f7583570466c2fc2ad50433a85a875c138b3e382 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 25 Aug 2025 17:33:45 -0400 Subject: [PATCH 063/113] DOC: Drop all mentions of CUDA 11 from installation guides and support policies (#902) * Initial plan * Update installation guides and support policies to cover CUDA 12/13 instead of 11/12 Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Update CUDA 13 driver requirements and add CUDA 11 deprecation note Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --- cuda_bindings/docs/source/support.rst | 2 +- cuda_core/docs/source/install.rst | 18 +++++++++--------- cuda_core/docs/source/release/0.X.Y-notes.rst | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cuda_bindings/docs/source/support.rst b/cuda_bindings/docs/source/support.rst index 2aa589698..f02836117 100644 --- a/cuda_bindings/docs/source/support.rst +++ b/cuda_bindings/docs/source/support.rst @@ -10,7 +10,7 @@ The ``cuda.bindings`` module has the following support policy: third number in the version string), however, is reserved to reflect Python-only changes and is out of sync with the Toolkit patch version. 2. The module is actively maintained to support the latest CUDA major version and its prior major - version. For example, as of writing the bindings for CUDA 11 & 12 are maintained. Any fix in the + version. For example, as of writing the bindings for CUDA 12 & 13 are maintained. Any fix in the latest bindings would be backported to the prior major version. 3. The module supports `CUDA minor version compatibility`_, meaning that ``cuda.bindings`` 12.x supports any Toolkit 12.y. (Whether or not a binding API would actually correctly function diff --git a/cuda_core/docs/source/install.rst b/cuda_core/docs/source/install.rst index 8bc1faa0e..32028a63b 100644 --- a/cuda_core/docs/source/install.rst +++ b/cuda_core/docs/source/install.rst @@ -14,14 +14,14 @@ dependencies are as follows: :header-rows: 1 * - - - CUDA 11 - CUDA 12 + - CUDA 13 * - CUDA Toolkit\ [#f1]_ - - 11.2 - 11.8 - 12.x + - 13.x * - Driver - - 450.80.02+ (Linux), 452.39+ (Windows) - 525.60.13+ (Linux), 527.41+ (Windows) + - 580.65+ (Linux), 580.88+ (Windows) .. [#f1] Including ``cuda-python``. @@ -31,27 +31,27 @@ dependencies are as follows: Installing from PyPI -------------------- -``cuda.core`` works with ``cuda.bindings`` (part of ``cuda-python``) 11 or 12. Test dependencies now use the ``cuda-toolkit`` metapackage for improved dependency resolution. For example with CUDA 12: +``cuda.core`` works with ``cuda.bindings`` (part of ``cuda-python``) 12 or 13. Test dependencies now use the ``cuda-toolkit`` metapackage for improved dependency resolution. For example with CUDA 12: .. code-block:: console $ pip install cuda-core[cu12] -and likewise use ``[cu11]`` for CUDA 11, or ``[cu13]`` for CUDA 13. +and likewise use ``[cu13]`` for CUDA 13. Note that using ``cuda.core`` with NVRTC installed from PyPI via ``pip install`` requires -``cuda.bindings`` 12.8.0+ or 11.8.6+. Likewise, with nvJitLink it requires 12.8.0+. +``cuda.bindings`` 12.8.0+. Likewise, with nvJitLink it requires 12.8.0+. Installing from Conda (conda-forge) ----------------------------------- -Same as above, ``cuda.core`` can be installed in a CUDA 11 or 12 environment. For example with CUDA 12: +Same as above, ``cuda.core`` can be installed in a CUDA 12 or 13 environment. For example with CUDA 12: .. code-block:: console $ conda install -c conda-forge cuda-core cuda-version=12 -and likewise use ``cuda-version=11`` for CUDA 11. +and likewise use ``cuda-version=13`` for CUDA 13. Note that to use ``cuda.core`` with nvJitLink installed from conda-forge requires ``cuda.bindings`` 12.8.0+. @@ -64,4 +64,4 @@ Installing from Source $ cd cuda-python/cuda_core $ pip install . -``cuda-bindings`` 11.x or 12.x is a required dependency. +``cuda-bindings`` 12.x or 13.x is a required dependency. diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 40fece768..8024a14f6 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -18,6 +18,7 @@ Highlights Breaking Changes ---------------- +- **CUDA 11 support dropped**: CUDA 11 support is no longer tested and it may or may not work with cuda.bindings and CTK 11.x. Users are encouraged to migrate to CUDA 12.x or 13.x. - **LaunchConfig grid parameter interpretation**: When :attr:`LaunchConfig.cluster` is specified, the :attr:`LaunchConfig.grid` parameter now correctly represents the number of clusters instead of blocks. Previously, the grid parameter was incorrectly interpreted as blocks, causing a mismatch with the expected C++ behavior. This change ensures that ``LaunchConfig(grid=4, cluster=2, block=32)`` correctly produces 4 clusters × 2 blocks/cluster = 8 total blocks, matching the C++ equivalent ``cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32))``. - When :class:`Buffer` is closed, :attr:`Buffer.handle` is now set to ``None``. It was previously set to ``0`` by accident. From 811cb93e60ebb5d32ddc9b2dccbd0f07a452ad92 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 25 Aug 2025 14:46:47 -0700 Subject: [PATCH 064/113] Add ` pre-commit-hooks` ("Standard hooks") in `.pre-commit-config.yaml` to get rid of whitespace noise (#901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Copy pre-commit-hooks "Standard hooks" from pybind11/.pre-commit-config.yaml * Automatic whitespace fixes — NO manual changes. * Revert "Automatic whitespace fixes — NO manual changes." This reverts commit f955667855c43e6a48192262ac7439d704c8b6c3. * gen_exclude at top level * Automatic whitespace fixes — NO manual changes. * git checkout main cuda_bindings/docs/source/module/*.rst * Add `$|cuda_bindings/docs/source/module/.*\.rst?$` to `gen_exclude` --------- Co-authored-by: Leo Fang --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 - .github/ISSUE_TEMPLATE/doc_request.yml | 1 - .github/PULL_REQUEST_TEMPLATE.md | 1 - .github/actions/doc_preview/action.yml | 10 ++--- .github/actions/install_unix_deps/action.yml | 2 +- .github/workflows/release-upload.yml | 2 +- .pre-commit-config.yaml | 21 ++++++++++ SECURITY.md | 1 - ci/tools/download-wheels | 8 ++-- cuda_bindings/LICENSE | 36 ++++++++--------- .../docs/source/environment_variables.rst | 1 - cuda_bindings/docs/source/install.rst | 2 +- cuda_bindings/docs/source/motivation.rst | 14 +++---- cuda_bindings/docs/source/overview.rst | 39 +++++++++---------- .../docs/source/release/11.6.0-notes.rst | 1 - .../docs/source/release/12.9.X-notes.rst | 2 +- cuda_bindings/docs/source/tips_and_tricks.rst | 6 +-- cuda_bindings/pyproject.toml | 10 ++--- .../core/experimental/_kernel_arg_handler.pyx | 2 +- cuda_core/cuda/core/experimental/_memory.pyx | 10 ++--- .../cuda/core/experimental/_memoryview.pyx | 36 ++++++++--------- .../_templates/autosummary/dataclass.rst | 1 - .../_templates/autosummary/namedtuple.rst | 2 +- cuda_core/docs/source/getting-started.rst | 6 +-- cuda_core/docs/source/install.rst | 4 +- cuda_core/docs/source/release/0.1.1-notes.rst | 2 +- cuda_core/docs/source/release/0.3.2-notes.rst | 2 +- cuda_core/pyproject.toml | 6 +-- .../cython/test_get_cuda_native_handle.pyx | 2 +- cuda_python/LICENSE | 36 ++++++++--------- cuda_python/docs/source/release.rst | 1 - 31 files changed, 140 insertions(+), 128 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 09752a729..4574e04bf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -113,4 +113,3 @@ body: +-------------------------------+----------------------+----------------------+ validations: required: false - diff --git a/.github/ISSUE_TEMPLATE/doc_request.yml b/.github/ISSUE_TEMPLATE/doc_request.yml index 26a7faeac..7804a6c85 100644 --- a/.github/ISSUE_TEMPLATE/doc_request.yml +++ b/.github/ISSUE_TEMPLATE/doc_request.yml @@ -41,4 +41,3 @@ body: label: If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked. placeholder: | https://nvidia.github.io/cuda-python/latest/ - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index afc43be22..aa51259a9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,4 +11,3 @@ closes - [ ] New or existing tests cover these changes. - [ ] The documentation is up to date with these changes. - diff --git a/.github/actions/doc_preview/action.yml b/.github/actions/doc_preview/action.yml index 61531428a..6948522da 100644 --- a/.github/actions/doc_preview/action.yml +++ b/.github/actions/doc_preview/action.yml @@ -18,7 +18,7 @@ runs: using: composite steps: # The steps below are executed only when testing in a PR. - # Note: the PR previews will be removed once merged to main (see below) + # Note: the PR previews will be removed once merged to main (see below) - name: Deploy doc preview if: ${{ github.ref_name != 'main' }} uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 @@ -28,7 +28,7 @@ runs: folder: ${{ inputs.source-folder }} target-folder: docs/pr-preview/pr-${{ inputs.pr-number }}/ commit-message: "Deploy doc preview for PR ${{ inputs.pr-number }} (${{ github.sha }})" - + - name: Leave a comment after deployment if: ${{ github.ref_name != 'main' }} uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 @@ -43,8 +43,8 @@ runs: |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-core/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-bindings/

|


Preview will be ready when the GitHub Pages deployment is complete.

- - # The steps below are executed only when building on main. + + # The steps below are executed only when building on main. - name: Remove doc preview if: ${{ github.ref_name == 'main' }} uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 @@ -54,7 +54,7 @@ runs: folder: ${{ inputs.source-folder }} target-folder: docs/pr-preview/pr-${{ inputs.pr-number }}/ commit-message: "Clean up doc preview for PR ${{ inputs.pr-number }} (${{ github.sha }})" - + - name: Leave a comment after removal if: ${{ github.ref_name == 'main' }} uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 diff --git a/.github/actions/install_unix_deps/action.yml b/.github/actions/install_unix_deps/action.yml index 645b761cf..6289541c9 100644 --- a/.github/actions/install_unix_deps/action.yml +++ b/.github/actions/install_unix_deps/action.yml @@ -10,7 +10,7 @@ inputs: dependencies: required: true type: string - dependent_exes: + dependent_exes: required: true type: string diff --git a/.github/workflows/release-upload.yml b/.github/workflows/release-upload.yml index f7d6306fc..8ae08c502 100644 --- a/.github/workflows/release-upload.yml +++ b/.github/workflows/release-upload.yml @@ -78,7 +78,7 @@ jobs: run: | # Use the shared script to download wheels ./ci/tools/download-wheels "${{ inputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "release/wheels" - + # Upload wheels to the release if [[ -d "release/wheels" && $(ls -A release/wheels 2>/dev/null | wc -l) -gt 0 ]]; then echo "Uploading wheels to release ${{ inputs.git-tag }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db3968dbd..0479db6a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,8 @@ ci: skip: [bandit] submodules: false +gen_exclude: &gen_exclude '^cuda_bindings/cuda/bindings/.*\.in?$|cuda_bindings/docs/source/module/.*\.rst?$' + # Please update the rev: SHAs below with this command: # pre-commit autoupdate --freeze repos: @@ -39,6 +41,25 @@ repos: pass_filenames: false always_run: true + # Standard hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v5.0.0" + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + exclude: *gen_exclude + - id: mixed-line-ending + - id: requirements-txt-fixer + - id: trailing-whitespace + exclude: *gen_exclude + # Checking for common mistakes - repo: https://github.com/pre-commit/pygrep-hooks rev: "v1.10.0" diff --git a/SECURITY.md b/SECURITY.md index b72f0d67a..428354155 100755 --- a/SECURITY.md +++ b/SECURITY.md @@ -33,4 +33,3 @@ information. For all security-related concerns, please visit NVIDIA's Product Security portal at . - diff --git a/ci/tools/download-wheels b/ci/tools/download-wheels index 05509bfc0..a3141afb3 100755 --- a/ci/tools/download-wheels +++ b/ci/tools/download-wheels @@ -49,18 +49,18 @@ do if [[ ! -d "$p" ]]; then continue fi - + # exclude cython test artifacts if [[ "${p}" == *-tests ]]; then echo "Skipping test artifact: $p" continue fi - + # If we're not downloading "all", only process matching component if [[ "$COMPONENT" != "all" && "$p" != ${COMPONENT}* ]]; then continue fi - + echo "Processing artifact: $p" # Move wheel files to output directory if [[ -d "$p" ]]; then @@ -72,4 +72,4 @@ done rm -rf cuda-* echo "Downloaded wheels to: $OUTPUT_DIR" -ls -la "$OUTPUT_DIR" \ No newline at end of file +ls -la "$OUTPUT_DIR" diff --git a/cuda_bindings/LICENSE b/cuda_bindings/LICENSE index b7d042fce..a5a65097c 100644 --- a/cuda_bindings/LICENSE +++ b/cuda_bindings/LICENSE @@ -2,46 +2,46 @@ NVIDIA SOFTWARE LICENSE This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of the NVIDIA CUDA Python software and materials provided hereunder ("SOFTWARE"). -This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users. +This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users. You agree to use the SOFTWARE only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions. 1. LICENSE. Subject to the terms of this license, NVIDIA grants you a non-exclusive limited license to: (a) install and use the SOFTWARE, and (b) distribute the SOFTWARE subject to the distribution requirements described in this license. NVIDIA reserves all rights, title and interest in and to the SOFTWARE not expressly granted to you under this license. -2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant: -a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA's intellectual property rights. -b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE. +2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant: +a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA's intellectual property rights. +b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE. 3. LIMITATIONS. Your license to use the SOFTWARE is restricted as follows: a. The SOFTWARE is licensed for you to develop applications only for use in systems with NVIDIA GPUs. -b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE. -c. You may not modify or create derivative works of any portion of the SOFTWARE. +b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE. +c. You may not modify or create derivative works of any portion of the SOFTWARE. d. You may not bypass, disable, or circumvent any technical measure, encryption, security, digital rights management or authentication mechanism in the SOFTWARE. e. You may not use the SOFTWARE in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SOFTWARE be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. -f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. -g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney's fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms. +f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. +g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney's fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms. -4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. +4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. 5. OWNERSHIP. The SOFTWARE and the related intellectual property rights therein are and will remain the sole and exclusive property of NVIDIA or its licensors. The SOFTWARE is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. NVIDIA may make changes to the SOFTWARE, at any time without notice, but is not obligated to support or update the SOFTWARE. - -6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict. + +6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict. 7. FEEDBACK. You may, but don't have to, provide to NVIDIA any Feedback. "Feedback" means any suggestions, bug fixes, enhancements, modifications, feature requests or other feedback regarding the SOFTWARE. For any Feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) the Feedback without the payment of any royalties or fees to you. NVIDIA will use Feedback at its choice. -8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. +8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. + +9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. -9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. +10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA's sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you. -10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA's sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you. +11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. -11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. +12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA's permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. -12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA's permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. - 13. EXPORT. The SOFTWARE is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury's Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this license, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SOFTWARE. -14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is "commercial items" consisting of "commercial computer software" and "commercial computer software documentation" provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051. +14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is "commercial items" consisting of "commercial computer software" and "commercial computer software documentation" provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051. 15. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. This license may only be modified in a writing signed by an authorized representative of each party. diff --git a/cuda_bindings/docs/source/environment_variables.rst b/cuda_bindings/docs/source/environment_variables.rst index c582fe57b..a212bfe76 100644 --- a/cuda_bindings/docs/source/environment_variables.rst +++ b/cuda_bindings/docs/source/environment_variables.rst @@ -18,4 +18,3 @@ Build-Time Environment Variables - ``CUDA_PYTHON_PARSER_CACHING`` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (``CUDA_PYTHON_PARSER_CACHING`` is True), the cache path is set to ./cache_, where is derived from the cuda toolkit libraries used to build cuda-bindings. - ``CUDA_PYTHON_PARALLEL_LEVEL`` (previously ``PARALLEL_LEVEL``) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds. - diff --git a/cuda_bindings/docs/source/install.rst b/cuda_bindings/docs/source/install.rst index b9335b487..b5181c6a3 100644 --- a/cuda_bindings/docs/source/install.rst +++ b/cuda_bindings/docs/source/install.rst @@ -35,7 +35,7 @@ Install all optional dependencies with: Where the optional dependencies include: -* ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library) +* ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library) * ``nvidia-nvjitlink`` (nvJitLink library) * ``nvidia-nvvm`` (NVVM library) * ``nvidia-cufile`` (cuFile library, Linux only) diff --git a/cuda_bindings/docs/source/motivation.rst b/cuda_bindings/docs/source/motivation.rst index afbd3412d..433cc1661 100644 --- a/cuda_bindings/docs/source/motivation.rst +++ b/cuda_bindings/docs/source/motivation.rst @@ -9,7 +9,7 @@ What is CUDA Python? NVIDIA’s CUDA Python provides `Cython `_ bindings and Python wrappers for the driver and runtime API for existing toolkits and libraries to simplify GPU-based accelerated processing. Python is one of the most popular -programming languages for science, engineering, data analytics, and deep +programming languages for science, engineering, data analytics, and deep learning applications. The goal of CUDA Python is to unify the Python ecosystem with a single set of interfaces that provide full coverage of and access to the CUDA host APIs from Python. @@ -25,18 +25,18 @@ science, and AI. `Anaconda `_ that can compile Python code for execution on CUDA-capable GPUs, provides Python developers with an easy entry into GPU-accelerated computing and a path for using increasingly sophisticated CUDA -code with a minimum of new syntax and jargon. Numba has its own CUDA driver API -bindings that can now be replaced with CUDA Python. With CUDA Python and Numba, +code with a minimum of new syntax and jargon. Numba has its own CUDA driver API +bindings that can now be replaced with CUDA Python. With CUDA Python and Numba, you get the best of both worlds: rapid iterative development with Python and the speed of a compiled language targeting both CPUs and NVIDIA GPUs. `CuPy `_ is a `NumPy `_/`SciPy `_ compatible Array library, from `Preferred Networks `_, for -GPU-accelerated computing with Python. CUDA Python simplifies the CuPy build -and allows for a faster and smaller memory footprint when importing the CuPy -Python module. In the future, when more CUDA Toolkit libraries are supported, -CuPy will have a lighter maintenance overhead and have fewer wheels to +GPU-accelerated computing with Python. CUDA Python simplifies the CuPy build +and allows for a faster and smaller memory footprint when importing the CuPy +Python module. In the future, when more CUDA Toolkit libraries are supported, +CuPy will have a lighter maintenance overhead and have fewer wheels to release. Users benefit from a faster CUDA runtime! Our goal is to help unify the Python CUDA ecosystem with a single standard set diff --git a/cuda_bindings/docs/source/overview.rst b/cuda_bindings/docs/source/overview.rst index 0f3203252..fdef83639 100644 --- a/cuda_bindings/docs/source/overview.rst +++ b/cuda_bindings/docs/source/overview.rst @@ -60,7 +60,7 @@ The following code snippet lets us validate each API call and raise exceptions i return nvrtc.nvrtcGetErrorString(error)[1] else: raise RuntimeError('Unknown error type: {}'.format(error)) - + def checkCudaErrors(result): if result[0].value: raise RuntimeError("CUDA error code={}({})".format(result[0].value, _cudaGetErrorEnum(result[0]))) @@ -105,22 +105,22 @@ the program is compiled to target our local compute capability architecture with # Initialize CUDA Driver API checkCudaErrors(driver.cuInit(0)) - + # Retrieve handle for device 0 cuDevice = checkCudaErrors(driver.cuDeviceGet(0)) - + # Derive target architecture for device 0 major = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)) minor = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)) arch_arg = bytes(f'--gpu-architecture=compute_{major}{minor}', 'ascii') - + # Create program prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(saxpy), b"saxpy.cu", 0, [], [])) - + # Compile program opts = [b"--fmad=false", arch_arg] checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, 2, opts)) - + # Get PTX from compilation ptxSize = checkCudaErrors(nvrtc.nvrtcGetPTXSize(prog)) ptx = b" " * ptxSize @@ -158,11 +158,11 @@ and from the device: NUM_THREADS = 512 # Threads per block NUM_BLOCKS = 32768 # Blocks per grid - + a = np.array([2.0], dtype=np.float32) n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32) bufferSize = n * a.itemsize - + hX = np.random.rand(n).astype(dtype=np.float32) hY = np.random.rand(n).astype(dtype=np.float32) hOut = np.zeros(n).astype(dtype=np.float32) @@ -182,9 +182,9 @@ by calling ``XX.ctypes.data`` for the associated XX: dXclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) dYclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) dOutclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) - + stream = checkCudaErrors(driver.cuStreamCreate(0)) - + checkCudaErrors(driver.cuMemcpyHtoDAsync( dXclass, hX.ctypes.data, bufferSize, stream )) @@ -233,7 +233,7 @@ Now the kernel can be launched: args.ctypes.data, # kernel arguments 0, # extra (ignore) )) - + checkCudaErrors(driver.cuMemcpyDtoHAsync( hOut.ctypes.data, dOutclass, bufferSize, stream )) @@ -304,7 +304,7 @@ maximize performance ({numref}``Figure 1``). .. figure:: _static/images/Nsight-Compute-CLI-625x473.png :name: Figure 1 - + Screenshot of Nsight Compute CLI output of ``cuda.bindings`` example. Preparing kernel arguments @@ -331,7 +331,7 @@ Let's use the following kernel definition as an example: typedef struct { int value; } testStruct; - + extern "C" __global__ void testkernel(int i, int *pi, float f, float *pf, @@ -347,7 +347,7 @@ The first step is to create array objects with types corresponding to your kerne .. list-table:: Correspondence between NumPy types and kernel types. :header-rows: 1 - + * - NumPy type - Corresponding kernel types - itemsize (bytes) @@ -410,12 +410,12 @@ Putting it all together: # Define a custom type testStruct = np.dtype([("value", np.int32)], align=True) - + # Allocate device memory pInt = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.int32).itemsize)) pFloat = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.float32).itemsize)) pStruct = checkCudaErrors(cudart.cudaMalloc(testStruct.itemsize)) - + # Collect all input kernel arguments into a single tuple for further processing kernelValues = ( np.array(1, dtype=np.uint32), @@ -470,12 +470,12 @@ For this example the result becomes: # Define a custom type class testStruct(ctypes.Structure): _fields_ = [("value", ctypes.c_int)] - + # Allocate device memory pInt = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_int))) pFloat = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_float))) pStruct = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(testStruct))) - + # Collect all input kernel arguments into a single tuple for further processing kernelValues = ( 1, @@ -531,7 +531,7 @@ For this example, lets use the ``transformKernel`` from `examples/0_Introduction ... } """ - + def main(): ... d_data = checkCudaErrors(cudart.cudaMalloc(size)) @@ -565,4 +565,3 @@ For ctypes, we leverage the special handling of ``None`` type since each Python None, ) kernelArgs = (kernelValues, kernelTypes) - diff --git a/cuda_bindings/docs/source/release/11.6.0-notes.rst b/cuda_bindings/docs/source/release/11.6.0-notes.rst index d7907df84..bcc8944e1 100644 --- a/cuda_bindings/docs/source/release/11.6.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.6.0-notes.rst @@ -79,4 +79,3 @@ CUDA Functions Not Supported in this Release - cudaVDPAUSetVDPAUDevice .. note:: Deprecated APIs are removed from tracking - diff --git a/cuda_bindings/docs/source/release/12.9.X-notes.rst b/cuda_bindings/docs/source/release/12.9.X-notes.rst index 3be22a695..a3a640f53 100644 --- a/cuda_bindings/docs/source/release/12.9.X-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.X-notes.rst @@ -18,4 +18,4 @@ Highlights Known issues ------------ -* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. \ No newline at end of file +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings/docs/source/tips_and_tricks.rst b/cuda_bindings/docs/source/tips_and_tricks.rst index cc666ca27..1a77eb53f 100644 --- a/cuda_bindings/docs/source/tips_and_tricks.rst +++ b/cuda_bindings/docs/source/tips_and_tricks.rst @@ -27,9 +27,9 @@ All of the Python classes do not manage the lifetime of the underlying CUDA C ob Getting and setting attributes of extension types ================================================= -While the bindings outwardly present the attributes of extension types in a pythonic way, they can't always be interacted with in a Pythonic style. Often the getters/setters (__getitem__(), __setitem__()) are actually a translation step to convert values between Python and C. For example, in some cases, attempting to modify an attribute in place, will lead to unexpected behavior due to the design of the underlying implementation. For this reason, users should use the getters and setters directly when interacting with extension types. +While the bindings outwardly present the attributes of extension types in a pythonic way, they can't always be interacted with in a Pythonic style. Often the getters/setters (__getitem__(), __setitem__()) are actually a translation step to convert values between Python and C. For example, in some cases, attempting to modify an attribute in place, will lead to unexpected behavior due to the design of the underlying implementation. For this reason, users should use the getters and setters directly when interacting with extension types. -An example of this is the :class:`~cuda.bindings.driver.CULaunchConfig` type. +An example of this is the :class:`~cuda.bindings.driver.CULaunchConfig` type. .. code-block:: python @@ -37,7 +37,7 @@ An example of this is the :class:`~cuda.bindings.driver.CULaunchConfig` type. cfg.numAttrs += 1 attr = cuda.CUlaunchAttribute() - + ... # This works. We are passing the new attribute to the setter diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 1a91b44b8..2637f0b0e 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -84,10 +84,10 @@ select = [ ] ignore = [ - "UP006", - "UP007", + "UP006", + "UP007", "E741", # ambiguous variable name such as I - "B007", # rename unsued loop variable to _name + "B007", # rename unsued loop variable to _name "UP035" # UP006, UP007, UP035 complain about deprecated Typing. use, but disregard backward compatibility of python version ] @@ -103,13 +103,13 @@ exclude = ["cuda/bindings/_version.py"] ] "tests/**/*" = [ - "E722", + "E722", "UP022", "E402", # module level import not at top of file "F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example) "benchmarks/**/*" = [ - "E722", + "E722", "UP022", "E402", # module level import not at top of file "F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example) diff --git a/cuda_core/cuda/core/experimental/_kernel_arg_handler.pyx b/cuda_core/cuda/core/experimental/_kernel_arg_handler.pyx index e73563038..0bb40bf40 100644 --- a/cuda_core/cuda/core/experimental/_kernel_arg_handler.pyx +++ b/cuda_core/cuda/core/experimental/_kernel_arg_handler.pyx @@ -215,7 +215,7 @@ cdef class ParamHolder: if isinstance(arg.handle, int): # see note below on handling int arguments prepare_arg[intptr_t](self.data, self.data_addresses, arg.handle, i) - continue + continue else: # it's a CUdeviceptr: self.data_addresses[i] = (arg.handle.getPtr()) diff --git a/cuda_core/cuda/core/experimental/_memory.pyx b/cuda_core/cuda/core/experimental/_memory.pyx index ddcf7665e..3eb80875e 100644 --- a/cuda_core/cuda/core/experimental/_memory.pyx +++ b/cuda_core/cuda/core/experimental/_memory.pyx @@ -137,14 +137,14 @@ cdef class Buffer: """ if stream is None: raise ValueError("stream must be provided") - + cdef size_t src_size = self._size - + if dst is None: if self._mr is None: raise ValueError("a destination buffer must be provided (this buffer does not have a memory_resource)") dst = self._mr.allocate(src_size, stream) - + cdef size_t dst_size = dst._size if dst_size != src_size: raise ValueError( @@ -168,10 +168,10 @@ cdef class Buffer: """ if stream is None: raise ValueError("stream must be provided") - + cdef size_t dst_size = self._size cdef size_t src_size = src._size - + if src_size != dst_size: raise ValueError( f"buffer sizes mismatch between src and dst (sizes are: src={src_size}, dst={dst_size})" diff --git a/cuda_core/cuda/core/experimental/_memoryview.pyx b/cuda_core/cuda/core/experimental/_memoryview.pyx index 9d2413305..ea8fb01b6 100644 --- a/cuda_core/cuda/core/experimental/_memoryview.pyx +++ b/cuda_core/cuda/core/experimental/_memoryview.pyx @@ -29,20 +29,20 @@ cdef class StridedMemoryView: This object supports both DLPack (up to v1.0) and CUDA Array Interface (CAI) v3. When wrapping an arbitrary object it will try the DLPack protocol first, then the CAI protocol. A :obj:`BufferError` is raised if neither is - supported. - + supported. + Since either way would take a consumer stream, for DLPack it is passed to - ``obj.__dlpack__()`` as-is (except for :obj:`None`, see below); for CAI, a + ``obj.__dlpack__()`` as-is (except for :obj:`None`, see below); for CAI, a stream order will be established between the consumer stream and the - producer stream (from ``obj.__cuda_array_interface__()["stream"]``), as if - ``cudaStreamWaitEvent`` is called by this method. - - To opt-out of the stream ordering operation in either DLPack or CAI, - please pass ``stream_ptr=-1``. Note that this deviates (on purpose) + producer stream (from ``obj.__cuda_array_interface__()["stream"]``), as if + ``cudaStreamWaitEvent`` is called by this method. + + To opt-out of the stream ordering operation in either DLPack or CAI, + please pass ``stream_ptr=-1``. Note that this deviates (on purpose) from the semantics of ``obj.__dlpack__(stream=None, ...)`` since ``cuda.core`` - does not encourage using the (legacy) default/null stream, but is + does not encourage using the (legacy) default/null stream, but is consistent with the CAI's semantics. For DLPack, ``stream=-1`` will be - internally passed to ``obj.__dlpack__()`` instead. + internally passed to ``obj.__dlpack__()`` instead. Attributes ---------- @@ -79,16 +79,16 @@ cdef class StridedMemoryView: bint is_device_accessible bint readonly object exporting_obj - - # If using dlpack, this is a strong reference to the result of - # obj.__dlpack__() so we can lazily create shape and strides from - # it later. If using CAI, this is a reference to the source + + # If using dlpack, this is a strong reference to the result of + # obj.__dlpack__() so we can lazily create shape and strides from + # it later. If using CAI, this is a reference to the source # `__cuda_array_interface__` object. cdef object metadata # The tensor object if has obj has __dlpack__, otherwise must be NULL cdef DLTensor *dl_tensor - + # Memoized properties cdef tuple _shape cdef tuple _strides @@ -110,7 +110,7 @@ cdef class StridedMemoryView: if self._shape is None and self.exporting_obj is not None: if self.dl_tensor != NULL: self._shape = cuda_utils.carray_int64_t_to_tuple( - self.dl_tensor.shape, + self.dl_tensor.shape, self.dl_tensor.ndim ) else: @@ -127,7 +127,7 @@ cdef class StridedMemoryView: if self.dl_tensor != NULL: if self.dl_tensor.strides: self._strides = cuda_utils.carray_int64_t_to_tuple( - self.dl_tensor.strides, + self.dl_tensor.strides, self.dl_tensor.ndim ) else: @@ -140,7 +140,7 @@ cdef class StridedMemoryView: self._strides, i, strides[i] // itemsize ) self._strides_init = True - return self._strides + return self._strides @property def dtype(self) -> Optional[numpy.dtype]: diff --git a/cuda_core/docs/source/_templates/autosummary/dataclass.rst b/cuda_core/docs/source/_templates/autosummary/dataclass.rst index 593126588..efb115c83 100644 --- a/cuda_core/docs/source/_templates/autosummary/dataclass.rst +++ b/cuda_core/docs/source/_templates/autosummary/dataclass.rst @@ -10,4 +10,3 @@ {% block methods %} .. automethod:: __init__ {% endblock %} - diff --git a/cuda_core/docs/source/_templates/autosummary/namedtuple.rst b/cuda_core/docs/source/_templates/autosummary/namedtuple.rst index 1695beef0..7ee8a09a1 100644 --- a/cuda_core/docs/source/_templates/autosummary/namedtuple.rst +++ b/cuda_core/docs/source/_templates/autosummary/namedtuple.rst @@ -8,4 +8,4 @@ .. autoclass:: {{ objname }} :members: __new__ :special-members: __new__ - :exclude-members: count, index, __reduce__, __reduce_ex__, __repr__, __hash__, __str__, __getnewargs__ \ No newline at end of file + :exclude-members: count, index, __reduce__, __reduce_ex__, __repr__, __hash__, __str__, __getnewargs__ diff --git a/cuda_core/docs/source/getting-started.rst b/cuda_core/docs/source/getting-started.rst index 502ea6637..47f8d193a 100644 --- a/cuda_core/docs/source/getting-started.rst +++ b/cuda_core/docs/source/getting-started.rst @@ -60,7 +60,7 @@ Don't forget to use :meth:`Device.set_current`! import cupy as cp from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch - + dev = Device() dev.set_current() s = dev.create_stream() @@ -82,14 +82,14 @@ We're using `CuPy `_ arrays as inputs for this example, but y .. code-block:: python ker = mod.get_kernel("vector_add") - + # Prepare input/output arrays (using CuPy) size = 50000 rng = cp.random.default_rng() a = rng.random(size, dtype=cp.float32) b = rng.random(size, dtype=cp.float32) c = cp.empty_like(a) - + # Configure launch parameters block = 256 grid = (size + block - 1) // block diff --git a/cuda_core/docs/source/install.rst b/cuda_core/docs/source/install.rst index 32028a63b..e864b042f 100644 --- a/cuda_core/docs/source/install.rst +++ b/cuda_core/docs/source/install.rst @@ -10,10 +10,10 @@ Runtime Requirements ``cuda.core`` is supported on all platforms that CUDA is supported. Specific dependencies are as follows: -.. list-table:: +.. list-table:: :header-rows: 1 - * - + * - - CUDA 12 - CUDA 13 * - CUDA Toolkit\ [#f1]_ diff --git a/cuda_core/docs/source/release/0.1.1-notes.rst b/cuda_core/docs/source/release/0.1.1-notes.rst index 5434d726e..f9ac2b5cc 100644 --- a/cuda_core/docs/source/release/0.1.1-notes.rst +++ b/cuda_core/docs/source/release/0.1.1-notes.rst @@ -2,7 +2,7 @@ .. SPDX-License-Identifier: Apache-2.0 .. currentmodule:: cuda.core.experimental - + ``cuda.core`` 0.1.1 Release Notes ================================= diff --git a/cuda_core/docs/source/release/0.3.2-notes.rst b/cuda_core/docs/source/release/0.3.2-notes.rst index 8b4763ed3..b1b087dbb 100644 --- a/cuda_core/docs/source/release/0.3.2-notes.rst +++ b/cuda_core/docs/source/release/0.3.2-notes.rst @@ -25,7 +25,7 @@ None. New features ------------ -- :class:`Stream` and :class:`Event` can be subclassed now. +- :class:`Stream` and :class:`Event` can be subclassed now. New examples diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 3506ce025..76e312b0d 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -97,10 +97,10 @@ select = [ ] ignore = [ - "UP006", - "UP007", + "UP006", + "UP007", "E741", # ambiguous variable name such as I - "B007", # rename unsued loop variable to _name + "B007", # rename unsued loop variable to _name "UP035" # UP006, UP007, UP035 complain about deprecated Typing. use, but disregard backward compatibility of python version ] diff --git a/cuda_core/tests/cython/test_get_cuda_native_handle.pyx b/cuda_core/tests/cython/test_get_cuda_native_handle.pyx index d1764d3bb..0c3921e92 100644 --- a/cuda_core/tests/cython/test_get_cuda_native_handle.pyx +++ b/cuda_core/tests/cython/test_get_cuda_native_handle.pyx @@ -23,7 +23,7 @@ cdef extern from "utility.hpp": def test_get_cuda_native_handle(): dev = Device(0) dev.set_current() - + s = dev.create_stream() cdef pyCUstream s_py = s.handle cdef CUstream s_c = get_cuda_native_handle(s_py) diff --git a/cuda_python/LICENSE b/cuda_python/LICENSE index b7d042fce..a5a65097c 100644 --- a/cuda_python/LICENSE +++ b/cuda_python/LICENSE @@ -2,46 +2,46 @@ NVIDIA SOFTWARE LICENSE This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of the NVIDIA CUDA Python software and materials provided hereunder ("SOFTWARE"). -This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users. +This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users. You agree to use the SOFTWARE only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions. 1. LICENSE. Subject to the terms of this license, NVIDIA grants you a non-exclusive limited license to: (a) install and use the SOFTWARE, and (b) distribute the SOFTWARE subject to the distribution requirements described in this license. NVIDIA reserves all rights, title and interest in and to the SOFTWARE not expressly granted to you under this license. -2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant: -a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA's intellectual property rights. -b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE. +2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant: +a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA's intellectual property rights. +b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE. 3. LIMITATIONS. Your license to use the SOFTWARE is restricted as follows: a. The SOFTWARE is licensed for you to develop applications only for use in systems with NVIDIA GPUs. -b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE. -c. You may not modify or create derivative works of any portion of the SOFTWARE. +b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE. +c. You may not modify or create derivative works of any portion of the SOFTWARE. d. You may not bypass, disable, or circumvent any technical measure, encryption, security, digital rights management or authentication mechanism in the SOFTWARE. e. You may not use the SOFTWARE in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SOFTWARE be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. -f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. -g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney's fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms. +f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. +g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney's fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms. -4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. +4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. 5. OWNERSHIP. The SOFTWARE and the related intellectual property rights therein are and will remain the sole and exclusive property of NVIDIA or its licensors. The SOFTWARE is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. NVIDIA may make changes to the SOFTWARE, at any time without notice, but is not obligated to support or update the SOFTWARE. - -6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict. + +6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict. 7. FEEDBACK. You may, but don't have to, provide to NVIDIA any Feedback. "Feedback" means any suggestions, bug fixes, enhancements, modifications, feature requests or other feedback regarding the SOFTWARE. For any Feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) the Feedback without the payment of any royalties or fees to you. NVIDIA will use Feedback at its choice. -8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. +8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. + +9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. -9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. +10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA's sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you. -10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA's sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you. +11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. -11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. +12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA's permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. -12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA's permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. - 13. EXPORT. The SOFTWARE is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury's Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this license, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SOFTWARE. -14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is "commercial items" consisting of "commercial computer software" and "commercial computer software documentation" provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051. +14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is "commercial items" consisting of "commercial computer software" and "commercial computer software documentation" provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051. 15. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. This license may only be modified in a writing signed by an authorized representative of each party. diff --git a/cuda_python/docs/source/release.rst b/cuda_python/docs/source/release.rst index c97e508c4..9e7a66a52 100644 --- a/cuda_python/docs/source/release.rst +++ b/cuda_python/docs/source/release.rst @@ -17,4 +17,3 @@ Release Notes 12.6.1 11.8.7 11.8.6 - From 8fb7a885ea61ec0bad4c34587011370077c54ea2 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 26 Aug 2025 11:06:00 -0400 Subject: [PATCH 065/113] Reduce overhead of bindings requiring `cuPythonInit()` (#894) * Reduce overhead of bindings requiring cuPythonInit() * Add changelog entry * Explicitly specific `inline` --- .../cuda/bindings/_bindings/cydriver.pyx.in | 12 +++++++++--- cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in | 12 +++++++++--- .../cuda/bindings/_bindings/cyruntime.pyx.in | 12 +++++++++--- cuda_bindings/docs/source/release/13.X.Y-notes.rst | 2 ++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 7fc86b565..6925ff635 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -490,10 +490,8 @@ cdef bint __cuPythonInit = False ctypedef CUresult (*__cuGetProcAddress_v2_T)(const char*, void**, int, cuuint64_t, CUdriverProcAddressQueryResult*) except?CUDA_ERROR_NOT_FOUND nogil cdef __cuGetProcAddress_v2_T _F_cuGetProcAddress_v2 = NULL -cdef int cuPythonInit() except -1 nogil: +cdef int _cuPythonInit() except -1 nogil: global __cuPythonInit - if __cuPythonInit: - return 0 cdef bint usePTDS cdef char libPath[260] @@ -8883,6 +8881,14 @@ cdef int cuPythonInit() except -1 nogil: __cuPythonInit = True return 0 +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cuPythonInit() except -1 nogil: + if __cuPythonInit: + return 0 + + return _cuPythonInit() + {{if 'cuGetErrorString' in found_functions}} cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index 16068f641..44ec26ffb 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -40,10 +40,8 @@ cdef bint __cuPythonInit = False {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}}cdef void *__nvrtcGetPCHHeapSizeRequired = NULL{{endif}} {{if 'nvrtcSetFlowCallback' in found_functions}}cdef void *__nvrtcSetFlowCallback = NULL{{endif}} -cdef int cuPythonInit() except -1 nogil: +cdef int _cuPythonInit() except -1 nogil: global __cuPythonInit - if __cuPythonInit: - return 0 with gil, __symbol_lock: {{if 'Windows' == platform.system()}} @@ -324,6 +322,14 @@ cdef int cuPythonInit() except -1 nogil: __cuPythonInit = True return 0 +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cuPythonInit() except -1 nogil: + if __cuPythonInit: + return 0 + + return _cuPythonInit() + {{if 'nvrtcGetErrorString' in found_functions}} cdef const char* _nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil: diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index a89dae196..c82189fa4 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -10,16 +10,22 @@ cimport cython cdef bint __cudaPythonInit = False cdef bint __usePTDS = False -cdef int cudaPythonInit() except -1 nogil: +cdef int _cudaPythonInit() except -1 nogil: global __cudaPythonInit global __usePTDS - if __cudaPythonInit: - return __usePTDS with gil: __usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=False) __cudaPythonInit = True return __usePTDS +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cudaPythonInit() except -1 nogil: + if __cudaPythonInit: + return __usePTDS + + return _cudaPythonInit() + {{if 'cudaDeviceReset' in found_functions}} cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 4ae8c86c9..4cf9bd940 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -16,6 +16,8 @@ Highlights * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. * The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. +* The Python overhead of calling functions in CUDA bindings in `driver`, `runtime` and `nvrtc` has been reduced by approximately 30%. + Known issues ------------ From 376e6842b47985ce021134ade8f4d4cbb7482651 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 11:46:31 -0400 Subject: [PATCH 066/113] Bump github/codeql-action from 3.29.10 to 3.29.11 (#905) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.10 to 3.29.11. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/96f518a34f7a870018057716cc4d7a5c014bd61c...3c3833e0f8c1c83d449a7478aa59c036a9165498) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3c2d94c5e..99ff1c364 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,13 +31,13 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10 + uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10 + uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11 with: category: "/language:${{matrix.language}}" From ecb81131d2831d5a44dc8e663436e8a50ca24bb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 11:47:23 -0400 Subject: [PATCH 067/113] Bump pypa/cibuildwheel from 3.1.3 to 3.1.4 (#908) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.1.3 to 3.1.4. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/352e01339f0a173aa2a3eb57f01492e341e83865...c923d83ad9c1bc00211c5041d0c3f73294ff88f6) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-version: 3.1.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 803a70cbd..8d93d7e0b 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -107,7 +107,7 @@ jobs: if-no-files-found: error - name: Build cuda.core wheel - uses: pypa/cibuildwheel@352e01339f0a173aa2a3eb57f01492e341e83865 # v3.1.3 + uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" @@ -149,7 +149,7 @@ jobs: cuda-version: ${{ inputs.cuda-version }} - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@352e01339f0a173aa2a3eb57f01492e341e83865 # v3.1.3 + uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" From 135af40b408178845c30256b5fc3766840ffdbc7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 Aug 2025 23:36:52 -0700 Subject: [PATCH 068/113] Add Sphinx documentation for cuda.pathfinder (#884) * Initial plan * Create Sphinx documentation infrastructure for cuda.pathfinder Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix title underline and test pathfinder documentation build Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address all review feedback - fix references, remove unnecessary files, populate API docs Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add cuda-pathfinder documentation link to CI doc preview Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * [pre-commit.ci] auto code formatting * Update cuda-core and cuda-bindings README to reference nv-versions.json Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Refactor pathfinder documentation based on review feedback - Remove lines 7-14 from api.rst (cuda.pathfinder automodule section) - Convert api.rst to use autosummary instead of direct autodoc directives following cuda-core pattern - Convert contribute.md to contribute.rst in ReST format - Remove _templates/main.html file as it's no longer needed - Update index.rst to reference contribute.rst instead of contribute.md Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add release notes for cuda-pathfinder versions 1.0.0 and 1.1.0 - Created release directory structure under cuda_pathfinder/docs/source/release/ - Added 1.0.0-notes.rst with initial release highlights - Added 1.1.0-notes.rst with CTK 13.0.0 compatibility and bug fixes - Added release.rst index file to organize release notes - Updated index.rst to include release notes in navigation - Follows established documentation patterns from cuda-core and cuda-bindings Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SPDX license identifiers and add 1.1.1 release notes for PRs #834 and #855 Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Restore _templates/main.html file as requested in review feedback Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Change format as requested by Leo https://github.com/NVIDIA/cuda-python/pull/884#discussion_r2297066578 * Remove stray cuda/pathfinder/README.md URL in cuda_python/docs/source/index.rst * Rename release 1.1.1 to 1.X.Y * Add version 1.0.0 in cuda_pathfinder/docs/nv-versions.json * Remove unused cuda_pathfinder/docs/make.bat * Revert "Add version 1.0.0 in cuda_pathfinder/docs/nv-versions.json" This reverts commit d096d2169ca79f867aef9ebee565a272859ae8e4. * Reduce divergence between cuda_bindings/docs/source/contribute.rst and cuda_pathfinder/docs/source/contribute.rst * New pre-commit fixes (related to PR #901) * Also remove version 1.1.0 from cuda_pathfinder/docs/nv-versions.json * Reduce cuda/pathfinder/README.md to a mere pointer to the sphinx-generated documentation. * Add the Search order section from the old README as a new section in the load_nvidia_dynamic_lib() docstring. * Leo's edits to new part of load_nvidia_dynamic_lib docstring Co-authored-by: Leo Fang * Add more empty lines in load_nvidia_dynamic_lib docstring * Remove `**` around Linux, Windows (for consistency) * Fix existing (on main) pre-commit error * Add `*/docs/source/generated/` to .gitignore * Add toolshed/setup-docs-env.sh --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Leo Fang Co-authored-by: Ralf W. Grosse-Kunstleve Co-authored-by: Ralf W. Grosse-Kunstleve --- .github/actions/doc_preview/action.yml | 3 +- .github/workflows/build-docs.yml | 1 + .gitignore | 1 + README.md | 2 +- cuda_bindings/docs/README.md | 4 +- .../docs/source/release/13.X.Y-notes.rst | 2 +- cuda_core/docs/README.md | 4 +- cuda_pathfinder/cuda/pathfinder/README.md | 46 +-------- .../_dynamic_libs/load_nvidia_dynamic_lib.py | 54 ++++++++++- cuda_pathfinder/docs/Makefile | 23 +++++ cuda_pathfinder/docs/README.md | 11 +++ cuda_pathfinder/docs/build_docs.sh | 50 ++++++++++ cuda_pathfinder/docs/nv-versions.json | 6 ++ .../docs/source/_templates/main.html | 13 +++ cuda_pathfinder/docs/source/api.rst | 20 ++++ cuda_pathfinder/docs/source/conf.py | 95 +++++++++++++++++++ cuda_pathfinder/docs/source/contribute.rst | 17 ++++ cuda_pathfinder/docs/source/index.rst | 26 +++++ cuda_pathfinder/docs/source/license.rst | 8 ++ cuda_pathfinder/docs/source/release.rst | 12 +++ .../docs/source/release/1.0.0-notes.rst | 17 ++++ .../docs/source/release/1.1.0-notes.rst | 16 ++++ .../docs/source/release/1.X.Y-notes.rst | 25 +++++ cuda_python/docs/build_all_docs.sh | 10 ++ cuda_python/docs/environment-docs.yml | 2 + cuda_python/docs/source/index.rst | 3 +- toolshed/setup-docs-env.sh | 68 +++++++++++++ 27 files changed, 482 insertions(+), 57 deletions(-) create mode 100644 cuda_pathfinder/docs/Makefile create mode 100644 cuda_pathfinder/docs/README.md create mode 100755 cuda_pathfinder/docs/build_docs.sh create mode 100644 cuda_pathfinder/docs/nv-versions.json create mode 100644 cuda_pathfinder/docs/source/_templates/main.html create mode 100644 cuda_pathfinder/docs/source/api.rst create mode 100644 cuda_pathfinder/docs/source/conf.py create mode 100644 cuda_pathfinder/docs/source/contribute.rst create mode 100644 cuda_pathfinder/docs/source/index.rst create mode 100644 cuda_pathfinder/docs/source/license.rst create mode 100644 cuda_pathfinder/docs/source/release.rst create mode 100644 cuda_pathfinder/docs/source/release/1.0.0-notes.rst create mode 100644 cuda_pathfinder/docs/source/release/1.1.0-notes.rst create mode 100644 cuda_pathfinder/docs/source/release/1.X.Y-notes.rst create mode 100755 toolshed/setup-docs-env.sh diff --git a/.github/actions/doc_preview/action.yml b/.github/actions/doc_preview/action.yml index 6948522da..ae4f81115 100644 --- a/.github/actions/doc_preview/action.yml +++ b/.github/actions/doc_preview/action.yml @@ -41,7 +41,8 @@ runs: :---: |

:rocket: View preview at
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-core/
- |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-bindings/

+ |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-bindings/
+ |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-pathfinder/

|

Preview will be ready when the GitHub Pages deployment is complete.

# The steps below are executed only when building on main. diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index ed58b4f26..37fa21159 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -19,6 +19,7 @@ on: # - cuda-core # - cuda-bindings # - cuda-python + # - cuda-pathfinder # - all git-tag: description: "Target git tag to build docs for" diff --git a/.gitignore b/.gitignore index a9e5941f6..53c2e4f35 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ instance/ # Sphinx documentation docs_src/_build/ +*/docs/source/generated/ # PyBuilder .pybuilder/ diff --git a/README.md b/README.md index 5f8f3a11e..cffa52f2e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c * [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities * [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs -* [cuda.pathfinder](https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md): Utilities for locating CUDA components installed in the user's Python environment +* [cuda.pathfinder](https://nvidia.github.io/cuda-python/cuda-pathfinder/latest): Utilities for locating CUDA components installed in the user's Python environment * [cuda.cccl.cooperative](https://nvidia.github.io/cccl/python/cooperative): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels * [cuda.cccl.parallel](https://nvidia.github.io/cccl/python/parallel): A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc. that are callable on the *host* * [numba.cuda](https://nvidia.github.io/numba-cuda/): Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. diff --git a/cuda_bindings/docs/README.md b/cuda_bindings/docs/README.md index a5e65842a..54d670d09 100644 --- a/cuda_bindings/docs/README.md +++ b/cuda_bindings/docs/README.md @@ -1,11 +1,11 @@ # Build the documentation 1. Install the `cuda-bindings` package of the version that we need to document. -2. Ensure the version is included in the [`versions.json`](./versions.json). +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). 3. Build the docs with `./build_docs.sh`. 4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. Alternatively, we can build all the docs at once by running [`cuda_python/docs/build_all_docs.sh`](../../cuda_python/docs/build_all_docs.sh). To publish the docs with the built version, it is important to note that the html files of older versions -should be kept intact, in order for the version selection (through `versions.json`) to work. +should be kept intact, in order for the version selection (through `nv-versions.json`) to work. diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 4cf9bd940..0e0e82bad 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -16,7 +16,7 @@ Highlights * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. * The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. -* The Python overhead of calling functions in CUDA bindings in `driver`, `runtime` and `nvrtc` has been reduced by approximately 30%. +* The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. Known issues diff --git a/cuda_core/docs/README.md b/cuda_core/docs/README.md index 7402ba68e..a4c0aacf6 100644 --- a/cuda_core/docs/README.md +++ b/cuda_core/docs/README.md @@ -1,11 +1,11 @@ # Build the documentation 1. Install the `cuda-core` package of the version that we need to document. -2. Ensure the version is included in the [`versions.json`](./versions.json). +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). 3. Build the docs with `./build_docs.sh`. 4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. Alternatively, we can build all the docs at once by running [`cuda_python/docs/build_all_docs.sh`](../../cuda_python/docs/build_all_docs.sh). To publish the docs with the built version, it is important to note that the html files of older versions -should be kept intact, in order for the version selection (through `versions.json`) to work. +should be kept intact, in order for the version selection (through `nv-versions.json`) to work. diff --git a/cuda_pathfinder/cuda/pathfinder/README.md b/cuda_pathfinder/cuda/pathfinder/README.md index ebed211fe..c020fc6a2 100644 --- a/cuda_pathfinder/cuda/pathfinder/README.md +++ b/cuda_pathfinder/cuda/pathfinder/README.md @@ -1,45 +1,3 @@ -# `cuda.pathfinder` Module +### The `cuda.pathfinder` documentation was moved -## Public API for loading NVIDIA Dynamic Libs - -* `cuda.pathfinder.SUPPORTED_NVIDIA_LIBNAMES` (`tuple[str]`) - -* `cuda.pathfinder.load_nvidia_dynamic_lib(libname: str) -> LoadedDL` - -* `cuda.pathfinder.LoadedDL`: - * `abs_path` (`str`) - * `was_already_loaded_from_elsewhere` (`bool`) - -* `cuda.pathfinder.DynamicLibNotFoundError` (inherits from `RuntimeError`) - -## Dynamic Library Loading Search Priority - -The `cuda.pathfinder.load_nvidia_dynamic_lib` function implements a -hierarchical search strategy for locating NVIDIA shared libraries: - -0. **Check if a library was loaded into the process already by some other means.** - - If yes, there is no alternative to skipping the rest of the search logic. - The absolute path of the already loaded library will be returned, along - with the handle to the library. - -1. **NVIDIA Python wheels** - - Scans all site-packages to find libraries installed via NVIDIA Python wheels. - -2. **OS default mechanisms / Conda environments** - - Falls back to native loader: - - `dlopen()` on Linux - - `LoadLibraryW()` on Windows - - Conda installations are expected to be discovered: - - Linux: Via `$ORIGIN/../lib` on `RPATH` (of the `python` binary; - note that this preempts `LD_LIBRARY_PATH` and `/etc/ld.so.conf.d/`) - - Windows: Via `%CONDA_PREFIX%\Library\bin` on system `PATH` - - CTK installations with system config updates are expected to be discovered: - - Linux: Via `/etc/ld.so.conf.d/*cuda*.conf` - - Windows: Via `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\bin` on system `PATH` - -3. **Environment variables** - - Relies on `CUDA_HOME` or `CUDA_PATH` environment variables if set - (in that order). - -Note that the search is done on a per-library basis. Currently there is no -centralized mechanism that ensures all libraries are found in the same way. +Please see https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/ diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py index 29f265460..3160333aa 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py @@ -53,16 +53,62 @@ def _load_lib_no_cache(libname: str) -> LoadedDL: @functools.cache def load_nvidia_dynamic_lib(libname: str) -> LoadedDL: - """Load a NVIDIA dynamic library by name. + """Load an NVIDIA dynamic library by name. Args: - libname: The name of the library to load (e.g. "cudart", "nvvm", etc.) + libname (str): The short name of the library to load (e.g., ``"cudart"``, + ``"nvvm"``, etc.). Returns: - A LoadedDL object containing the library handle and path + LoadedDL: Object containing the OS library handle and absolute path. Raises: - RuntimeError: If the library cannot be found or loaded + DynamicLibNotFoundError: If the library cannot be found or loaded. + RuntimeError: If Python is not 64-bit. + + Search order: + 0. **Already loaded in the current process** + + - If a matching library is already loaded by some other component, + return its absolute path and handle and skip the rest of the search. + + 1. **NVIDIA Python wheels** + + - Scan installed distributions (``site-packages``) to find libraries + shipped in NVIDIA wheels. + + 2. **OS default mechanisms / Conda environments** + + - Fall back to the native loader: + + - Linux: ``dlopen()`` + + - Windows: ``LoadLibraryW()`` + + - Conda installations are commonly discovered via: + + - Linux: ``$ORIGIN/../lib`` in the ``RPATH`` of the ``python`` binary + (note: this can take precedence over ``LD_LIBRARY_PATH`` and + ``/etc/ld.so.conf.d/``). + + - Windows: ``%CONDA_PREFIX%\\Library\\bin`` on the system ``PATH``. + + - CUDA Toolkit (CTK) system installs with system config updates are often + discovered via: + + - Linux: ``/etc/ld.so.conf.d/*cuda*.conf`` + + - Windows: ``C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\vX.Y\\bin`` + on the system ``PATH``. + + 3. **Environment variables** + + - If set, use ``CUDA_HOME`` or ``CUDA_PATH`` (in that order). + + Notes: + The search is performed **per library**. There is currently no mechanism to + guarantee that multiple libraries are all resolved from the same location. + """ pointer_size_bits = struct.calcsize("P") * 8 if pointer_size_bits != 64: diff --git a/cuda_pathfinder/docs/Makefile b/cuda_pathfinder/docs/Makefile new file mode 100644 index 000000000..3d73179c5 --- /dev/null +++ b/cuda_pathfinder/docs/Makefile @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= -j auto +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build/html/${SPHINX_CUDA_PATHFINDER_VER} + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -b help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/cuda_pathfinder/docs/README.md b/cuda_pathfinder/docs/README.md new file mode 100644 index 000000000..47b62fc67 --- /dev/null +++ b/cuda_pathfinder/docs/README.md @@ -0,0 +1,11 @@ +# Build the documentation + +1. Install the `cuda-pathfinder` package of the version that we need to document. +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). +3. Build the docs with `./build_docs.sh`. +4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. + +Alternatively, we can build all the docs at once by running [`cuda_python/docs/build_all_docs.sh`](../../cuda_python/docs/build_all_docs.sh). + +To publish the docs with the built version, it is important to note that the html files of older versions +should be kept intact, in order for the version selection (through `nv-versions.json`) to work. diff --git a/cuda_pathfinder/docs/build_docs.sh b/cuda_pathfinder/docs/build_docs.sh new file mode 100755 index 000000000..3d70cd558 --- /dev/null +++ b/cuda_pathfinder/docs/build_docs.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +if [[ "$#" == "0" ]]; then + LATEST_ONLY="0" +elif [[ "$#" == "1" && "$1" == "latest-only" ]]; then + LATEST_ONLY="1" +else + echo "usage: ./build_docs.sh [latest-only]" + exit 1 +fi + +# SPHINX_CUDA_PATHFINDER_VER is used to create a subdir under build/html +# (the Makefile file for sphinx-build also honors it if defined). +# If there's a post release (ex: .post1) we don't want it to show up in the +# version selector or directory structure. +if [[ -z "${SPHINX_CUDA_PATHFINDER_VER}" ]]; then + export SPHINX_CUDA_PATHFINDER_VER=$(python -c "from importlib.metadata import version; \ + ver = '.'.join(str(version('cuda-pathfinder')).split('.')[:3]); \ + print(ver)" \ + | awk -F'+' '{print $1}') +fi + +# build the docs (in parallel) +SPHINXOPTS="-j 4 -d build/.doctrees" make html + +# for debugging/developing (conf.py), please comment out the above line and +# use the line below instead, as we must build in serial to avoid getting +# obsecure Sphinx errors +#SPHINXOPTS="-v" make html + +# to support version dropdown menu +cp ./nv-versions.json build/html + +# to have a redirection page (to the latest docs) +cp source/_templates/main.html build/html/index.html + +# ensure that the latest docs is the one we built +if [[ $LATEST_ONLY == "0" ]]; then + cp -r build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest +else + mv build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest +fi + +# ensure that the Sphinx reference uses the latest docs +cp build/html/latest/objects.inv build/html diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json new file mode 100644 index 000000000..1b3847578 --- /dev/null +++ b/cuda_pathfinder/docs/nv-versions.json @@ -0,0 +1,6 @@ +[ + { + "version": "latest", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" + } +] diff --git a/cuda_pathfinder/docs/source/_templates/main.html b/cuda_pathfinder/docs/source/_templates/main.html new file mode 100644 index 000000000..38a8d2d64 --- /dev/null +++ b/cuda_pathfinder/docs/source/_templates/main.html @@ -0,0 +1,13 @@ + + + + + + + + +

If this page does not refresh automatically, then please direct your browser to + our latest cuda.pathfinder docs. +

+ + diff --git a/cuda_pathfinder/docs/source/api.rst b/cuda_pathfinder/docs/source/api.rst new file mode 100644 index 000000000..1870711a1 --- /dev/null +++ b/cuda_pathfinder/docs/source/api.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda.pathfinder`` API Reference +================================= + +The ``cuda.pathfinder`` module provides utilities for loading NVIDIA dynamic libraries. + +Public API +----------- + +.. autosummary:: + :toctree: generated/ + + SUPPORTED_NVIDIA_LIBNAMES + load_nvidia_dynamic_lib + LoadedDL + DynamicLibNotFoundError diff --git a/cuda_pathfinder/docs/source/conf.py b/cuda_pathfinder/docs/source/conf.py new file mode 100644 index 000000000..4ede571f2 --- /dev/null +++ b/cuda_pathfinder/docs/source/conf.py @@ -0,0 +1,95 @@ +# SPDX-FileCopyrightText: Copyright (c) 2012-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +import os + +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = "cuda.pathfinder" +copyright = "2025, NVIDIA" +author = "NVIDIA" + +# The full version, including alpha/beta/rc tags +release = os.environ["SPHINX_CUDA_PATHFINDER_VER"] + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx.ext.intersphinx", + "myst_nb", + "enum_tools.autoenum", + "sphinx_copybutton", +] + +nb_execution_mode = "off" + +numfig = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_baseurl = "docs" +html_theme = "nvidia_sphinx_theme" +html_theme_options = { + "switcher": { + "json_url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/nv-versions.json", + "version_match": release, + }, + # Add light/dark mode and documentation version switcher + "navbar_center": [ + "version-switcher", + "navbar-nav", + ], +} +if os.environ.get("CI"): + if int(os.environ.get("BUILD_PREVIEW", 0)): + PR_NUMBER = f"{os.environ['PR_NUMBER']}" + PR_TEXT = f'PR {PR_NUMBER}' + html_theme_options["announcement"] = f"Warning: This documentation is only a preview for {PR_TEXT}!" + elif int(os.environ.get("BUILD_LATEST", 0)): + html_theme_options["announcement"] = ( + "Warning: This documentation is built from the development branch!" + ) + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# skip cmdline prompts +copybutton_exclude = ".linenos, .gp" + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), +} diff --git a/cuda_pathfinder/docs/source/contribute.rst b/cuda_pathfinder/docs/source/contribute.rst new file mode 100644 index 000000000..4bfcd9c38 --- /dev/null +++ b/cuda_pathfinder/docs/source/contribute.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. _contributor_guide: + +Contributing +============ + +Thank you for your interest in contributing to ``cuda-pathfinder``! Based on the type of contribution, it will fall into two categories: + +1. You want to report a bug, feature request, or documentation issue + - File an `issue `_ describing what you encountered or what you want to see changed. + - The NVIDIA team will evaluate the issues and triage them, scheduling + them for a release. If you believe the issue needs priority attention + comment on the issue to notify the team. +2. You want to implement a feature, improvement, or bug fix: + - Please ensure that your commits are signed `following GitHub's instruction `_. diff --git a/cuda_pathfinder/docs/source/index.rst b/cuda_pathfinder/docs/source/index.rst new file mode 100644 index 000000000..b569d07b4 --- /dev/null +++ b/cuda_pathfinder/docs/source/index.rst @@ -0,0 +1,26 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +``cuda.pathfinder``: Utilities for locating CUDA components +=========================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + api + contribute + license + +.. toctree:: + :maxdepth: 2 + + release + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/cuda_pathfinder/docs/source/license.rst b/cuda_pathfinder/docs/source/license.rst new file mode 100644 index 000000000..39c156a89 --- /dev/null +++ b/cuda_pathfinder/docs/source/license.rst @@ -0,0 +1,8 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Software License Agreement +************************** + +.. literalinclude:: ../../LICENSE + :language: text diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst new file mode 100644 index 000000000..f90e50d26 --- /dev/null +++ b/cuda_pathfinder/docs/source/release.rst @@ -0,0 +1,12 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Release Notes +============= + +.. toctree:: + :maxdepth: 3 + + 1.X.Y + 1.1.0 + 1.0.0 diff --git a/cuda_pathfinder/docs/source/release/1.0.0-notes.rst b/cuda_pathfinder/docs/source/release/1.0.0-notes.rst new file mode 100644 index 000000000..33c794197 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.0.0-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.0.0 Release notes +======================================== + +Released on Jul 16, 2025 + + +Highlights +---------- + +* First release of ``cuda-pathfinder`` as a stand-alone module. +* Replaces ``cuda.bindings.path_finder``, which was released with ``cuda-bindings`` 12.9.0 and is now `deprecated `_. +* ``cuda-pathfinder`` is a noarch package and has no dependencies (other than a Python 3.9+ interpreter). diff --git a/cuda_pathfinder/docs/source/release/1.1.0-notes.rst b/cuda_pathfinder/docs/source/release/1.1.0-notes.rst new file mode 100644 index 000000000..14c3ba5b8 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.1.0-notes.rst @@ -0,0 +1,16 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.1.0 Release notes +======================================== + +Released on Aug 7, 2025 + + +Highlights +---------- + +* CTK 13.0.0 compatibility +* Bug fix: load ``libnvJitLink.so.12`` from conda, not ``/usr/local/cuda`` (`PR #767 `_) diff --git a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst new file mode 100644 index 000000000..769e6f546 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst @@ -0,0 +1,25 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.X.Y Release notes +======================================== + +Released on TBD + + +Highlights +---------- + +* ``RTLD_DI_LINKMAP``-based new implementation of ``abs_path_for_dynamic_library()`` (`PR #834 `_) + + - Eliminates ``supported_nvidia_libs.EXPECTED_LIB_SYMBOLS`` entirely, providing major simplification + - Step towards resolving library discovery issues + - Includes minor fixes and cleanup + +* Make ``add_dll_directory()`` and ``load_dependencies()`` side-effects more deterministic (`PR #855 `_) + + - Improves stability in general and supports nvmath specifically + - Proactive change to improve library loading consistency + - Drops boilerplate docstrings for private functions diff --git a/cuda_python/docs/build_all_docs.sh b/cuda_python/docs/build_all_docs.sh index 700f19d5e..5c2765b98 100755 --- a/cuda_python/docs/build_all_docs.sh +++ b/cuda_python/docs/build_all_docs.sh @@ -28,3 +28,13 @@ rm -rf build ./build_docs.sh $@ cp -r build/html/* "$(dirs -l +1)"/$CUDA_CORE_PATH popd + +# build cuda-pathfinder docs +CUDA_PATHFINDER_PATH=build/html/cuda-pathfinder +mkdir -p $CUDA_PATHFINDER_PATH +pushd . +cd ../../cuda_pathfinder/docs +rm -rf build +./build_docs.sh $@ +cp -r build/html/* "$(dirs -l +1)"/$CUDA_PATHFINDER_PATH +popd diff --git a/cuda_python/docs/environment-docs.yml b/cuda_python/docs/environment-docs.yml index 47f1875e3..f48579843 100644 --- a/cuda_python/docs/environment-docs.yml +++ b/cuda_python/docs/environment-docs.yml @@ -5,6 +5,8 @@ name: cuda-python-docs channels: - conda-forge dependencies: + # ATTENTION: This dependency list is duplicated in + # toolshed/setup-docs-env.sh. Please KEEP THEM IN SYNC! - cython - myst-parser - numpy diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index d11cdbd7e..9d2cfc93d 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -15,7 +15,6 @@ multiple components: - `numba.cuda`_: Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model. * `nvmath-python`_: Pythonic access to NVIDIA CPU & GPU Math Libraries, with both *host* and *device* (through `nvmath.device`_) APIs. It also provides low-level Python bindings to host C APIs (through `nvmath.bindings`_). -.. _cuda.pathfinder: https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md .. _nvmath-python: https://docs.nvidia.com/cuda/nvmath-python/latest .. _nvmath.device: https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#device-apis .. _nvmath.bindings: https://docs.nvidia.com/cuda/nvmath-python/latest/bindings/index.html @@ -35,7 +34,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio release cuda.core cuda.bindings - cuda.pathfinder + cuda.pathfinder cuda.cccl.cooperative cuda.cccl.parallel numba.cuda diff --git a/toolshed/setup-docs-env.sh b/toolshed/setup-docs-env.sh new file mode 100755 index 000000000..9d4768156 --- /dev/null +++ b/toolshed/setup-docs-env.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Setup a local conda environment for building the sphinx docs to mirror the CI environment +# (see cuda_python/docs/environment-docs.yml). +# +# Usage: +# ./toolshed/setup-docs-env.sh +# +# Notes: +# - Requires an existing Miniforge/Conda install and `conda` on PATH. +# - Installs the same packages as CI’s environment-docs.yml. + +set -euo pipefail + +ENV_NAME="cuda-python-docs" +PYVER="3.12" + +have_cmd() { command -v "$1" >/dev/null 2>&1; } + +# --- sanity checks ----------------------------------------------------------- +if ! have_cmd conda; then + echo "ERROR: 'conda' not found on PATH. Please ensure Miniforge is installed and initialized." >&2 + exit 1 +fi + +# Load conda's shell integration into this bash process +eval "$(conda shell.bash hook)" + +if conda env list | awk '{print $1}' | grep -qx "${ENV_NAME}"; then + echo "⚠ Environment '${ENV_NAME}' already exists → NO ACTION" + exit 0 +fi + +echo "Creating environment '${ENV_NAME}'…" +# ATTENTION: This dependency list is duplicated in +# cuda_python/docs/environment-docs.yml. Please KEEP THEM IN SYNC! +conda create -y -n "${ENV_NAME}" \ + "python=${PYVER}" \ + cython \ + myst-parser \ + numpy \ + numpydoc \ + pip \ + pydata-sphinx-theme \ + pytest \ + scipy \ + "sphinx<8.2.0" \ + sphinx-copybutton \ + myst-nb \ + enum_tools \ + sphinx-toolbox \ + pyclibrary + +conda activate "${ENV_NAME}" +python -m pip install --upgrade pip +python -m pip install nvidia-sphinx-theme + +echo +echo "✅ Environment '${ENV_NAME}' is ready." +echo +echo "Build docs with e.g.:" +echo " conda activate ${ENV_NAME}" +echo " cd cuda_pathfinder/" +echo " pip install -e ." +echo " (cd docs/ && rm -rf build && ./build_docs.sh)" From 2bd44a2d9ee34dccd80a3085bc7e1383f854ce2f Mon Sep 17 00:00:00 2001 From: Keith Kraus Date: Wed, 27 Aug 2025 12:48:55 -0400 Subject: [PATCH 069/113] Update permissions in test_cufile to use 600 instead of 644 (#910) --- cuda_bindings/tests/test_cufile.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 6d5ef5699..84ed17426 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -169,7 +169,7 @@ def test_handle_register(): file_path = "test_handle_register.bin" # Create file with POSIX operations - fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) # Write test data using POSIX write test_data = b"Test data for cuFile - POSIX write" @@ -499,7 +499,7 @@ def test_cufile_read_write(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile write_buf_int = int(write_buf) @@ -598,7 +598,7 @@ def test_cufile_read_write_host_memory(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register host buffers with cuFile write_buf_int = int(write_buf) @@ -699,7 +699,7 @@ def test_cufile_read_write_large(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile write_buf_int = int(write_buf) @@ -790,7 +790,7 @@ def test_cufile_write_async(cufile_env_json): # Create test file file_path = "test_cufile_write_async.bin" - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: # Register file handle @@ -885,7 +885,7 @@ def test_cufile_read_async(cufile_env_json): file_path = "test_cufile_read_async.bin" # First create and write test data without O_DIRECT - fd_temp = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o644) + fd_temp = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) # Create test data that's aligned to 4096 bytes test_string = b"Async read test data for cuFile!" test_string_len = len(test_string) @@ -989,7 +989,7 @@ def test_cufile_async_read_write(cufile_env_json): # Create test file file_path = "test_cufile_async_rw.bin" - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: # Register file handle @@ -1136,7 +1136,7 @@ def test_batch_io_basic(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile for buf in buffers: @@ -1350,7 +1350,7 @@ def test_batch_io_cancel(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile for buf in buffers: @@ -1460,7 +1460,7 @@ def test_batch_io_large_operations(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register all buffers with cuFile all_buffers = write_buffers + read_buffers From b8562d3c841b7336214e1c473805b1eef569e6cb Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 27 Aug 2025 10:05:38 -0700 Subject: [PATCH 070/113] Dependabot: consolidate GitHub Actions updates to monthly (#909) * Dependabot: consolidate GitHub Actions updates to monthly * Fix existing (on main) pre-commit error --- .github/dependabot.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5c1aafb1f..2c0c08300 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,4 +7,15 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly + interval: "monthly" + time: "09:00" + timezone: "America/Los_Angeles" + + # Keep churn down: only one open PR from this ecosystem at a time + open-pull-requests-limit: 1 + + groups: + actions-monthly: + applies-to: version-updates + patterns: ["*"] + update-types: ["minor", "patch"] From 333367e40d032becd75cc779dbae6d617fd2954c Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 27 Aug 2025 10:54:11 -0700 Subject: [PATCH 071/113] Pre commit fixes (#911) * Define gen_exclude anchor at first use to resolve warning This was the warning: [WARNING] Unexpected key(s) present at root: gen_exclude Also fix the regex: the old pattern was missing the ^ before the second alternative * Remove requirements-txt-fixer To avoid this line: ``` fix requirements.txt.................................(no files to check)Skipped ``` * Change the commit hash in .github/workflows/bandit.yml --- .github/workflows/bandit.yml | 2 +- .pre-commit-config.yaml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index c80831095..46663929f 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -20,4 +20,4 @@ jobs: security-events: write steps: - name: Perform Bandit Analysis - uses: PyCQA/bandit-action@67a458d90fa11fb1463e91e7f4c8f068b5863c7f # v1.0.1 + uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0479db6a5..4da2dddef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,8 +12,6 @@ ci: skip: [bandit] submodules: false -gen_exclude: &gen_exclude '^cuda_bindings/cuda/bindings/.*\.in?$|cuda_bindings/docs/source/module/.*\.rst?$' - # Please update the rev: SHAs below with this command: # pre-commit autoupdate --freeze repos: @@ -54,9 +52,8 @@ repos: - id: check-yaml - id: debug-statements - id: end-of-file-fixer - exclude: *gen_exclude + exclude: &gen_exclude '^(?:cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?)$' - id: mixed-line-ending - - id: requirements-txt-fixer - id: trailing-whitespace exclude: *gen_exclude From 1137e1555b23bb7ca77e77833bb7d785794d8f0b Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 27 Aug 2025 18:52:58 -0700 Subject: [PATCH 072/113] Support non-CTK Nvidia libraries, add general fallback for unsupported libs under site-packages (#864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add find_site_packages_so.py * Use find_all_so_files_under_all_site_packages() from _find_so_using_nvidia_lib_dirs() * Bump cuda-pathfinder version to `1.1.1a3` * Limit site-packages search to ("nvidia", "nvpl") subdirs. * Replace find_all_so_files_under_all_site_packages → find_all_so_files_via_metadata * Add find_site_packages_dll.py and use from _find_dll_using_nvidia_bin_dirs() * Add mathdx, cufftMp DIRECT_DEPENDENCIES * Add LIBNAMES_REQUIRING_RTLD_DEEPBIND feature (for cufftMp) * pyproject.toml: add libmathdx, cufftmpm nvshmem, nvpl-fft wheels for testing. * Add SITE_PACKAGES_LIBDIRS_LINUX * Add make_site_packages_libdirs_linux.py * Use SITE_PACKAGES_LIBDIRS_LINUX in _find_so_using_nvidia_lib_dirs, keep find_all_so_files_via_metadata as fallback * Add SITE_PACKAGES_LIBDIRS_WINDOWS and toolshed/make_site_packages_libdirs_windows.py * chmod 755 make_site_packages_libdirs_windows.py * Adds paths for the CUDA static library based on CUDA_HOME (#608). * Removes LIB and LIBRARY_PATH environment variables from the build-wheel workflow. * Updates Linux install to search both lib and lib64 directories for CUDA libraries. * Removes LIBRARY_PATH environment variable from installation docs (no longer needed due to resolution of #608). * Use SITE_PACKAGES_LIBDIRS_WINDOWS in _find_dll_using_nvidia_bin_dirs, keep find_all_dll_files_via_metadata as fallback * Factor out SITE_PACKAGES_LIBDIRS_*_CTK, add test_supported_libnames_*_site_packages_libdirs_ctk_consistency * Also exercise "other" (non-CTK) libnames in test_load_nvidia_dynamic_lib.py Factor out tests/child_load_nvidia_dynamic_lib_helper.py to significantly improve performance. * Exercise fallback code path using pygit2 wheel. * Add other_wheels,foreign_wheels to pip install nvidia_wheels_cu13 * Add toolshed/collect_site_packages_so_files.sh, with terse Usage comment. * Add toolshed/collect_site_packages_dll_files.ps1 with terse Usage comment. * Add pygit2 comments. * Replace special-case workaround in tests/child_load_nvidia_dynamic_lib_helper.py with a more general approach. * Add anticipated CTK 13 paths for mathdx in SITE_PACKAGES_LIBDIRS_LINUX_OTHER, SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER * Rename other_wheels → nvidia_wheels_host * WIP * Restore _no_such_file_in_sub_dirs error reporting * Use `pip install -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_wheels_host,foreign_wheels]"` to also test pathfinder with `nvidia_wheels_cu12` * Export TEST_CUDA_MAJOR to the GITHUB_ENV * Fix existing (on main) pre-commit error * Do not install nvidia-cufftmp-cu12 on Windows (it is only a placeholder package) * Leo's --only-binary=:all: suggestions * Leo's --only-binary=:all: suggestions (toolshed scripts) * Remove fallback code paths in _find_so_using_nvidia_lib_dirs, _find_dll_using_nvidia_bin_dirs and associated foreign_wheels unit test * Consolidate make_site_packages_libdirs_linux.py + make_site_packages_libdirs_windows.py → make_site_packages_libdirs.py --------- Co-authored-by: Andy Jost --- .github/workflows/test-wheel-linux.yml | 9 +- .github/workflows/test-wheel-windows.yml | 8 +- ci/tools/env-vars | 1 + .../_dynamic_libs/find_nvidia_dynamic_lib.py | 57 ++++----- .../pathfinder/_dynamic_libs/load_dl_linux.py | 21 +++- .../_dynamic_libs/supported_nvidia_libs.py | 96 ++++++++++++++- .../_utils/find_site_packages_dll.py | 26 +++++ .../_utils/find_site_packages_so.py | 39 +++++++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/pyproject.toml | 7 ++ .../child_load_nvidia_dynamic_lib_helper.py | 53 +++++++++ .../tests/test_load_nvidia_dynamic_lib.py | 76 ++++++------ toolshed/collect_site_packages_dll_files.ps1 | 44 +++++++ toolshed/collect_site_packages_so_files.sh | 30 +++++ toolshed/make_site_packages_libdirs.py | 109 ++++++++++++++++++ 15 files changed, 494 insertions(+), 84 deletions(-) create mode 100644 cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_dll.py create mode 100644 cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_so.py create mode 100644 cuda_pathfinder/tests/child_load_nvidia_dynamic_lib_helper.py create mode 100644 toolshed/collect_site_packages_dll_files.ps1 create mode 100755 toolshed/collect_site_packages_so_files.sh create mode 100755 toolshed/make_site_packages_libdirs.py diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index b775670a9..88c8626f5 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -321,16 +321,15 @@ jobs: pip install $(ls cuda_python*.whl)[all] fi - - name: Install cuda.pathfinder nvidia_wheels_cu13 - if: startsWith(matrix.CUDA_VER, '13.') + - name: Install cuda.pathfinder extra wheels for testing run: | + set -euo pipefail pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu13] - pip freeze + pip install --only-binary=:all: -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_wheels_host]" + pip list popd - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '13.') env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work run: run-tests pathfinder diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 18ddbcb45..797e082bf 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -288,17 +288,15 @@ jobs: pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" } - - name: Install cuda.pathfinder nvidia_wheels_cu13 - if: startsWith(matrix.CUDA_VER, '13.') + - name: Install cuda.pathfinder extra wheels for testing shell: bash --noprofile --norc -xeuo pipefail {0} run: | pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu13] - pip freeze + pip install --only-binary=:all: -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_wheels_host]" + pip list popd - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '13.') env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work shell: bash --noprofile --norc -xeuo pipefail {0} diff --git a/ci/tools/env-vars b/ci/tools/env-vars index 3dcb81a4c..19126cd13 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -69,6 +69,7 @@ elif [[ "${1}" == "test" ]]; then echo "SETUP_SANITIZER=${SETUP_SANITIZER}" >> $GITHUB_ENV echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $GITHUB_ENV echo "SKIP_CYTHON_TEST=${SKIP_CYTHON_TEST}" >> $GITHUB_ENV + echo "TEST_CUDA_MAJOR=${TEST_CUDA_MAJOR}" >> $GITHUB_ENV fi echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py index bb6c32b63..18708a2b3 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py @@ -10,6 +10,8 @@ from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( IS_WINDOWS, + SITE_PACKAGES_LIBDIRS_LINUX, + SITE_PACKAGES_LIBDIRS_WINDOWS, is_suppressed_dll_file, ) from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs, find_sub_dirs_all_sitepackages @@ -28,22 +30,25 @@ def _no_such_file_in_sub_dirs( def _find_so_using_nvidia_lib_dirs( libname: str, so_basename: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - file_wild = so_basename + "*" - nvidia_sub_dirs_list: list[tuple[str, ...]] = [("nvidia", "*", "lib")] # works also for CTK 13 nvvm - if libname == "nvvm": - nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "lib64")) # CTK 12 - for nvidia_sub_dirs in nvidia_sub_dirs_list: - for lib_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - # First look for an exact match - so_name = os.path.join(lib_dir, so_basename) - if os.path.isfile(so_name): - return so_name - # Look for a versioned library - # Using sort here mainly to make the result deterministic. - for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild))): + rel_dirs = SITE_PACKAGES_LIBDIRS_LINUX.get(libname) + if rel_dirs is not None: + sub_dirs_searched = [] + file_wild = so_basename + "*" + for rel_dir in rel_dirs: + sub_dir = tuple(rel_dir.split(os.path.sep)) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + # First look for an exact match + so_name = os.path.join(abs_dir, so_basename) if os.path.isfile(so_name): return so_name - _no_such_file_in_sub_dirs(nvidia_sub_dirs, file_wild, error_messages, attachments) + # Look for a versioned library + # Using sort here mainly to make the result deterministic. + for so_name in sorted(glob.glob(os.path.join(abs_dir, file_wild))): + if os.path.isfile(so_name): + return so_name + sub_dirs_searched.append(sub_dir) + for sub_dir in sub_dirs_searched: + _no_such_file_in_sub_dirs(sub_dir, file_wild, error_messages, attachments) return None @@ -59,18 +64,18 @@ def _find_dll_under_dir(dirpath: str, file_wild: str) -> Optional[str]: def _find_dll_using_nvidia_bin_dirs( libname: str, lib_searched_for: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - nvidia_sub_dirs_list: list[tuple[str, ...]] = [ - ("nvidia", "*", "bin"), # CTK 12 - ("nvidia", "*", "bin", "*"), # CTK 13, e.g. site-packages\nvidia\cu13\bin\x86_64\ - ] - if libname == "nvvm": - nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "bin")) # Only for CTK 12 - for nvidia_sub_dirs in nvidia_sub_dirs_list: - for bin_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - dll_name = _find_dll_under_dir(bin_dir, lib_searched_for) - if dll_name is not None: - return dll_name - _no_such_file_in_sub_dirs(nvidia_sub_dirs, lib_searched_for, error_messages, attachments) + rel_dirs = SITE_PACKAGES_LIBDIRS_WINDOWS.get(libname) + if rel_dirs is not None: + sub_dirs_searched = [] + for rel_dir in rel_dirs: + sub_dir = tuple(rel_dir.split(os.path.sep)) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + dll_name = _find_dll_under_dir(abs_dir, lib_searched_for) + if dll_name is not None: + return dll_name + sub_dirs_searched.append(sub_dir) + for sub_dir in sub_dirs_searched: + _no_such_file_in_sub_dirs(sub_dir, lib_searched_for, error_messages, attachments) return None diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index a0bcbbd73..ef7f078c9 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -8,7 +8,10 @@ from typing import Optional, cast from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL -from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import SUPPORTED_LINUX_SONAMES +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( + LIBNAMES_REQUIRING_RTLD_DEEPBIND, + SUPPORTED_LINUX_SONAMES, +) CDLL_MODE = os.RTLD_NOW | os.RTLD_GLOBAL @@ -138,6 +141,13 @@ def check_if_already_loaded_from_elsewhere(libname: str, _have_abs_path: bool) - return None +def _load_lib(libname: str, filename: str) -> ctypes.CDLL: + cdll_mode = CDLL_MODE + if libname in LIBNAMES_REQUIRING_RTLD_DEEPBIND: + cdll_mode |= os.RTLD_DEEPBIND + return ctypes.CDLL(filename, cdll_mode) + + def load_with_system_search(libname: str) -> Optional[LoadedDL]: """Try to load a library using system search paths. @@ -152,13 +162,14 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: """ for soname in get_candidate_sonames(libname): try: - handle = ctypes.CDLL(soname, CDLL_MODE) + handle = _load_lib(libname, soname) + except OSError: + pass + else: abs_path = abs_path_for_dynamic_library(libname, handle) if abs_path is None: raise RuntimeError(f"No expected symbol for {libname=!r}") return LoadedDL(abs_path, False, handle._handle) - except OSError: - pass return None @@ -196,7 +207,7 @@ def load_with_abs_path(libname: str, found_path: str) -> LoadedDL: """ _work_around_known_bugs(libname, found_path) try: - handle = ctypes.CDLL(found_path, CDLL_MODE) + handle = _load_lib(libname, found_path) except OSError as e: raise RuntimeError(f"Failed to dlopen {found_path}: {e}") from e return LoadedDL(found_path, False, handle._handle) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index ee41a48b4..c2c0a4b3a 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -63,7 +63,7 @@ SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS if IS_WINDOWS else SUPPORTED_LIBNAMES_LINUX # Based on ldd output for Linux x86_64 nvidia-*-cu12 wheels (12.8.1) -DIRECT_DEPENDENCIES = { +DIRECT_DEPENDENCIES_CTK = { "cublas": ("cublasLt",), "cufftw": ("cufft",), # "cufile_rdma": ("cufile",), @@ -82,6 +82,10 @@ "npps": ("nppc",), "nvblas": ("cublas", "cublasLt"), } +DIRECT_DEPENDENCIES = DIRECT_DEPENDENCIES_CTK | { + "mathdx": ("nvrtc",), + "cufftMp": ("nvshmem_host",), +} # Based on these released files: # cuda_11.0.3_450.51.06_linux.run @@ -104,7 +108,7 @@ # cuda_12.9.1_575.57.08_linux.run # cuda_13.0.0_580.65.06_linux.run # Generated with toolshed/build_pathfinder_sonames.py -SUPPORTED_LINUX_SONAMES = { +SUPPORTED_LINUX_SONAMES_CTK = { "cublas": ( "libcublas.so.11", "libcublas.so.12", @@ -232,6 +236,13 @@ "libnvvm.so.4", ), } +SUPPORTED_LINUX_SONAMES_OTHER = { + "cufftMp": ("libcufftMp.so.11",), + "mathdx": ("libmathdx.so.0",), + "nvpl_fftw": ("libnvpl_fftw.so.0",), + "nvshmem_host": ("libnvshmem_host.so.3",), +} +SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER # Based on these released files: # cuda_11.0.3_451.82_win10.exe @@ -254,7 +265,7 @@ # cuda_12.9.1_576.57_windows.exe # cuda_13.0.0_windows.exe # Generated with toolshed/build_pathfinder_dlls.py -SUPPORTED_WINDOWS_DLLS = { +SUPPORTED_WINDOWS_DLLS_CTK = { "cublas": ( "cublas64_11.dll", "cublas64_12.dll", @@ -384,12 +395,91 @@ "nvvm70.dll", ), } +SUPPORTED_WINDOWS_DLLS_OTHER = { + "mathdx": ("mathdx64_0.dll",), +} +SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = ( "cufft", "nvrtc", ) +LIBNAMES_REQUIRING_RTLD_DEEPBIND = ("cufftMp",) + +# Based on output of toolshed/make_site_packages_libdirs_linux.py +SITE_PACKAGES_LIBDIRS_LINUX_CTK = { + "cublas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), + "cublasLt": ("nvidia/cu13/lib", "nvidia/cublas/lib"), + "cudart": ("nvidia/cu13/lib", "nvidia/cuda_runtime/lib"), + "cufft": ("nvidia/cu13/lib", "nvidia/cufft/lib"), + "cufftw": ("nvidia/cu13/lib", "nvidia/cufft/lib"), + "cufile": ("nvidia/cu13/lib", "nvidia/cufile/lib"), + # "cufile_rdma": ("nvidia/cu13/lib", "nvidia/cufile/lib"), + "curand": ("nvidia/cu13/lib", "nvidia/curand/lib"), + "cusolver": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), + "cusolverMg": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), + "cusparse": ("nvidia/cu13/lib", "nvidia/cusparse/lib"), + "nppc": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppial": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppicc": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppidei": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppif": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppig": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppim": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppist": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppisu": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nppitc": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "npps": ("nvidia/cu13/lib", "nvidia/npp/lib"), + "nvJitLink": ("nvidia/cu13/lib", "nvidia/nvjitlink/lib"), + "nvblas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), + "nvfatbin": ("nvidia/cu13/lib", "nvidia/nvfatbin/lib"), + "nvjpeg": ("nvidia/cu13/lib", "nvidia/nvjpeg/lib"), + "nvrtc": ("nvidia/cu13/lib", "nvidia/cuda_nvrtc/lib"), + "nvvm": ("nvidia/cu13/lib", "nvidia/cuda_nvcc/nvvm/lib64"), +} +SITE_PACKAGES_LIBDIRS_LINUX_OTHER = { + "cufftMp": ("nvidia/cufftmp/cu12/lib",), + "mathdx": ("nvidia/cu13/lib", "nvidia/cu12/lib"), + "nvpl_fftw": ("nvpl/lib",), + "nvshmem_host": ("nvidia/nvshmem/lib",), +} +SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER + +# Based on output of toolshed/make_site_packages_libdirs_windows.py +SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = { + "cublas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + "cublasLt": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + "cudart": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_runtime/bin"), + "cufft": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), + "cufftw": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), + "curand": ("nvidia/cu13/bin/x86_64", "nvidia/curand/bin"), + "cusolver": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), + "cusolverMg": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), + "cusparse": ("nvidia/cu13/bin/x86_64", "nvidia/cusparse/bin"), + "nppc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppial": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppicc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppidei": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppif": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppig": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppim": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppist": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppisu": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nppitc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "npps": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + "nvJitLink": ("nvidia/cu13/bin/x86_64", "nvidia/nvjitlink/bin"), + "nvblas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + "nvfatbin": ("nvidia/cu13/bin/x86_64", "nvidia/nvfatbin/bin"), + "nvjpeg": ("nvidia/cu13/bin/x86_64", "nvidia/nvjpeg/bin"), + "nvrtc": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvrtc/bin"), + "nvvm": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvcc/nvvm/bin"), +} +SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = { + "mathdx": ("nvidia/cu13/bin/x86_64", "nvidia/cu12/bin"), +} +SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER + def is_suppressed_dll_file(path_basename: str) -> bool: if path_basename.startswith("nvrtc"): diff --git a/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_dll.py b/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_dll.py new file mode 100644 index 000000000..2f5695093 --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_dll.py @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import collections +import functools +import importlib.metadata + + +@functools.cache +def find_all_dll_files_via_metadata() -> dict[str, tuple[str, ...]]: + results: collections.defaultdict[str, list[str]] = collections.defaultdict(list) + + # sort dists for deterministic output + for dist in sorted(importlib.metadata.distributions(), key=lambda d: (d.metadata.get("Name", ""), d.version)): + files = dist.files + if not files: + continue + for relpath in sorted(files, key=lambda p: str(p)): # deterministic + relname = relpath.name.lower() + if not relname.endswith(".dll"): + continue + abs_path = str(dist.locate_file(relpath)) + results[relname].append(abs_path) + + # plain dicts; sort inner list for stability + return {k: tuple(sorted(v)) for k, v in results.items()} diff --git a/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_so.py b/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_so.py new file mode 100644 index 000000000..69e7eea3a --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_utils/find_site_packages_so.py @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import collections +import functools +import importlib.metadata +import re + +_SO_RE = re.compile(r"\.so(?:$|\.)") # matches libfoo.so or libfoo.so.1.2.3 + + +def split_so_version_suffix(so_filename: str) -> tuple[str, str]: + idx = so_filename.rfind(".so") + assert idx > 0, so_filename + idx += 3 + return (so_filename[:idx], so_filename[idx:]) + + +@functools.cache +def find_all_so_files_via_metadata() -> dict[str, dict[str, tuple[str, ...]]]: + results: collections.defaultdict[str, collections.defaultdict[str, list[str]]] = collections.defaultdict( + lambda: collections.defaultdict(list) + ) + + # sort dists for deterministic output + for dist in sorted(importlib.metadata.distributions(), key=lambda d: (d.metadata.get("Name", ""), d.version)): + files = dist.files + if not files: + continue + for relpath in sorted(files, key=lambda p: str(p)): # deterministic + relname = relpath.name + if not _SO_RE.search(relname): + continue + so_basename, so_version_suffix = split_so_version_suffix(relname) + abs_path = str(dist.locate_file(relpath)) + results[so_basename][so_version_suffix].append(abs_path) + + # plain dicts; sort inner lists for stability + return {k: {kk: tuple(sorted(vv)) for kk, vv in v.items()} for k, v in results.items()} diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index adcedad4d..b64ff9550 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.1.1a2" +__version__ = "1.1.1a3" diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 6545c4e51..fc5dc74d8 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -17,10 +17,17 @@ test = [ nvidia_wheels_cu12 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", + "nvidia-libmathdx-cu12", + "nvidia-cufftmp-cu12; sys_platform != 'win32'", + "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] nvidia_wheels_cu13 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,nvvm]==13.*", "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", + "nvidia-nvshmem-cu13; sys_platform != 'win32'", +] +nvidia_wheels_host = [ + "nvpl-fft; platform_system == 'Linux' and platform_machine == 'aarch64'", ] [project.urls] diff --git a/cuda_pathfinder/tests/child_load_nvidia_dynamic_lib_helper.py b/cuda_pathfinder/tests/child_load_nvidia_dynamic_lib_helper.py new file mode 100644 index 000000000..4ca905989 --- /dev/null +++ b/cuda_pathfinder/tests/child_load_nvidia_dynamic_lib_helper.py @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This helper is factored out so spawned child processes only import this +# lightweight module. That avoids re-importing the test module (and +# repeating its potentially expensive setup) in every child process. + +import os +import sys + + +def build_child_process_failed_for_libname_message(libname, result): + return ( + f"Child process failed for {libname=!r} with exit code {result.returncode}\n" + f"--- stdout-from-child-process ---\n{result.stdout}\n" + f"--- stderr-from-child-process ---\n{result.stderr}\n" + ) + + +def validate_abs_path(abs_path): + assert abs_path, f"empty path: {abs_path=!r}" + assert os.path.isabs(abs_path), f"not absolute: {abs_path=!r}" + assert os.path.isfile(abs_path), f"not a file: {abs_path=!r}" + + +def child_process_func(libname): + from cuda.pathfinder import load_nvidia_dynamic_lib + from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import _load_lib_no_cache + from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( + IS_WINDOWS, + SUPPORTED_LINUX_SONAMES, + SUPPORTED_WINDOWS_DLLS, + ) + + loaded_dl_fresh = load_nvidia_dynamic_lib(libname) + if loaded_dl_fresh.was_already_loaded_from_elsewhere: + raise RuntimeError("loaded_dl_fresh.was_already_loaded_from_elsewhere") + validate_abs_path(loaded_dl_fresh.abs_path) + + loaded_dl_from_cache = load_nvidia_dynamic_lib(libname) + if loaded_dl_from_cache is not loaded_dl_fresh: + raise RuntimeError("loaded_dl_from_cache is not loaded_dl_fresh") + + loaded_dl_no_cache = _load_lib_no_cache(libname) + # check_if_already_loaded_from_elsewhere relies on these: + supported_libs = SUPPORTED_WINDOWS_DLLS if IS_WINDOWS else SUPPORTED_LINUX_SONAMES + if not loaded_dl_no_cache.was_already_loaded_from_elsewhere and libname in supported_libs: + raise RuntimeError("not loaded_dl_no_cache.was_already_loaded_from_elsewhere") + if not os.path.samefile(loaded_dl_no_cache.abs_path, loaded_dl_fresh.abs_path): + raise RuntimeError(f"not os.path.samefile({loaded_dl_no_cache.abs_path=!r}, {loaded_dl_fresh.abs_path=!r})") + validate_abs_path(loaded_dl_no_cache.abs_path) + + sys.stdout.write(f"{loaded_dl_fresh.abs_path!r}\n") diff --git a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py index 6b8302c15..5f35d996d 100644 --- a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py @@ -1,15 +1,18 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +import functools import os -import sys from unittest.mock import patch import pytest import spawned_process_runner +from child_load_nvidia_dynamic_lib_helper import build_child_process_failed_for_libname_message, child_process_func from cuda.pathfinder import SUPPORTED_NVIDIA_LIBNAMES, load_nvidia_dynamic_lib from cuda.pathfinder._dynamic_libs import supported_nvidia_libs +from cuda.pathfinder._utils.find_site_packages_dll import find_all_dll_files_via_metadata +from cuda.pathfinder._utils.find_site_packages_so import find_all_so_files_via_metadata STRICTNESS = os.environ.get("CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS", "see_what_works") assert STRICTNESS in ("see_what_works", "all_must_work") @@ -17,13 +20,25 @@ def test_supported_libnames_linux_sonames_consistency(): assert tuple(sorted(supported_nvidia_libs.SUPPORTED_LIBNAMES_LINUX)) == tuple( - sorted(supported_nvidia_libs.SUPPORTED_LINUX_SONAMES.keys()) + sorted(supported_nvidia_libs.SUPPORTED_LINUX_SONAMES_CTK.keys()) ) def test_supported_libnames_windows_dlls_consistency(): assert tuple(sorted(supported_nvidia_libs.SUPPORTED_LIBNAMES_WINDOWS)) == tuple( - sorted(supported_nvidia_libs.SUPPORTED_WINDOWS_DLLS.keys()) + sorted(supported_nvidia_libs.SUPPORTED_WINDOWS_DLLS_CTK.keys()) + ) + + +def test_supported_libnames_linux_site_packages_libdirs_ctk_consistency(): + assert tuple(sorted(supported_nvidia_libs.SUPPORTED_LIBNAMES_LINUX)) == tuple( + sorted(supported_nvidia_libs.SITE_PACKAGES_LIBDIRS_LINUX_CTK.keys()) + ) + + +def test_supported_libnames_windows_site_packages_libdirs_ctk_consistency(): + assert tuple(sorted(supported_nvidia_libs.SUPPORTED_LIBNAMES_WINDOWS)) == tuple( + sorted(supported_nvidia_libs.SITE_PACKAGES_LIBDIRS_WINDOWS_CTK.keys()) ) @@ -54,45 +69,28 @@ def test_runtime_error_on_non_64bit_python(): load_nvidia_dynamic_lib("not_used") -def build_child_process_failed_for_libname_message(libname, result): - return ( - f"Child process failed for {libname=!r} with exit code {result.returncode}\n" - f"--- stdout-from-child-process ---\n{result.stdout}\n" - f"--- stderr-from-child-process ---\n{result.stderr}\n" - ) - - -def validate_abs_path(abs_path): - assert abs_path, f"empty path: {abs_path=!r}" - assert os.path.isabs(abs_path), f"not absolute: {abs_path=!r}" - assert os.path.isfile(abs_path), f"not a file: {abs_path=!r}" - - -def child_process_func(libname): - import os - - from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import _load_lib_no_cache - - loaded_dl_fresh = load_nvidia_dynamic_lib(libname) - if loaded_dl_fresh.was_already_loaded_from_elsewhere: - raise RuntimeError("loaded_dl_fresh.was_already_loaded_from_elsewhere") - validate_abs_path(loaded_dl_fresh.abs_path) - - loaded_dl_from_cache = load_nvidia_dynamic_lib(libname) - if loaded_dl_from_cache is not loaded_dl_fresh: - raise RuntimeError("loaded_dl_from_cache is not loaded_dl_fresh") - - loaded_dl_no_cache = _load_lib_no_cache(libname) - if not loaded_dl_no_cache.was_already_loaded_from_elsewhere: - raise RuntimeError("loaded_dl_no_cache.was_already_loaded_from_elsewhere") - if not os.path.samefile(loaded_dl_no_cache.abs_path, loaded_dl_fresh.abs_path): - raise RuntimeError(f"not os.path.samefile({loaded_dl_no_cache.abs_path=!r}, {loaded_dl_fresh.abs_path=!r})") - validate_abs_path(loaded_dl_no_cache.abs_path) +@functools.cache +def _get_libnames_for_test_load_nvidia_dynamic_lib(): + result = list(SUPPORTED_NVIDIA_LIBNAMES) + if supported_nvidia_libs.IS_WINDOWS: + spld_other = supported_nvidia_libs.SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER + all_dyn_libs = find_all_dll_files_via_metadata() + for libname in spld_other: + for dll_name in all_dyn_libs: + if dll_name.startswith(libname): + result.append(libname) + else: + spld_other = supported_nvidia_libs.SITE_PACKAGES_LIBDIRS_LINUX_OTHER + all_dyn_libs = find_all_so_files_via_metadata() + for libname in spld_other: + so_basename = f"lib{libname}.so" + if so_basename in all_dyn_libs: + result.append(libname) - sys.stdout.write(f"{loaded_dl_fresh.abs_path!r}\n") + return tuple(result) -@pytest.mark.parametrize("libname", SUPPORTED_NVIDIA_LIBNAMES) +@pytest.mark.parametrize("libname", _get_libnames_for_test_load_nvidia_dynamic_lib()) def test_load_nvidia_dynamic_lib(info_summary_append, libname): # We intentionally run each dynamic library operation in a child process # to ensure isolation of global dynamic linking state (e.g., dlopen handles). diff --git a/toolshed/collect_site_packages_dll_files.ps1 b/toolshed/collect_site_packages_dll_files.ps1 new file mode 100644 index 000000000..9f1ccce93 --- /dev/null +++ b/toolshed/collect_site_packages_dll_files.ps1 @@ -0,0 +1,44 @@ +# collect_site_packages_dll_files.ps1 + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Usage: +# cd cuda-python +# powershell -File toolshed\collect_site_packages_dll_files.ps1 +# python .\toolshed\make_site_packages_libdirs.py windows site_packages_dll.txt + +$ErrorActionPreference = 'Stop' + +function Fresh-Venv { + param( + [Parameter(Mandatory=$true)] + [string] $Path + ) + & python3 -m venv $Path + . (Join-Path $Path 'Scripts\Activate.ps1') + python -m pip install --upgrade pip +} + +Set-Location -Path 'cuda_pathfinder' + +Fresh-Venv -Path '..\TmpCp12Venv' +pip install --only-binary=:all: -e '.[test,nvidia_wheels_cu12,nvidia_wheels_host]' +deactivate + +Fresh-Venv -Path '..\TmpCp13Venv' +pip install --only-binary=:all: -e '.[test,nvidia_wheels_cu13,nvidia_wheels_host]' +deactivate + +Set-Location -Path '..' + +$venvs = @('TmpCp12Venv', 'TmpCp13Venv') + +$matches = + Get-ChildItem -Path $venvs -Recurse -File -Include '*.dll' | + Where-Object { $_.FullName -match '(?i)(nvidia|nvpl)' } | + Select-Object -ExpandProperty FullName | + Sort-Object -Unique + +$outFile = 'site_packages_dll.txt' +$matches | Set-Content -Path $outFile -Encoding utf8 diff --git a/toolshed/collect_site_packages_so_files.sh b/toolshed/collect_site_packages_so_files.sh new file mode 100755 index 000000000..000bdb64c --- /dev/null +++ b/toolshed/collect_site_packages_so_files.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Usage: +# cd cuda-python +# ./toolshed/collect_site_packages_so_files.sh +# ./toolshed/make_site_packages_libdirs.py linux site_packages_so.txt + +set -euo pipefail +fresh_venv() { + python3 -m venv "$1" + . "$1/bin/activate" + pip install --upgrade pip +} +cd cuda_pathfinder/ +fresh_venv ../TmpCp12Venv +set -x +pip install --only-binary=:all: -e .[test,nvidia_wheels_cu12,nvidia_wheels_host] +set +x +deactivate +fresh_venv ../TmpCp13Venv +set -x +pip install --only-binary=:all: -e .[test,nvidia_wheels_cu13,nvidia_wheels_host] +set +x +deactivate +cd .. +set -x +find TmpCp12Venv TmpCp13Venv -name 'lib*.so*' | grep -e nvidia -e nvpl >site_packages_so.txt diff --git a/toolshed/make_site_packages_libdirs.py b/toolshed/make_site_packages_libdirs.py new file mode 100755 index 000000000..b4feaec2e --- /dev/null +++ b/toolshed/make_site_packages_libdirs.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# For usage see top of collect_site_packages_*_files.* + +import os +import re +import argparse +from typing import Optional, Dict, Set + +_SITE_PACKAGES_RE = re.compile(r"(?i)^.*?/site-packages/") + + +def strip_site_packages_prefix(p: str) -> str: + """Remove any leading '.../site-packages/' (handles '\' or '/', case-insensitive).""" + p = p.replace("\\", "/") + return _SITE_PACKAGES_RE.sub("", p) + + +def parse_lines_linux(lines) -> Dict[str, Set[str]]: + d = {} # name -> set of dirs + for raw in lines: + line = raw.strip() + if not line or line.startswith("#"): + continue + line = strip_site_packages_prefix(line) + dirpath, fname = os.path.split(line) + # Require something like libNAME.so, libNAME.so.12, libNAME.so.12.1, etc. + i = fname.find(".so") + if not fname.startswith("lib") or i == -1: + # Skip lines that don't look like shared libs + continue + name = fname[:i] # e.g. "libnvrtc" + name = name[3:] # drop leading "lib" -> "nvrtc" + d.setdefault(name, set()).add(dirpath) + return d + + +def extract_libname_from_dll(fname: str) -> Optional[str]: + """Return base libname per the heuristic, or None if not a .dll.""" + base = os.path.basename(fname) + if not base.lower().endswith(".dll"): + return None + stem = base[:-4] # drop ".dll" + out = [] + for ch in stem: + if ch == "_" or ch.isdigit(): + break + out.append(ch) + name = "".join(out) + return name or None + + +def parse_lines_windows(lines) -> Dict[str, Set[str]]: + """Collect {libname: set(dirnames)} with deduped directories.""" + m: Dict[str, Set[str]] = {} + for raw in lines: + line = raw.strip() + if not line or line.startswith("#"): + continue + line = strip_site_packages_prefix(line) + dirpath, fname = os.path.split(line) + libname = extract_libname_from_dll(fname) + if not libname: + continue + m.setdefault(libname, set()).add(dirpath) + return m + + +def dict_literal(d: Dict[str, Set[str]]) -> str: + """Pretty, stable dict literal with tuple values (singletons keep trailing comma).""" + lines = ["{"] + for k in sorted(d): + dirs = sorted(d[k]) + tup = ( + "(" + + ", ".join(repr(x) for x in dirs) + + ("," if len(dirs) == 1 else "") + + ")" + ) + lines.append(f" {k!r}: {tup},") + lines.append("}") + return "\n".join(lines) + + +def main() -> None: + ap = argparse.ArgumentParser( + description="Convert a list of site-packages library paths into {name: (dirs, ...)}" + ) + ap.add_argument( + "platform", choices=["linux", "windows"], help="Target platform to parse" + ) + ap.add_argument("path", help="Text file with one library path per line") + args = ap.parse_args() + + with open(args.path, "r", encoding="utf-8") as f: + lines = f.read().splitlines() + + if args.platform == "linux": + m = parse_lines_linux(lines) + else: + m = parse_lines_windows(lines) + print(dict_literal(m)) + + +if __name__ == "__main__": + main() From dd0ceef936ecd8bf91ab1ba0ea3803885884e77c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 28 Aug 2025 14:54:21 -0400 Subject: [PATCH 073/113] Fix #789: Remove cycle between c.b.cyruntime and c.b._lib.cyruntime.cyruntime (#914) * Fix #789: Remove cycle between c.b.cyruntime and c.b._lib.cyruntime.cyruntime * Rename cyruntime.pyx to cyruntime.pxi * Renome cuda.bindings._lib from path_list * Add cufile to the mix, too * Fix typo * Restore _lib directory * Skip cufile import test on Windows * Add comments about the source of these files --- .gitignore | 4 - .../cuda/bindings/_bindings/cyruntime.pxd.in | 1 + .../cuda/bindings/_bindings/cyruntime.pyx.in | 2 + .../cuda/bindings/_lib/cyruntime/__init__.py | 0 .../bindings/_lib/cyruntime/cyruntime.pxd | 43 ++ .../bindings/_lib/cyruntime/cyruntime.pxd.in | 29 - .../cyruntime/{utils.pyx.in => cyruntime.pxi} | 669 +++++++++++------- .../bindings/_lib/cyruntime/cyruntime.pyx.in | 246 ------- .../cuda/bindings/_lib/cyruntime/utils.pxd.in | 10 - cuda_bindings/cuda/bindings/cyruntime.pyx.in | 39 +- .../cuda/bindings/utils/__init__.pxd | 0 cuda_bindings/setup.py | 5 +- cuda_bindings/tests/test_utils.py | 14 +- .../tests/utils/check_cyclical_import.py | 6 +- 14 files changed, 502 insertions(+), 566 deletions(-) delete mode 100644 cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py create mode 100644 cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd delete mode 100644 cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in rename cuda_bindings/cuda/bindings/_lib/cyruntime/{utils.pyx.in => cyruntime.pxi} (66%) delete mode 100644 cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in delete mode 100644 cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in delete mode 100644 cuda_bindings/cuda/bindings/utils/__init__.pxd diff --git a/.gitignore b/.gitignore index 53c2e4f35..64c77d166 100644 --- a/.gitignore +++ b/.gitignore @@ -29,10 +29,6 @@ cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx cuda_bindings/cuda/bindings/_internal/nvvm.pyx -cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd -cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx -cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd -cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx cuda_bindings/cuda/bindings/_lib/utils.pxd cuda_bindings/cuda/bindings/_lib/utils.pyx cuda_bindings/cuda/bindings/cydriver.pxd diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in index 895e6eff7..61b9b6e43 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in @@ -3,6 +3,7 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. include "../cyruntime_types.pxi" +include "../_lib/cyruntime/cyruntime.pxd" {{if 'cudaDeviceReset' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index c82189fa4..1b6707d79 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -2671,3 +2671,5 @@ cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver no return ptds._cudaProfilerStop() return cudaProfilerStop() {{endif}} + +include "../_lib/cyruntime/cyruntime.pxi" \ No newline at end of file diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py b/cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd new file mode 100644 index 000000000..48f87f29c --- /dev/null +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cimport cuda.bindings.cyruntime as cyruntime +cimport cuda.bindings._bindings.cydriver as _cydriver + +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. +# +# This is an ABI breaking change which can only happen in a major version bump. + +# This file is included from cuda/bindings/_bindings/cyruntime.pxd.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +# utility functions + +cdef cudaError_t getDriverEglFrame(_cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, _cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in deleted file mode 100644 index 055958e1a..000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * - -# These graphics API are the reimplemented version of what's supported by CUDA Runtime. -# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us -# use call into the static library directly. -# -# This is an ABI breaking change which can only happen in a major version bump. -{{if True}}cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi similarity index 66% rename from cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi index 292d19cb9..7d5960ced 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -1,11 +1,202 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -import cython -from cuda.bindings.cyruntime cimport * +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. + +# This file is included from cuda/bindings/_bindings/cyruntime.pyx.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + from libc.string cimport memset -cimport cuda.bindings._bindings.cydriver as cydriver +cimport cuda.bindings.cydriver as cydriver + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + err = getDriverEglFrame(&cueglFrame, eglframe) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + if eglframe == NULL: + err = cudaErrorInvalidResourceHandle + return err + cdef cydriver.CUeglFrame cueglFrame + # err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglframe, cueglFrame) + return err + +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + memset(&cueglFrame, 0, sizeof(cueglFrame)) + # err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglFrame, cueglFrame) + return err +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaErrorNotSupported + +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) + return err + +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerDisconnect(conn) + return err + +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return err + +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) + return err + +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerDisconnect(conn) + return err + +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) + return err + +## utility functions cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil: return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f @@ -228,9 +419,7 @@ cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChanne return cudaErrorInvalidChannelDescriptor return cudaSuccess - cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth, const cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef int channel_size = 0 if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT8: pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned @@ -375,8 +564,7 @@ cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRunt pWidth[0] = pDriverDesc[0].Width return cudaSuccess - -cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: cdef cudaError_t err = cudaSuccess cdef unsigned int i = 0 @@ -384,7 +572,7 @@ cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame if err != cudaSuccess: return err for i in range(eglFrame.planeCount): - if eglFrame.frameType == cudaEglFrameTypeArray: + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: cuEglFrame[0].frame.pArray[i] = eglFrame.frame.pArray[i] else: cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr @@ -393,244 +581,243 @@ cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame cuEglFrame[0].depth = eglFrame.planeDesc[0].depth cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch cuEglFrame[0].planeCount = eglFrame.planeCount - if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar: + if eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV422: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY422: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatARGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatARGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB - elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRGBA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA - elif eglFrame.eglColorFormat == cudaEglColorFormatABGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatABGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBGRA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA - elif eglFrame.eglColorFormat == cudaEglColorFormatL: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatL: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L - elif eglFrame.eglColorFormat == cudaEglColorFormatR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R - elif eglFrame.eglColorFormat == cudaEglColorFormatA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A - elif eglFrame.eglColorFormat == cudaEglColorFormatRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG - elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspRGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspBGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBCCR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRCCB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCRBC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCBRC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10CCCC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BCCR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RCCB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CRBC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CBRC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CCCC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC - elif eglFrame.eglColorFormat == cudaEglColorFormatY: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA - elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU - elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER else: return cudaErrorInvalidValue - if eglFrame.frameType == cudaEglFrameTypeArray: + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY - elif eglFrame.frameType == cudaEglFrameTypePitch: + elif eglFrame.frameType == cyruntime.cudaEglFrameTypePitch: cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH else: return cudaErrorInvalidValue - @cython.show_performance_hints(False) -cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: cdef cudaError_t err = cudaSuccess cdef unsigned int i cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2 ad @@ -675,7 +862,7 @@ cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or - cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or @@ -754,236 +941,236 @@ cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame eglFrame[0].planeCount = cueglFrame.planeCount if cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV422 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY422 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatARGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatARGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA: - eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRGBA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatABGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatABGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA: - eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBGRA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L: - eglFrame[0].eglColorFormat = cudaEglColorFormatL + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatL elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R: - eglFrame[0].eglColorFormat = cudaEglColorFormatR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A: - eglFrame[0].eglColorFormat = cudaEglColorFormatA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG: - eglFrame[0].eglColorFormat = cudaEglColorFormatRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV: - eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspRGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspBGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBCCR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRCCB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCRBC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCBRC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10CCCC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BCCR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RCCB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CRBC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CBRC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CCCC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y: - eglFrame[0].eglColorFormat = cudaEglColorFormatY + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY: - eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER else: return cudaErrorInvalidValue if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: - eglFrame[0].frameType = cudaEglFrameTypeArray + eglFrame[0].frameType = cyruntime.cudaEglFrameTypeArray elif cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH: - eglFrame[0].frameType = cudaEglFrameTypePitch + eglFrame[0].frameType = cyruntime.cudaEglFrameTypePitch else: return cudaErrorInvalidValue diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in deleted file mode 100644 index 72bebb670..000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in +++ /dev/null @@ -1,246 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * -from cuda.bindings._lib.cyruntime.utils cimport * -from libc.string cimport memset -cimport cuda.bindings._bindings.cydriver as cydriver - -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - cdef cydriver.CUeglFrame cueglFrame - err = getDriverEglFrame(&cueglFrame, eglframe) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - if eglframe == NULL: - err = cudaErrorInvalidResourceHandle - return err - cdef cydriver.CUeglFrame cueglFrame - err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) - if err != cudaSuccess: - return err - err = getRuntimeEglFrame(eglframe, cueglFrame) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - cdef cydriver.CUeglFrame cueglFrame - memset(&cueglFrame, 0, sizeof(cueglFrame)) - err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) - if err != cudaSuccess: - return err - err = getRuntimeEglFrame(eglFrame, cueglFrame) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaErrorNotSupported - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerDisconnect(conn) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerDisconnect(conn) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) - return err - -{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in deleted file mode 100644 index f021fb2aa..000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * -cimport cuda.bindings._bindings.cydriver as cydriver - -# These are hard-coded helper function from the initial reimplementation of CUDA Runtime -# and will be removed as part of https://github.com/NVIDIA/cuda-python/issues/488 -cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil -cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in index d327685c1..7f5c96e05 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -3,7 +3,6 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. cimport cuda.bindings._bindings.cyruntime as cyruntime -cimport cuda.bindings._lib.cyruntime.cyruntime as custom_cyruntime cimport cython {{if 'cudaDeviceReset' in found_functions}} @@ -1761,73 +1760,73 @@ cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) except* nogil: {{if True}} cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource** pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsEGLRegisterImage(pCudaResource, image, flags) + return cyruntime._cudaGraphicsEGLRegisterImage(pCudaResource, image, flags) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerConnect(conn, eglStream) + return cyruntime._cudaEGLStreamConsumerConnect(conn, eglStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return cyruntime._cudaEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerDisconnect(conn) + return cyruntime._cudaEGLStreamConsumerDisconnect(conn) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return cyruntime._cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return cyruntime._cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerConnect(conn, eglStream, width, height) + return cyruntime._cudaEGLStreamProducerConnect(conn, eglStream, width, height) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerDisconnect(conn) + return cyruntime._cudaEGLStreamProducerDisconnect(conn) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerPresentFrame(conn, eglframe, pStream) + return cyruntime._cudaEGLStreamProducerPresentFrame(conn, eglframe, pStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerReturnFrame(conn, eglframe, pStream) + return cyruntime._cudaEGLStreamProducerReturnFrame(conn, eglframe, pStream) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) + return cyruntime._cudaGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) {{endif}} {{if True}} cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEventCreateFromEGLSync(phEvent, eglSync, flags) + return cyruntime._cudaEventCreateFromEGLSync(phEvent, eglSync, flags) {{endif}} {{if 'cudaProfilerStart' in found_functions}} @@ -1845,43 +1844,43 @@ cdef cudaError_t cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nog {{if True}} cdef cudaError_t cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGLGetDevices(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return cyruntime._cudaGLGetDevices(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsGLRegisterImage(resource, image, target, flags) + return cyruntime._cudaGraphicsGLRegisterImage(resource, image, target, flags) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsGLRegisterBuffer(resource, buffer, flags) + return cyruntime._cudaGraphicsGLRegisterBuffer(resource, buffer, flags) {{endif}} {{if True}} cdef cudaError_t cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return cyruntime._cudaVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) {{endif}} {{if True}} cdef cudaError_t cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaVDPAUSetVDPAUDevice(device, vdpDevice, vdpGetProcAddress) + return cyruntime._cudaVDPAUSetVDPAUDevice(device, vdpDevice, vdpGetProcAddress) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return cyruntime._cudaGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return cyruntime._cudaGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) {{endif}} {{if True}} diff --git a/cuda_bindings/cuda/bindings/utils/__init__.pxd b/cuda_bindings/cuda/bindings/utils/__init__.pxd deleted file mode 100644 index e69de29bb..000000000 diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 486452a24..8f0349bcd 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -219,9 +219,8 @@ def generate_output(infile, local): os.path.join("cuda"), os.path.join("cuda", "bindings"), os.path.join("cuda", "bindings", "_bindings"), - os.path.join("cuda", "bindings", "_lib"), - os.path.join("cuda", "bindings", "_lib", "cyruntime"), os.path.join("cuda", "bindings", "_internal"), + os.path.join("cuda", "bindings", "_lib"), os.path.join("cuda", "bindings", "utils"), ] input_files = [] @@ -343,8 +342,6 @@ def do_cythonize(extensions): (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils - (["cuda/bindings/_lib/cyruntime/cyruntime.pyx"], None), - (["cuda/bindings/_lib/cyruntime/utils.pyx"], None), (["cuda/bindings/utils/*.pyx"], None), # public *(([f], None) for f in cuda_bindings_files), diff --git a/cuda_bindings/tests/test_utils.py b/cuda_bindings/tests/test_utils.py index 7ed4fd753..20643a6de 100644 --- a/cuda_bindings/tests/test_utils.py +++ b/cuda_bindings/tests/test_utils.py @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +import platform import random import subprocess # nosec B404 import sys @@ -94,21 +95,14 @@ def test_get_handle_error(target): @pytest.mark.parametrize( "module", + # Top-level modules for external Python use [ - # Top-level modules for external Python use - # TODO: Import cycle detected: (('numeric',), ''), stack: [((), - # 'cuda.bindings.cufile'), ((), 'cuda.bindings.cycufile'), - # (('show_config',), 'numpy.__config__'), (('__cpu_features__', - # '__cpu_baseline__', '__cpu_dispatch__'), - # 'numpy._core._multiarray_umath'), (('numeric',), ''), - # (('shape_base',), '')] - # "cufile", "driver", "nvjitlink", "nvrtc", "nvvm", - # TODO: cuda.bindings.cyruntime -> cuda.bindings._lib.cyruntime.cyruntime cycle - # "runtime", + "runtime", + *(["cufile"] if platform.system() != "Windows" else []), ], ) def test_cyclical_imports(module): diff --git a/cuda_bindings/tests/utils/check_cyclical_import.py b/cuda_bindings/tests/utils/check_cyclical_import.py index 4466a5c76..e40f80011 100644 --- a/cuda_bindings/tests/utils/check_cyclical_import.py +++ b/cuda_bindings/tests/utils/check_cyclical_import.py @@ -21,8 +21,10 @@ def import_hook(name, globals=None, locals=None, fromlist=(), *args, **kwargs): if stack_entry in import_stack and name.startswith("cuda.bindings."): raise ImportError(f"Import cycle detected: {stack_entry}, stack: {import_stack}") import_stack.append(stack_entry) - res = orig_import(name, globals, locals, fromlist, *args, **kwargs) - import_stack.pop() + try: + res = orig_import(name, globals, locals, fromlist, *args, **kwargs) + finally: + import_stack.pop() return res From 8d250ff3aa361062d7d79ab75853693c2ec15999 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 28 Aug 2025 16:47:32 -0400 Subject: [PATCH 074/113] Copy 12.9.x changelog entry to main branch (#923) --- cuda_bindings/docs/source/release/12.9.X-notes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cuda_bindings/docs/source/release/12.9.X-notes.rst b/cuda_bindings/docs/source/release/12.9.X-notes.rst index a3a640f53..967665b42 100644 --- a/cuda_bindings/docs/source/release/12.9.X-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.X-notes.rst @@ -14,6 +14,8 @@ Highlights * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. +* The Python overhead of calling functions in CUDA bindings in ``driver``, + ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. Known issues ------------ From 8017a81fb5911b38f9aa65667abf0ddb63dcb537 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 28 Aug 2025 15:25:32 -0700 Subject: [PATCH 075/113] =?UTF-8?q?Reverse=20tabulated=20names=20to=20achi?= =?UTF-8?q?eve=20new=20=E2=86=92=20old=20search=20order.=20(#921)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reverse tabulated names to achieve new → old search order. * Add comments in supported_nvidia_libs.py: Please keep in old → new sort order. * Bump pathfinder version to 1.2.0a0 * Update cuda_pathfinder/docs/source/release/1.X.Y-notes.rst --- .../cuda/pathfinder/_dynamic_libs/load_dl_linux.py | 3 ++- .../cuda/pathfinder/_dynamic_libs/load_dl_windows.py | 3 ++- .../pathfinder/_dynamic_libs/supported_nvidia_libs.py | 2 ++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/docs/source/release/1.X.Y-notes.rst | 8 ++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index ef7f078c9..a7de858b7 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -125,7 +125,8 @@ def abs_path_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: def get_candidate_sonames(libname: str) -> list[str]: - candidate_sonames = list(SUPPORTED_LINUX_SONAMES.get(libname, ())) + # Reverse tabulated names to achieve new → old search order. + candidate_sonames = list(reversed(SUPPORTED_LINUX_SONAMES.get(libname, ()))) candidate_sonames.append(f"lib{libname}.so") return candidate_sonames diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py index 1a4f32cf2..5da6d9b84 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py @@ -123,7 +123,8 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: Returns: A LoadedDL object if successful, None if the library cannot be loaded """ - for dll_name in SUPPORTED_WINDOWS_DLLS.get(libname, ()): + # Reverse tabulated names to achieve new → old search order. + for dll_name in reversed(SUPPORTED_WINDOWS_DLLS.get(libname, ())): handle = kernel32.LoadLibraryExW(dll_name, None, 0) if handle: abs_path = abs_path_for_dynamic_library(libname, handle) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index c2c0a4b3a..655f59845 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -108,6 +108,7 @@ # cuda_12.9.1_575.57.08_linux.run # cuda_13.0.0_580.65.06_linux.run # Generated with toolshed/build_pathfinder_sonames.py +# Please keep in old → new sort order. SUPPORTED_LINUX_SONAMES_CTK = { "cublas": ( "libcublas.so.11", @@ -265,6 +266,7 @@ # cuda_12.9.1_576.57_windows.exe # cuda_13.0.0_windows.exe # Generated with toolshed/build_pathfinder_dlls.py +# Please keep in old → new sort order. SUPPORTED_WINDOWS_DLLS_CTK = { "cublas": ( "cublas64_11.dll", diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index b64ff9550..09b44665a 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.1.1a3" +__version__ = "1.2.0a0" diff --git a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst index 769e6f546..e952a87e9 100644 --- a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst +++ b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst @@ -12,6 +12,14 @@ Released on TBD Highlights ---------- +* Reverse tabulated names to achieve new → old search order (`PR #921 `_) + + - ``SUPPORTED_LINUX_SONAMES`` and ``SUPPORTED_WINDOWS_DLLS`` lists of DSOs are searched from new → old + +* Support non-CTK Nvidia libraries (`PR #864 `_) + + - Adds support for non-CTK Nvidia libraries: ``mathdx``, ``cufftMp``, ``nvshmem_host``, ``nvpl_fftw`` + * ``RTLD_DI_LINKMAP``-based new implementation of ``abs_path_for_dynamic_library()`` (`PR #834 `_) - Eliminates ``supported_nvidia_libs.EXPECTED_LIB_SYMBOLS`` entirely, providing major simplification From d54ecf1b0f97c991f602ce69d9329f218cba300e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 28 Aug 2025 21:01:03 -0400 Subject: [PATCH 076/113] Update with whitespace-only changes from cython-gen (#924) --- .../cuda/bindings/_bindings/cydriver.pyx.in | 16 +++++++--------- .../cuda/bindings/_bindings/cynvrtc.pyx.in | 4 ++-- .../cuda/bindings/_bindings/cyruntime.pxd.in | 1 + .../cuda/bindings/_bindings/cyruntime.pyx.in | 5 +++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 6925ff635..909c18e7d 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -12,9 +12,10 @@ cimport cuda.bindings._lib.dlfcn as dlfcn from libc.stdint cimport intptr_t import os import sys -import threading cimport cuda.bindings._bindings.loader as loader -cdef object __symbol_lock = threading.RLock() +import threading + +cdef object __symbol_lock = threading.Lock() cdef bint __cuPythonInit = False {{if 'cuGetErrorString' in found_functions}}cdef void *__cuGetErrorString = NULL{{endif}} {{if 'cuGetErrorName' in found_functions}}cdef void *__cuGetErrorName = NULL{{endif}} @@ -510,7 +511,7 @@ cdef int _cuPythonInit() except -1 nogil: {{else}} path = 'libcuda.so.1' {{endif}} - + {{if 'Windows' == platform.system()}} LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 try: @@ -522,7 +523,7 @@ cdef int _cuPythonInit() except -1 nogil: if (handle == NULL): raise RuntimeError('Failed to dlopen ' + path) {{endif}} - + # Get latest __cuGetProcAddress_v2 global __cuGetProcAddress_v2 {{if 'Windows' == platform.system()}} @@ -533,7 +534,7 @@ cdef int _cuPythonInit() except -1 nogil: {{else}} __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') {{endif}} - + # Load using cuGetProcAddress if available if __cuGetProcAddress_v2 != NULL: _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 @@ -2760,10 +2761,9 @@ cdef int _cuPythonInit() except -1 nogil: global __cuGraphicsVDPAURegisterOutputSurface _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - __cuPythonInit = True return 0 - + {{if 'Windows' == platform.system()}} # Load using win32GetAddr if usePTDS: @@ -8877,7 +8877,6 @@ cdef int _cuPythonInit() except -1 nogil: __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface') {{endif}} {{endif}} - __cuPythonInit = True return 0 @@ -8886,7 +8885,6 @@ cdef int _cuPythonInit() except -1 nogil: cdef inline int cuPythonInit() except -1 nogil: if __cuPythonInit: return 0 - return _cuPythonInit() {{if 'cuGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index 44ec26ffb..229687a85 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -43,6 +43,7 @@ cdef bint __cuPythonInit = False cdef int _cuPythonInit() except -1 nogil: global __cuPythonInit + # Load library with gil, __symbol_lock: {{if 'Windows' == platform.system()}} handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint @@ -317,8 +318,8 @@ cdef int _cuPythonInit() except -1 nogil: global __nvrtcSetFlowCallback __nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback') {{endif}} - {{endif}} + {{endif}} __cuPythonInit = True return 0 @@ -327,7 +328,6 @@ cdef int _cuPythonInit() except -1 nogil: cdef inline int cuPythonInit() except -1 nogil: if __cuPythonInit: return 0 - return _cuPythonInit() {{if 'nvrtcGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in index 61b9b6e43..175a93151 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in @@ -3,6 +3,7 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. include "../cyruntime_types.pxi" + include "../_lib/cyruntime/cyruntime.pxd" {{if 'cudaDeviceReset' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index 1b6707d79..2d5a2efda 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -13,6 +13,7 @@ cdef bint __usePTDS = False cdef int _cudaPythonInit() except -1 nogil: global __cudaPythonInit global __usePTDS + with gil: __usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=False) __cudaPythonInit = True @@ -23,7 +24,6 @@ cdef int _cudaPythonInit() except -1 nogil: cdef inline int cudaPythonInit() except -1 nogil: if __cudaPythonInit: return __usePTDS - return _cudaPythonInit() {{if 'cudaDeviceReset' in found_functions}} @@ -2672,4 +2672,5 @@ cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver no return cudaProfilerStop() {{endif}} -include "../_lib/cyruntime/cyruntime.pxi" \ No newline at end of file + +include "../_lib/cyruntime/cyruntime.pxi" From 817436167cbc22e2e3fa3bcc4f7bb46bb50e51d9 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 28 Aug 2025 22:31:35 -0700 Subject: [PATCH 077/113] Add `cuda_pathfinder/DESCRIPTION.rst` and prepare for `v1.2.0` release (#926) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add cuda_pathfinder/DESCRIPTION.rst * Bump pathfinder version to 1.2.0 (for release) * Change 1.X.Y → 1.2.0 under docs/source/release* * Add "1.2.0" in cuda_pathfinder/docs/nv-versions.json * Add `"readme"` to the `dynamic` list in pyproject.toml * Add `twine check --strict` option for cuda_pathfinder wheel --- .github/workflows/build-wheel.yml | 2 +- cuda_pathfinder/DESCRIPTION.rst | 30 +++++++++++++++++++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/docs/nv-versions.json | 4 +++ cuda_pathfinder/docs/source/release.rst | 2 +- .../{1.X.Y-notes.rst => 1.2.0-notes.rst} | 4 +-- cuda_pathfinder/pyproject.toml | 2 +- 7 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 cuda_pathfinder/DESCRIPTION.rst rename cuda_pathfinder/docs/source/release/{1.X.Y-notes.rst => 1.2.0-notes.rst} (95%) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 8d93d7e0b..92eca8f63 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -96,7 +96,7 @@ jobs: - name: Check cuda.pathfinder wheel if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | - twine check cuda_pathfinder/*.whl + twine check --strict cuda_pathfinder/*.whl - name: Upload cuda.pathfinder build artifacts if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} diff --git a/cuda_pathfinder/DESCRIPTION.rst b/cuda_pathfinder/DESCRIPTION.rst new file mode 100644 index 000000000..2f6dc2c6e --- /dev/null +++ b/cuda_pathfinder/DESCRIPTION.rst @@ -0,0 +1,30 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +******************************************************* +cuda-pathfinder: Utilities for locating CUDA components +******************************************************* + +`cuda.pathfinder `_ +aims to be a one-stop solution for locating CUDA components. Currently +it supports locating and loading dynamic libraries (``.so``, ``.dll``); +support for headers and other artifacts is in progress. + +* `Documentation `_ +* `Releases `_ +* `Repository `_ +* `Issue tracker `_ (select component ``cuda.pathfinder``) + +``cuda.pathfinder`` is under active development. Feedback and suggestions are welcome. + + +Installation +============ + +.. code-block:: bash + + pip install cuda-pathfinder + +``cuda-pathfinder`` is `CUDA Toolkit (CTK) `_ +version-agnostic. It follows the general CUDA Toolkit support policy: the +two most recent major versions are supported simultaneously. diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 09b44665a..c90df0c58 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.2.0a0" +__version__ = "1.2.0" diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json index 1b3847578..4206f5211 100644 --- a/cuda_pathfinder/docs/nv-versions.json +++ b/cuda_pathfinder/docs/nv-versions.json @@ -2,5 +2,9 @@ { "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" + }, + { + "version": "1.2.0", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.0/" } ] diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst index f90e50d26..e35228991 100644 --- a/cuda_pathfinder/docs/source/release.rst +++ b/cuda_pathfinder/docs/source/release.rst @@ -7,6 +7,6 @@ Release Notes .. toctree:: :maxdepth: 3 - 1.X.Y + 1.2.0 1.1.0 1.0.0 diff --git a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst b/cuda_pathfinder/docs/source/release/1.2.0-notes.rst similarity index 95% rename from cuda_pathfinder/docs/source/release/1.X.Y-notes.rst rename to cuda_pathfinder/docs/source/release/1.2.0-notes.rst index e952a87e9..6037dba84 100644 --- a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst +++ b/cuda_pathfinder/docs/source/release/1.2.0-notes.rst @@ -3,10 +3,10 @@ .. module:: cuda.pathfinder -``cuda-pathfinder`` 1.X.Y Release notes +``cuda-pathfinder`` 1.2.0 Release notes ======================================== -Released on TBD +Released on Aug 29, 2025 Highlights diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index fc5dc74d8..7a6de0152 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -7,7 +7,7 @@ description = "Pathfinder for CUDA components" authors = [{ name = "NVIDIA Corporation", email = "cuda-python-conduct@nvidia.com" }] license = "Apache-2.0" requires-python = ">=3.9" -dynamic = ["version"] +dynamic = ["version", "readme"] dependencies = [] [project.optional-dependencies] From 874336cfdb140764ba010f565cb33c76bbcd74d6 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 29 Aug 2025 07:57:22 -0700 Subject: [PATCH 078/113] Add `--strict` option to all `twine check` commands (#927) --- .github/workflows/build-wheel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 92eca8f63..d015c49fa 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -132,7 +132,7 @@ jobs: - name: Check cuda.core wheel run: | - twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl + twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl - name: Upload cuda.core build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -179,7 +179,7 @@ jobs: - name: Check cuda.bindings wheel run: | - twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl - name: Upload cuda.bindings build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -194,7 +194,7 @@ jobs: run: | pushd cuda_python pip wheel -v --no-deps . - twine check *.whl + twine check --strict *.whl popd - name: List the cuda-python artifacts directory From f8c49f34e55201ab7cac129cc08b67f13d691cdc Mon Sep 17 00:00:00 2001 From: Yevhenii Havrylko Date: Fri, 29 Aug 2025 19:47:20 -0400 Subject: [PATCH 079/113] Add support for cuDSS lib (#931) * Fix cudss in conda * Add cudss depenencies * Fix windows * Update version * Add `cudss` to `SITE_PACKAGES_LIBDIRS_LINUX_OTHER`; add `nvidia-cudss-cu12` in pyproject.toml * Release notes update for 1.2.1 * Update pathfinder version to 1.2.1 (for release) * Add nvidia logo in cuda_pathfinder/DESCRIPTION.rst Preview: https://test.pypi.org/project/cuda-pathfinder/1.2.1.dev202508291538/ --------- Co-authored-by: Ralf W. Grosse-Kunstleve --- cuda_pathfinder/DESCRIPTION.rst | 4 ++++ .../_dynamic_libs/supported_nvidia_libs.py | 4 ++++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/docs/nv-versions.json | 4 ++++ cuda_pathfinder/docs/source/release.rst | 1 + .../docs/source/release/1.2.1-notes.rst | 15 +++++++++++++++ cuda_pathfinder/pyproject.toml | 1 + 7 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 cuda_pathfinder/docs/source/release/1.2.1-notes.rst diff --git a/cuda_pathfinder/DESCRIPTION.rst b/cuda_pathfinder/DESCRIPTION.rst index 2f6dc2c6e..e2cf533ce 100644 --- a/cuda_pathfinder/DESCRIPTION.rst +++ b/cuda_pathfinder/DESCRIPTION.rst @@ -5,6 +5,10 @@ cuda-pathfinder: Utilities for locating CUDA components ******************************************************* +.. image:: https://img.shields.io/badge/NVIDIA-black?logo=nvidia + :target: https://www.nvidia.com/ + :alt: NVIDIA + `cuda.pathfinder `_ aims to be a one-stop solution for locating CUDA components. Currently it supports locating and loading dynamic libraries (``.so``, ``.dll``); diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index 655f59845..281d798b5 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -85,6 +85,7 @@ DIRECT_DEPENDENCIES = DIRECT_DEPENDENCIES_CTK | { "mathdx": ("nvrtc",), "cufftMp": ("nvshmem_host",), + "cudss": ("cublas", "cublasLt"), } # Based on these released files: @@ -240,6 +241,7 @@ SUPPORTED_LINUX_SONAMES_OTHER = { "cufftMp": ("libcufftMp.so.11",), "mathdx": ("libmathdx.so.0",), + "cudss": ("libcudss.so.0",), "nvpl_fftw": ("libnvpl_fftw.so.0",), "nvshmem_host": ("libnvshmem_host.so.3",), } @@ -399,6 +401,7 @@ } SUPPORTED_WINDOWS_DLLS_OTHER = { "mathdx": ("mathdx64_0.dll",), + "cudss": ("cudss64_0.dll",), } SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER @@ -441,6 +444,7 @@ "nvvm": ("nvidia/cu13/lib", "nvidia/cuda_nvcc/nvvm/lib64"), } SITE_PACKAGES_LIBDIRS_LINUX_OTHER = { + "cudss": ("nvidia/cu12/lib",), "cufftMp": ("nvidia/cufftmp/cu12/lib",), "mathdx": ("nvidia/cu13/lib", "nvidia/cu12/lib"), "nvpl_fftw": ("nvpl/lib",), diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index c90df0c58..8b5c6913e 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.2.0" +__version__ = "1.2.1" diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json index 4206f5211..a8f26a1ae 100644 --- a/cuda_pathfinder/docs/nv-versions.json +++ b/cuda_pathfinder/docs/nv-versions.json @@ -3,6 +3,10 @@ "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" }, + { + "version": "1.2.1", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.1/" + }, { "version": "1.2.0", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.0/" diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst index e35228991..56b4be814 100644 --- a/cuda_pathfinder/docs/source/release.rst +++ b/cuda_pathfinder/docs/source/release.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 3 + 1.2.1 1.2.0 1.1.0 1.0.0 diff --git a/cuda_pathfinder/docs/source/release/1.2.1-notes.rst b/cuda_pathfinder/docs/source/release/1.2.1-notes.rst new file mode 100644 index 000000000..7a8e410fe --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.2.1-notes.rst @@ -0,0 +1,15 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.2.1 Release notes +======================================= + +Released on Aug 29, 2025 + + +Highlights +---------- + +* Support cuDSS library (`PR #931 `_) diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 7a6de0152..f7d596f5c 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -18,6 +18,7 @@ nvidia_wheels_cu12 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", "nvidia-libmathdx-cu12", + "nvidia-cudss-cu12", "nvidia-cufftmp-cu12; sys_platform != 'win32'", "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] From 00765966f8145c95ceb96beda4cabf8992e89d28 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 29 Aug 2025 23:44:30 -0400 Subject: [PATCH 080/113] rerun codegen (#933) --- cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx | 1 + cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx | 2 +- cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx | 2 +- cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx | 2 +- cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 744540be5..528628b35 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -13,6 +13,7 @@ from cuda.pathfinder import load_nvidia_dynamic_lib import cython + ############################################################################### # Extern ############################################################################### diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 32ec53489..f641ae706 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -5,8 +5,8 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t -import threading +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 272fb67fe..b2c057616 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -5,8 +5,8 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t -import threading +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 33c25d4aa..c2c1dd2b0 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -5,8 +5,8 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t -import threading +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index 9a88b4dce..98870aa61 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -5,8 +5,8 @@ # This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. from libc.stdint cimport intptr_t -import threading +import threading from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib From 294151a00f2fcc2f0725eb8560ebd6da26857582 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 2 Sep 2025 18:24:00 -0400 Subject: [PATCH 081/113] Fix #891: Use built-in types rather than typing aliases for type annotations (#937) * Auto-generated changes * Non-auto-generated changes * Add some missing instances --- cuda_bindings/cuda/bindings/_lib/utils.pxi.in | 2 +- cuda_bindings/cuda/bindings/driver.pxd.in | 130 ++--- cuda_bindings/cuda/bindings/driver.pyx.in | 510 +++++++++--------- cuda_bindings/cuda/bindings/nvrtc.pyx.in | 20 +- cuda_bindings/cuda/bindings/runtime.pxd.in | 84 +-- cuda_bindings/cuda/bindings/runtime.pyx.in | 396 +++++++------- cuda_bindings/pyproject.toml | 1 - cuda_core/cuda/core/experimental/_linker.py | 14 +- cuda_core/cuda/core/experimental/_memory.pyx | 10 +- cuda_core/cuda/core/experimental/_program.py | 42 +- cuda_core/cuda/core/experimental/_stream.pyx | 6 +- cuda_core/cuda/core/experimental/_system.py | 4 +- cuda_core/pyproject.toml | 1 - cuda_core/tests/test_memory.py | 4 +- 14 files changed, 610 insertions(+), 614 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in index 0a9f2e4e3..c2a8b9a9a 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in @@ -114,7 +114,7 @@ cdef class _HelperKernelParams: raise TypeError("Unsupported type: " + str(type(ctype))) idx += 1 else: - raise TypeError("Argument 'kernelParams' is not a valid type: Tuple[Tuple[Any, ...], Tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int") + raise TypeError("Argument 'kernelParams' is not a valid type: tuple[tuple[Any, ...], tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int") def __dealloc__(self): if self._pyobj_acquired is True: diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in index ee01d5b58..ef68053b5 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd.in @@ -826,7 +826,7 @@ cdef class CUstreamBatchMemOpParams_union: Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -1012,11 +1012,11 @@ cdef class CUdevprop_st: Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -2723,7 +2723,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2755,7 +2755,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2890,7 +2890,7 @@ cdef class anon_struct11: Attributes ---------- {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -2991,7 +2991,7 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -3023,11 +3023,11 @@ cdef class CUDA_TEXTURE_DESC_st: Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -3080,7 +3080,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3102,7 +3102,7 @@ cdef class CUtensorMap_st: Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -3281,7 +3281,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3317,7 +3317,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3351,7 +3351,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3438,7 +3438,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3530,7 +3530,7 @@ cdef class anon_struct16: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3574,7 +3574,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3670,7 +3670,7 @@ cdef class anon_struct19: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3714,7 +3714,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -4080,7 +4080,7 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -4865,11 +4865,11 @@ cdef class CUgraphNodeParams_st: Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -4994,7 +4994,7 @@ cdef class CUcheckpointLockArgs_st: Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5015,7 +5015,7 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5067,7 +5067,7 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5208,11 +5208,11 @@ cdef class anon_union15: Attributes ---------- {{if True}} - pArray : List[CUarray] + pArray : list[CUarray] {{endif}} {{if True}} - pPitch : List[Any] + pPitch : list[Any] {{endif}} @@ -5539,7 +5539,7 @@ cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -5582,7 +5582,7 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -5729,11 +5729,11 @@ cdef class CUdevprop_v1(CUdevprop_st): Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -5785,11 +5785,11 @@ cdef class CUdevprop(CUdevprop_v1): Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -8175,7 +8175,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8212,7 +8212,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8240,7 +8240,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8268,7 +8268,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8344,7 +8344,7 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -8376,11 +8376,11 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -8400,7 +8400,7 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -8432,11 +8432,11 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -8488,7 +8488,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8540,7 +8540,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8561,7 +8561,7 @@ cdef class CUtensorMap(CUtensorMap_st): Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -8757,7 +8757,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8793,7 +8793,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8825,7 +8825,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_ Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8857,7 +8857,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8890,7 +8890,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIP Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8923,7 +8923,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAP Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8955,7 +8955,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8987,7 +8987,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9022,7 +9022,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGN For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9057,7 +9057,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_ For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9092,7 +9092,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_P For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9127,7 +9127,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARA For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9376,7 +9376,7 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -9437,7 +9437,7 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -10419,11 +10419,11 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -10508,7 +10508,7 @@ cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -10528,7 +10528,7 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -10572,7 +10572,7 @@ cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 975153c58..37de76cad 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 13.0.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -8669,7 +8669,7 @@ cdef class CUstreamBatchMemOpParams_union: Params for CU_STREAM_MEM_OP_BARRIER operations. {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -9250,11 +9250,11 @@ cdef class CUdevprop_st: Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -14949,7 +14949,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -15066,7 +15066,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -15524,7 +15524,7 @@ cdef class anon_struct11: Attributes ---------- {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -15798,7 +15798,7 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -15830,11 +15830,11 @@ cdef class CUDA_TEXTURE_DESC_st: Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -16046,7 +16046,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16211,7 +16211,7 @@ cdef class CUtensorMap_st: Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -16735,7 +16735,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16860,7 +16860,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16965,7 +16965,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17224,7 +17224,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17490,7 +17490,7 @@ cdef class anon_struct16: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17604,7 +17604,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17870,7 +17870,7 @@ cdef class anon_struct19: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17984,7 +17984,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -19077,7 +19077,7 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -21478,11 +21478,11 @@ cdef class CUgraphNodeParams_st: Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -21864,7 +21864,7 @@ cdef class CUcheckpointLockArgs_st: Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -21943,7 +21943,7 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -22068,7 +22068,7 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -22494,11 +22494,11 @@ cdef class anon_union15: Attributes ---------- {{if True}} - pArray : List[CUarray] + pArray : list[CUarray] {{endif}} {{if True}} - pPitch : List[Any] + pPitch : list[Any] {{endif}} @@ -22539,7 +22539,7 @@ cdef class anon_union15: def pArray(self): return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : List[CUarray]): + def pArray(self, pArray : list[CUarray]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] @@ -22552,7 +22552,7 @@ cdef class anon_union15: def pPitch(self): return [_pPitch for _pPitch in self._pvt_ptr[0].frame.pPitch] @pPitch.setter - def pPitch(self, pPitch : List[int]): + def pPitch(self, pPitch : list[int]): if len(pPitch) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) pPitch = [_pPitch for _pPitch in pPitch] @@ -23674,7 +23674,7 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} @cython.embedsignature(True) -def cuDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[CUatomicOperation] | List[CUatomicOperation]], unsigned int count, dev): +def cuDeviceGetHostAtomicCapabilities(operations : Optional[tuple[CUatomicOperation] | list[CUatomicOperation]], unsigned int count, dev): """ Queries details about atomic operations supported between the device and host. Returns in `*capabilities` the details about requested atomic @@ -23694,7 +23694,7 @@ def cuDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[CUatomicOperat Parameters ---------- - operations : List[:py:obj:`~.CUatomicOperation`] + operations : list[:py:obj:`~.CUatomicOperation`] Requested operations count : unsigned int Count of requested operations and size of capabilities @@ -23705,7 +23705,7 @@ def cuDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[CUatomicOperat ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - capabilities : List[unsigned int] + capabilities : list[unsigned int] Returned capability details of each requested operation See Also @@ -23722,7 +23722,7 @@ def cuDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[CUatomicOperat cydev = pdev operations = [] if operations is None else operations if not all(isinstance(_x, (CUatomicOperation)) for _x in operations): - raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cydriver.CUatomicOperation] or List[cydriver.CUatomicOperation]") + raise TypeError("Argument 'operations' is not instance of type (expected tuple[cydriver.CUatomicOperation] or list[cydriver.CUatomicOperation]") cdef unsigned int* cycapabilities = NULL pycapabilities = [] if count != 0: @@ -25951,7 +25951,7 @@ def cuModuleLoadData(image): {{if 'cuModuleLoadDataEx' in found_functions}} @cython.embedsignature(True) -def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Load a module's data with options. Takes a pointer `image` and loads the corresponding module `module` @@ -25965,9 +25965,9 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[ Module data to load numOptions : unsigned int Number of options - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options for JIT - optionValues : List[Any] + optionValues : list[Any] Option values for JIT Returns @@ -25984,7 +25984,7 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[ optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUmodule module = CUmodule() cyimage = _HelperInputVoidPtr(image) cdef void* cyimage_ptr = cyimage.cptr @@ -26218,7 +26218,7 @@ def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - functions : List[:py:obj:`~.CUfunction`] + functions : list[:py:obj:`~.CUfunction`] Buffer where the function handles are returned to See Also @@ -26302,7 +26302,7 @@ def cuModuleGetGlobal(hmod, char* name): {{if 'cuLinkCreate_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Creates a pending JIT linker invocation. If the call is successful, the caller owns the returned CUlinkState, @@ -26331,9 +26331,9 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] ---------- numOptions : unsigned int Size of options arrays - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Array of linker and compiler options - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void * Returns @@ -26355,7 +26355,7 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] @@ -26376,7 +26376,7 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] {{if 'cuLinkAddData_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, char* name, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, char* name, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Add an input to a pending linker invocation. Ownership of `data` is retained by the caller. No reference is retained @@ -26402,10 +26402,10 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, An optional name for this input in log messages. numOptions : unsigned int Size of options. - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options to be applied only for this input (overrides options from :py:obj:`~.cuLinkCreate`). - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void *. Returns @@ -26424,7 +26424,7 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef cydriver.CUlinkState cystate if state is None: pstate = 0 @@ -26450,7 +26450,7 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, {{if 'cuLinkAddFile_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Add a file input to a pending linker invocation. No reference is retained to any inputs after this call returns. @@ -26474,10 +26474,10 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne Path to the input file numOptions : unsigned int Size of options - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options to be applied only for this input (overrides options from :py:obj:`~.cuLinkCreate`) - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void * Returns @@ -26496,7 +26496,7 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef cydriver.CUlinkState cystate if state is None: pstate = 0 @@ -26696,7 +26696,7 @@ def cuModuleGetSurfRef(hmod, char* name): {{if 'cuLibraryLoadData' in found_functions}} @cython.embedsignature(True) -def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUjit_option]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[CUlibraryOption] | List[CUlibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cuLibraryLoadData(code, jitOptions : Optional[tuple[CUjit_option] | list[CUjit_option]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[CUlibraryOption] | list[CUlibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified code and options. Takes a pointer `code` and loads the corresponding library `library` @@ -26733,15 +26733,15 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj ---------- code : Any Code to load - jitOptions : List[:py:obj:`~.CUjit_option`] + jitOptions : list[:py:obj:`~.CUjit_option`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.CUlibraryOption`] + libraryOptions : list[:py:obj:`~.CUlibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -26764,11 +26764,11 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cydriver.CUlibraryOption] or List[cydriver.CUlibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr @@ -26794,7 +26794,7 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj {{if 'cuLibraryLoadFromFile' in found_functions}} @cython.embedsignature(True) -def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_option] | List[CUjit_option]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[CUlibraryOption] | List[CUlibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[CUjit_option] | list[CUjit_option]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[CUlibraryOption] | list[CUlibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified file and options. Takes a pointer `code` and loads the corresponding library `library` @@ -26832,15 +26832,15 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_opti ---------- fileName : bytes File to load from - jitOptions : List[:py:obj:`~.CUjit_option`] + jitOptions : list[:py:obj:`~.CUjit_option`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.CUlibraryOption`] + libraryOptions : list[:py:obj:`~.CUlibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -26863,11 +26863,11 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_opti libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cydriver.CUlibraryOption] or List[cydriver.CUlibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() cdef vector[cydriver.CUjit_option] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] @@ -27024,7 +27024,7 @@ def cuLibraryEnumerateKernels(unsigned int numKernels, lib): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - kernels : List[:py:obj:`~.CUkernel`] + kernels : list[:py:obj:`~.CUkernel`] Buffer where the kernel handles are returned to See Also @@ -30745,7 +30745,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): {{if 'cuMemcpyBatchAsync_v2' in found_functions}} @cython.embedsignature(True) -def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], srcs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, attrs : Optional[Tuple[CUmemcpyAttributes] | List[CUmemcpyAttributes]], attrsIdxs : Tuple[int] | List[int], size_t numAttrs, hStream): +def cuMemcpyBatchAsync(dsts : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], srcs : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], sizes : tuple[int] | list[int], size_t count, attrs : Optional[tuple[CUmemcpyAttributes] | list[CUmemcpyAttributes]], attrsIdxs : tuple[int] | list[int], size_t numAttrs, hStream): """ Performs a batch of memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -30819,17 +30819,17 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], Parameters ---------- - dsts : List[:py:obj:`~.CUdeviceptr`] + dsts : list[:py:obj:`~.CUdeviceptr`] Array of destination pointers. - srcs : List[:py:obj:`~.CUdeviceptr`] + srcs : list[:py:obj:`~.CUdeviceptr`] Array of memcpy source pointers. - sizes : List[int] + sizes : list[int] Array of sizes for memcpy operations. count : size_t Size of `dsts`, `srcs` and `sizes` arrays - attrs : List[:py:obj:`~.CUmemcpyAttributes`] + attrs : list[:py:obj:`~.CUmemcpyAttributes`] Array of memcpy attributes. - attrsIdxs : List[int] + attrsIdxs : list[int] Array of indices to specify which copies each entry in the `attrs` array applies to. The attributes specified in attrs[k] will be applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] @@ -30855,18 +30855,18 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], phStream = int(CUstream(hStream)) cyhStream = phStream if not all(isinstance(_x, (int)) for _x in attrsIdxs): - raise TypeError("Argument 'attrsIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") attrs = [] if attrs is None else attrs if not all(isinstance(_x, (CUmemcpyAttributes,)) for _x in attrs): - raise TypeError("Argument 'attrs' is not instance of type (expected Tuple[cydriver.CUmemcpyAttributes,] or List[cydriver.CUmemcpyAttributes,]") + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cydriver.CUmemcpyAttributes,] or list[cydriver.CUmemcpyAttributes,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") srcs = [] if srcs is None else srcs if not all(isinstance(_x, (CUdeviceptr,)) for _x in srcs): - raise TypeError("Argument 'srcs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'srcs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") dsts = [] if dsts is None else dsts if not all(isinstance(_x, (CUdeviceptr,)) for _x in dsts): - raise TypeError("Argument 'dsts' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'dsts' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") cdef cydriver.CUdeviceptr* cydsts = NULL if len(dsts) > 1: cydsts = calloc(len(dsts), sizeof(cydriver.CUdeviceptr)) @@ -30917,7 +30917,7 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} @cython.embedsignature(True) -def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BATCH_OP] | List[CUDA_MEMCPY3D_BATCH_OP]], unsigned long long flags, hStream): +def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BATCH_OP] | list[CUDA_MEMCPY3D_BATCH_OP]], unsigned long long flags, hStream): """ Performs a batch of 3D memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -31004,7 +31004,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA ---------- numOps : size_t Total number of memcpy operations. - opList : List[:py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`] + opList : list[:py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`] Array of size `numOps` containing the actual memcpy operations. flags : unsigned long long Flags for future use, must be zero now. @@ -31027,7 +31027,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA cyhStream = phStream opList = [] if opList is None else opList if not all(isinstance(_x, (CUDA_MEMCPY3D_BATCH_OP,)) for _x in opList): - raise TypeError("Argument 'opList' is not instance of type (expected Tuple[cydriver.CUDA_MEMCPY3D_BATCH_OP,] or List[cydriver.CUDA_MEMCPY3D_BATCH_OP,]") + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cydriver.CUDA_MEMCPY3D_BATCH_OP,] or list[cydriver.CUDA_MEMCPY3D_BATCH_OP,]") if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) cdef cydriver.CUDA_MEMCPY3D_BATCH_OP* cyopList = NULL if len(opList) > 1: @@ -32933,7 +32933,7 @@ def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): {{if 'cuMemMapArrayAsync' in found_functions}} @cython.embedsignature(True) -def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarrayMapInfo]], unsigned int count, hStream): +def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarrayMapInfo]], unsigned int count, hStream): """ Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. Performs map or unmap operations on subregions of sparse CUDA arrays @@ -33060,7 +33060,7 @@ def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarr Parameters ---------- - mapInfoList : List[:py:obj:`~.CUarrayMapInfo`] + mapInfoList : list[:py:obj:`~.CUarrayMapInfo`] List of :py:obj:`~.CUarrayMapInfo` count : unsigned int Count of :py:obj:`~.CUarrayMapInfo` in `mapInfoList` @@ -33086,7 +33086,7 @@ def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarr cyhStream = phStream mapInfoList = [] if mapInfoList is None else mapInfoList if not all(isinstance(_x, (CUarrayMapInfo,)) for _x in mapInfoList): - raise TypeError("Argument 'mapInfoList' is not instance of type (expected Tuple[cydriver.CUarrayMapInfo,] or List[cydriver.CUarrayMapInfo,]") + raise TypeError("Argument 'mapInfoList' is not instance of type (expected tuple[cydriver.CUarrayMapInfo,] or list[cydriver.CUarrayMapInfo,]") cdef cydriver.CUarrayMapInfo* cymapInfoList = NULL if len(mapInfoList) > 1: cymapInfoList = calloc(len(mapInfoList), sizeof(cydriver.CUarrayMapInfo)) @@ -33155,7 +33155,7 @@ def cuMemUnmap(ptr, size_t size): {{if 'cuMemSetAccess' in found_functions}} @cython.embedsignature(True) -def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | List[CUmemAccessDesc]], size_t count): +def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): """ Set the access flags for each location specified in `desc` for the given virtual address range. Given the virtual address range via `ptr` and `size`, and the locations @@ -33182,7 +33182,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | Li Starting address for the virtual address range size : size_t Length of the virtual address range - desc : List[:py:obj:`~.CUmemAccessDesc`] + desc : list[:py:obj:`~.CUmemAccessDesc`] Array of :py:obj:`~.CUmemAccessDesc` that describe how to change the count : size_t @@ -33199,7 +33199,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | Li """ desc = [] if desc is None else desc if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in desc): - raise TypeError("Argument 'desc' is not instance of type (expected Tuple[cydriver.CUmemAccessDesc,] or List[cydriver.CUmemAccessDesc,]") + raise TypeError("Argument 'desc' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") cdef cydriver.CUdeviceptr cyptr if ptr is None: pptr = 0 @@ -33809,14 +33809,14 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): {{if 'cuMemPoolSetAccess' in found_functions}} @cython.embedsignature(True) -def cuMemPoolSetAccess(pool, map : Optional[Tuple[CUmemAccessDesc] | List[CUmemAccessDesc]], size_t count): +def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): """ Controls visibility of pools between devices. Parameters ---------- pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` The pool being modified - map : List[:py:obj:`~.CUmemAccessDesc`] + map : list[:py:obj:`~.CUmemAccessDesc`] Array of access descriptors. Each descriptor instructs the access to enable for a single gpu. count : size_t @@ -33833,7 +33833,7 @@ def cuMemPoolSetAccess(pool, map : Optional[Tuple[CUmemAccessDesc] | List[CUmemA """ map = [] if map is None else map if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in map): - raise TypeError("Argument 'map' is not instance of type (expected Tuple[cydriver.CUmemAccessDesc,] or List[cydriver.CUmemAccessDesc,]") + raise TypeError("Argument 'map' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") cdef cydriver.CUmemoryPool cypool if pool is None: ppool = 0 @@ -35372,7 +35372,7 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n {{if 'cuMemPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cuMemPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[CUmemLocation] | List[CUmemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, hStream): +def cuMemPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], sizes : tuple[int] | list[int], size_t count, prefetchLocs : Optional[tuple[CUmemLocation] | list[CUmemLocation]], prefetchLocIdxs : tuple[int] | list[int], size_t numPrefetchLocs, unsigned long long flags, hStream): """ Performs a batch of memory prefetches asynchronously. Performs a batch of memory prefetches. The batch as a whole executes in @@ -35409,15 +35409,15 @@ def cuMemPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicep Parameters ---------- - dptrs : List[:py:obj:`~.CUdeviceptr`] + dptrs : list[:py:obj:`~.CUdeviceptr`] Array of pointers to be prefetched - sizes : List[int] + sizes : list[int] Array of sizes for memory prefetch operations. count : size_t Size of `dptrs` and `sizes` arrays. - prefetchLocs : List[:py:obj:`~.CUmemLocation`] + prefetchLocs : list[:py:obj:`~.CUmemLocation`] Array of locations to prefetch to. - prefetchLocIdxs : List[int] + prefetchLocIdxs : list[int] Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs[k] will be applied to copies starting from @@ -35446,15 +35446,15 @@ def cuMemPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicep phStream = int(CUstream(hStream)) cyhStream = phStream if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): - raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected tuple[int] or list[int]") prefetchLocs = [] if prefetchLocs is None else prefetchLocs if not all(isinstance(_x, (CUmemLocation,)) for _x in prefetchLocs): - raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cydriver.CUmemLocation,] or List[cydriver.CUmemLocation,]") + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected tuple[cydriver.CUmemLocation,] or list[cydriver.CUmemLocation,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): - raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'dptrs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") cdef cydriver.CUdeviceptr* cydptrs = NULL if len(dptrs) > 1: cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) @@ -35492,7 +35492,7 @@ def cuMemPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicep {{if 'cuMemDiscardBatchAsync' in found_functions}} @cython.embedsignature(True) -def cuMemDiscardBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, unsigned long long flags, hStream): +def cuMemDiscardBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], sizes : tuple[int] | list[int], size_t count, unsigned long long flags, hStream): """ Performs a batch of memory discards asynchronously. Performs a batch of memory discards. The batch as a whole executes in @@ -35524,9 +35524,9 @@ def cuMemDiscardBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicept Parameters ---------- - dptrs : List[:py:obj:`~.CUdeviceptr`] + dptrs : list[:py:obj:`~.CUdeviceptr`] Array of pointers to be discarded - sizes : List[int] + sizes : list[int] Array of sizes for memory discard operations. count : size_t Size of `dptrs` and `sizes` arrays. @@ -35550,10 +35550,10 @@ def cuMemDiscardBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicept phStream = int(CUstream(hStream)) cyhStream = phStream if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): - raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'dptrs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") cdef cydriver.CUdeviceptr* cydptrs = NULL if len(dptrs) > 1: cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) @@ -35577,7 +35577,7 @@ def cuMemDiscardBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdevicept {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[CUmemLocation] | List[CUmemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, hStream): +def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], sizes : tuple[int] | list[int], size_t count, prefetchLocs : Optional[tuple[CUmemLocation] | list[CUmemLocation]], prefetchLocIdxs : tuple[int] | list[int], size_t numPrefetchLocs, unsigned long long flags, hStream): """ Performs a batch of memory discards and prefetches asynchronously. Performs a batch of memory discards followed by prefetches. The batch @@ -35622,15 +35622,15 @@ def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List Parameters ---------- - dptrs : List[:py:obj:`~.CUdeviceptr`] + dptrs : list[:py:obj:`~.CUdeviceptr`] Array of pointers to be discarded - sizes : List[int] + sizes : list[int] Array of sizes for memory discard operations. count : size_t Size of `dptrs` and `sizes` arrays. - prefetchLocs : List[:py:obj:`~.CUmemLocation`] + prefetchLocs : list[:py:obj:`~.CUmemLocation`] Array of locations to prefetch to. - prefetchLocIdxs : List[int] + prefetchLocIdxs : list[int] Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs[k] will be applied to operations starting from @@ -35659,15 +35659,15 @@ def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[CUdeviceptr] | List phStream = int(CUstream(hStream)) cyhStream = phStream if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): - raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected tuple[int] or list[int]") prefetchLocs = [] if prefetchLocs is None else prefetchLocs if not all(isinstance(_x, (CUmemLocation,)) for _x in prefetchLocs): - raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cydriver.CUmemLocation,] or List[cydriver.CUmemLocation,]") + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected tuple[cydriver.CUmemLocation,] or list[cydriver.CUmemLocation,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs if not all(isinstance(_x, (CUdeviceptr,)) for _x in dptrs): - raise TypeError("Argument 'dptrs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'dptrs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") cdef cydriver.CUdeviceptr* cydptrs = NULL if len(dptrs) > 1: cydptrs = calloc(len(dptrs), sizeof(cydriver.CUdeviceptr)) @@ -35863,7 +35863,7 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att {{if 'cuMemRangeGetAttributes' in found_functions}} @cython.embedsignature(True) -def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Optional[Tuple[CUmem_range_attribute] | List[CUmem_range_attribute]], size_t numAttributes, devPtr, size_t count): +def cuMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Optional[tuple[CUmem_range_attribute] | list[CUmem_range_attribute]], size_t numAttributes, devPtr, size_t count): """ Query attributes of a given memory range. Query attributes of the memory range starting at `devPtr` with a size @@ -35896,9 +35896,9 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt Parameters ---------- - dataSizes : List[int] + dataSizes : list[int] Array containing the sizes of each result - attributes : List[:py:obj:`~.CUmem_range_attribute`] + attributes : list[:py:obj:`~.CUmem_range_attribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) numAttributes : size_t @@ -35912,7 +35912,7 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -35930,9 +35930,9 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt cydevPtr = pdevPtr attributes = [] if attributes is None else attributes if not all(isinstance(_x, (CUmem_range_attribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUmem_range_attribute] or List[cydriver.CUmem_range_attribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUmem_range_attribute] or list[cydriver.CUmem_range_attribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): - raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr @@ -36006,7 +36006,7 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): {{if 'cuPointerGetAttributes' in found_functions}} @cython.embedsignature(True) -def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tuple[CUpointer_attribute] | List[CUpointer_attribute]], ptr): +def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tuple[CUpointer_attribute] | list[CUpointer_attribute]], ptr): """ Returns information about a pointer. The supported attributes are (refer to @@ -36056,7 +36056,7 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup ---------- numAttributes : unsigned int Number of attributes to query - attributes : List[:py:obj:`~.CUpointer_attribute`] + attributes : list[:py:obj:`~.CUpointer_attribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) ptr : :py:obj:`~.CUdeviceptr` @@ -36066,7 +36066,7 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -36084,7 +36084,7 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup cyptr = pptr attributes = [] if attributes is None else attributes if not all(isinstance(_x, (CUpointer_attribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUpointer_attribute] or List[cydriver.CUpointer_attribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUpointer_attribute] or list[cydriver.CUpointer_attribute]") if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) cdef vector[cydriver.CUpointer_attribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] pylist = [_HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] @@ -36762,7 +36762,7 @@ def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): {{if 'cuStreamBeginCaptureToGraph' in found_functions}} @cython.embedsignature(True) -def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, mode not None : CUstreamCaptureMode): +def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, mode not None : CUstreamCaptureMode): """ Begins graph capture on a stream to an existing graph. Begin graph capture on `hStream`, placing new nodes into an existing @@ -36788,10 +36788,10 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[C Stream in which to initiate capture. hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to capture into. - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0. - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t Number of dependencies. @@ -36815,10 +36815,10 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[C """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -37100,7 +37100,7 @@ def cuStreamGetCaptureInfo(hStream): are or become unreachable from the original stream at :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. - dependencies_out : List[:py:obj:`~.CUgraphNode`] + dependencies_out : list[:py:obj:`~.CUgraphNode`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -37109,7 +37109,7 @@ def cuStreamGetCaptureInfo(hStream): be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying. - edgeData_out : List[:py:obj:`~.CUgraphEdgeData`] + edgeData_out : list[:py:obj:`~.CUgraphEdgeData`] Optional location to store a pointer to an array of graph edge data. This array parallels `dependencies_out`; the next node to be added has an edge to `dependencies_out`[i] with annotation @@ -37154,7 +37154,7 @@ def cuStreamGetCaptureInfo(hStream): {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): +def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream. Modifies the dependency set of a capturing stream. The dependency set @@ -37178,9 +37178,9 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUg ---------- hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] The set of dependencies to add - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t The size of the dependencies array @@ -37198,10 +37198,10 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUg """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUstream cyhStream if hStream is None: phStream = 0 @@ -38494,7 +38494,7 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemaphore] | List[CUexternalSemaphore]], paramsArray : Optional[Tuple[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS] | List[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS]], unsigned int numExtSems, stream): +def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemaphore] | list[CUexternalSemaphore]], paramsArray : Optional[tuple[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS] | list[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS]], unsigned int numExtSems, stream): """ Signals a set of external semaphore objects. Enqueues a signal operation on a set of externally allocated semaphore @@ -38582,9 +38582,9 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap Parameters ---------- - extSemArray : List[:py:obj:`~.CUexternalSemaphore`] + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] Set of external semaphores to be signaled - paramsArray : List[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`] + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to signal @@ -38610,10 +38610,10 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,] or List[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cydriver.CUexternalSemaphore,] or List[cydriver.CUexternalSemaphore,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) @@ -38647,7 +38647,7 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemaphore] | List[CUexternalSemaphore]], paramsArray : Optional[Tuple[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS] | List[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS]], unsigned int numExtSems, stream): +def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemaphore] | list[CUexternalSemaphore]], paramsArray : Optional[tuple[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS] | list[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS]], unsigned int numExtSems, stream): """ Waits on a set of external semaphore objects. Enqueues a wait operation on a set of externally allocated semaphore @@ -38712,9 +38712,9 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemapho Parameters ---------- - extSemArray : List[:py:obj:`~.CUexternalSemaphore`] + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] External semaphores to be waited on - paramsArray : List[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`] + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to wait on @@ -38740,10 +38740,10 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemapho cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,] or List[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cydriver.CUexternalSemaphore,] or List[cydriver.CUexternalSemaphore,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) @@ -39086,7 +39086,7 @@ def cuStreamWriteValue64(stream, addr, value, unsigned int flags): {{if 'cuStreamBatchMemOp_v2' in found_functions}} @cython.embedsignature(True) -def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[CUstreamBatchMemOpParams] | List[CUstreamBatchMemOpParams]], unsigned int flags): +def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[CUstreamBatchMemOpParams] | list[CUstreamBatchMemOpParams]], unsigned int flags): """ Batch operations to synchronize the stream via memory operations. This is a batch version of :py:obj:`~.cuStreamWaitValue32()` and @@ -39110,7 +39110,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[C The stream to enqueue the operations in. count : unsigned int The number of operations in the array. Must be less than 256. - paramArray : List[:py:obj:`~.CUstreamBatchMemOpParams`] + paramArray : list[:py:obj:`~.CUstreamBatchMemOpParams`] The types and parameters of the individual operations. flags : unsigned int Reserved for future expansion; must be 0. @@ -39130,7 +39130,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[C """ paramArray = [] if paramArray is None else paramArray if not all(isinstance(_x, (CUstreamBatchMemOpParams,)) for _x in paramArray): - raise TypeError("Argument 'paramArray' is not instance of type (expected Tuple[cydriver.CUstreamBatchMemOpParams,] or List[cydriver.CUstreamBatchMemOpParams,]") + raise TypeError("Argument 'paramArray' is not instance of type (expected tuple[cydriver.CUstreamBatchMemOpParams,] or list[cydriver.CUstreamBatchMemOpParams,]") cdef cydriver.CUstream cystream if stream is None: pstream = 0 @@ -39767,7 +39767,7 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int Stream identifier kernelParams : Any Array of pointers to kernel parameters - extra : List[Any] + extra : list[Any] Extra options Returns @@ -40015,7 +40015,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt launch kernelParams : Any Array of pointers to kernel parameters - extra : List[Any] + extra : list[Any] Extra options Returns @@ -40159,7 +40159,7 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} @cython.embedsignature(True) -def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_LAUNCH_PARAMS] | List[CUDA_LAUNCH_PARAMS]], unsigned int numDevices, unsigned int flags): +def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[tuple[CUDA_LAUNCH_PARAMS] | list[CUDA_LAUNCH_PARAMS]], unsigned int numDevices, unsigned int flags): """ Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute. [Deprecated] @@ -40294,7 +40294,7 @@ def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_ Parameters ---------- - launchParamsList : List[:py:obj:`~.CUDA_LAUNCH_PARAMS`] + launchParamsList : list[:py:obj:`~.CUDA_LAUNCH_PARAMS`] List of launch parameters, one per device numDevices : unsigned int Size of the `launchParamsList` array @@ -40312,7 +40312,7 @@ def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_ """ launchParamsList = [] if launchParamsList is None else launchParamsList if not all(isinstance(_x, (CUDA_LAUNCH_PARAMS,)) for _x in launchParamsList): - raise TypeError("Argument 'launchParamsList' is not instance of type (expected Tuple[cydriver.CUDA_LAUNCH_PARAMS,] or List[cydriver.CUDA_LAUNCH_PARAMS,]") + raise TypeError("Argument 'launchParamsList' is not instance of type (expected tuple[cydriver.CUDA_LAUNCH_PARAMS,] or list[cydriver.CUDA_LAUNCH_PARAMS,]") cdef cydriver.CUDA_LAUNCH_PARAMS* cylaunchParamsList = NULL if len(launchParamsList) > 1: cylaunchParamsList = calloc(len(launchParamsList), sizeof(cydriver.CUDA_LAUNCH_PARAMS)) @@ -41031,7 +41031,7 @@ def cuGraphCreate(unsigned int flags): {{if 'cuGraphAddKernelNode_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): +def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): """ Creates a kernel execution node and adds it to a graph. Creates a new kernel execution node and adds it to `hGraph` with @@ -41097,7 +41097,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41121,7 +41121,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41242,7 +41242,7 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR {{if 'cuGraphAddMemcpyNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, copyParams : Optional[CUDA_MEMCPY3D], ctx): +def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, copyParams : Optional[CUDA_MEMCPY3D], ctx): """ Creates a memcpy node and adds it to a graph. Creates a new memcpy node and adds it to `hGraph` with @@ -41269,7 +41269,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41299,7 +41299,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li cyctx = pctx dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41411,7 +41411,7 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): {{if 'cuGraphAddMemsetNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): +def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): """ Creates a memset node and adds it to a graph. Creates a new memset node and adds it to `hGraph` with @@ -41428,7 +41428,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41458,7 +41458,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li cyctx = pctx dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41570,7 +41570,7 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR {{if 'cuGraphAddHostNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): +def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): """ Creates a host execution node and adds it to a graph. Creates a new CPU execution node and adds it to `hGraph` with @@ -41587,7 +41587,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41607,7 +41607,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41719,7 +41719,7 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] {{if 'cuGraphAddChildGraphNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, childGraph): +def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, childGraph): """ Creates a child graph node and adds it to a graph. Creates a new node which executes an embedded graph, and adds it to @@ -41739,7 +41739,7 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41767,7 +41767,7 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] cychildGraph = pchildGraph dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41845,7 +41845,7 @@ def cuGraphChildGraphNodeGetGraph(hNode): {{if 'cuGraphAddEmptyNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): +def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): """ Creates an empty node and adds it to a graph. Creates a new node which performs no operation, and adds it to `hGraph` @@ -41865,7 +41865,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41883,7 +41883,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41916,7 +41916,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis {{if 'cuGraphAddEventRecordNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, event): +def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): """ Creates an event record node and adds it to a graph. Creates a new event record node and adds it to `hGraph` with @@ -41933,7 +41933,7 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41961,7 +41961,7 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] cyevent = pevent dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42079,7 +42079,7 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): {{if 'cuGraphAddEventWaitNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, event): +def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): """ Creates an event wait node and adds it to a graph. Creates a new event wait node and adds it to `hGraph` with @@ -42098,7 +42098,7 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42126,7 +42126,7 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | cyevent = pevent dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42244,7 +42244,7 @@ def cuGraphEventWaitNodeSetEvent(hNode, event): {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): +def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): """ Creates an external semaphore signal node and adds it to a graph. Creates a new external semaphore signal node and adds it to `hGraph` @@ -42262,7 +42262,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42282,7 +42282,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42401,7 +42401,7 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): +def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): """ Creates an external semaphore wait node and adds it to a graph. Creates a new external semaphore wait node and adds it to `hGraph` with @@ -42419,7 +42419,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[C ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42439,7 +42439,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[C """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42558,7 +42558,7 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA {{if 'cuGraphAddBatchMemOpNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): +def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): """ Creates a batch memory operation node and adds it to a graph. Creates a new batch memory operation node and adds it to `hGraph` with @@ -42575,7 +42575,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42599,7 +42599,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42790,7 +42790,7 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ {{if 'cuGraphAddMemAllocNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_MEM_ALLOC_NODE_PARAMS]): +def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_MEM_ALLOC_NODE_PARAMS]): """ Creates an allocation node and adds it to a graph. Creates a new allocation node and adds it to `hGraph` with @@ -42848,7 +42848,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42868,7 +42868,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42945,7 +42945,7 @@ def cuGraphMemAllocNodeGetParams(hNode): {{if 'cuGraphAddMemFreeNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, dptr): +def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, dptr): """ Creates a memory free node and adds it to a graph. Creates a new memory free node and adds it to `hGraph` with @@ -42980,7 +42980,7 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | L ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -43008,7 +43008,7 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | L cydptr = pdptr dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -43395,7 +43395,7 @@ def cuGraphGetNodes(hGraph, size_t numNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - nodes : List[:py:obj:`~.CUgraphNode`] + nodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the nodes numNodes : int See description @@ -43454,7 +43454,7 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - rootNodes : List[:py:obj:`~.CUgraphNode`] + rootNodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the root nodes numRootNodes : int See description @@ -43520,11 +43520,11 @@ def cuGraphGetEdges(hGraph, size_t numEdges = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional location to return edge data numEdges : int See description @@ -43609,9 +43609,9 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependencies - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array to return edge data for each dependency numDependencies : int See description @@ -43686,9 +43686,9 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependentNodes : List[:py:obj:`~.CUgraphNode`] + dependentNodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional pointer to return edge data for dependent nodes numDependentNodes : int See description @@ -43736,7 +43736,7 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): {{if 'cuGraphAddDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): +def cuGraphAddDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` @@ -43750,11 +43750,11 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of edge data. If NULL, default (zeroed) edge data is assumed. numDependencies : size_t @@ -43771,13 +43771,13 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -43829,7 +43829,7 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU {{if 'cuGraphRemoveDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): +def cuGraphRemoveDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): """ Removes dependency edges from a graph. The number of `dependencies` to be removed is defined by @@ -43849,11 +43849,11 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of edge data. If NULL, edge data is assumed to be default (zeroed). numDependencies : size_t @@ -43870,13 +43870,13 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -45782,7 +45782,7 @@ def cuGraphReleaseUserObject(graph, object, unsigned int count): {{if 'cuGraphAddNode_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): +def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): """ Adds a node of arbitrary type to a graph. Creates a new node in `hGraph` described by `nodeParams` with @@ -45808,9 +45808,9 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies. numDependencies : size_t @@ -45831,10 +45831,10 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -48422,7 +48422,7 @@ def cuSurfObjectGetResourceDesc(surfObject): {{if 'cuTensorMapEncodeTiled' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], boxDim : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], boxDim : Optional[tuple[cuuint32_t] | list[cuuint32_t]], elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing tiled memory region. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -48613,17 +48613,17 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor Dimensionality of tensor globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions - boxDim : List[:py:obj:`~.cuuint32_t`] + boxDim : list[:py:obj:`~.cuuint32_t`] Array containing traversal box size (number of elments) along each of the `tensorRank` dimensions. Specifies how many elements to be traversed along each tensor dimension. - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -48649,16 +48649,16 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") boxDim = [] if boxDim is None else boxDim if not all(isinstance(_x, (cuuint32_t,)) for _x in boxDim): - raise TypeError("Argument 'boxDim' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'boxDim' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -48733,7 +48733,7 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor {{if 'cuTensorMapEncodeIm2col' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], pixelBoxLowerCorner : Optional[Tuple[int] | List[int]], pixelBoxUpperCorner : Optional[Tuple[int] | List[int]], channelsPerPixel, pixelsPerColumn, elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], pixelBoxLowerCorner : Optional[tuple[int] | list[int]], pixelBoxUpperCorner : Optional[tuple[int] | list[int]], channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing im2col memory region. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -48947,21 +48947,21 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso Dimensionality of tensor; must be at least 3 globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions - pixelBoxLowerCorner : List[int] + pixelBoxLowerCorner : list[int] Array containing DHW dimensions of lower box corner - pixelBoxUpperCorner : List[int] + pixelBoxUpperCorner : list[int] Array containing DHW dimensions of upper box corner channelsPerPixel : Any Number of channels per pixel pixelsPerColumn : Any Number of pixels per column - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -48987,7 +48987,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") cdef cydriver.cuuint32_t cypixelsPerColumn if pixelsPerColumn is None: ppixelsPerColumn = 0 @@ -49006,16 +49006,16 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso cychannelsPerPixel = pchannelsPerPixel pixelBoxUpperCorner = [] if pixelBoxUpperCorner is None else pixelBoxUpperCorner if not all(isinstance(_x, (int)) for _x in pixelBoxUpperCorner): - raise TypeError("Argument 'pixelBoxUpperCorner' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'pixelBoxUpperCorner' is not instance of type (expected tuple[int] or list[int]") pixelBoxLowerCorner = [] if pixelBoxLowerCorner is None else pixelBoxLowerCorner if not all(isinstance(_x, (int)) for _x in pixelBoxLowerCorner): - raise TypeError("Argument 'pixelBoxLowerCorner' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'pixelBoxLowerCorner' is not instance of type (expected tuple[int] or list[int]") globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -49080,7 +49080,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -49279,10 +49279,10 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t Dimensionality of tensor; must be at least 3 globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions pixelBoxLowerCornerWidth : int @@ -49293,7 +49293,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t Number of channels per pixel pixelsPerColumn : Any Number of pixels per column - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -49321,7 +49321,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") cdef cydriver.cuuint32_t cypixelsPerColumn if pixelsPerColumn is None: ppixelsPerColumn = 0 @@ -49340,10 +49340,10 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t cychannelsPerPixel = pchannelsPerPixel globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -49690,7 +49690,7 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} @cython.embedsignature(True) -def cuDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[CUatomicOperation] | List[CUatomicOperation]], unsigned int count, srcDevice, dstDevice): +def cuDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[CUatomicOperation] | list[CUatomicOperation]], unsigned int count, srcDevice, dstDevice): """ Queries details about atomic operations supported between two devices. Returns in `*capabilities` the details about requested atomic @@ -49712,7 +49712,7 @@ def cuDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[CUatomicOperati Parameters ---------- - operations : List[:py:obj:`~.CUatomicOperation`] + operations : list[:py:obj:`~.CUatomicOperation`] Requested operations count : unsigned int Count of requested operations and size of capabilities @@ -49725,7 +49725,7 @@ def cuDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[CUatomicOperati ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - capabilities : List[unsigned int] + capabilities : list[unsigned int] Returned capability details of each requested operation See Also @@ -49750,7 +49750,7 @@ def cuDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[CUatomicOperati cysrcDevice = psrcDevice operations = [] if operations is None else operations if not all(isinstance(_x, (CUatomicOperation)) for _x in operations): - raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cydriver.CUatomicOperation] or List[cydriver.CUatomicOperation]") + raise TypeError("Argument 'operations' is not instance of type (expected tuple[cydriver.CUatomicOperation] or list[cydriver.CUatomicOperation]") cdef unsigned int* cycapabilities = NULL pycapabilities = [] if count != 0: @@ -51153,7 +51153,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION` - result : List[:py:obj:`~.CUdevResource`] + result : list[:py:obj:`~.CUdevResource`] Output array of `None` resources. Can be NULL to query the number of groups. nbGroups : unsigned int @@ -51192,7 +51192,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe {{if 'cuDevResourceGenerateDesc' in found_functions}} @cython.embedsignature(True) -def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[CUdevResource]], unsigned int nbResources): +def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[CUdevResource]], unsigned int nbResources): """ Generate a resource descriptor. Generates a single resource descriptor with the set of resources @@ -51217,7 +51217,7 @@ def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[C Parameters ---------- - resources : List[:py:obj:`~.CUdevResource`] + resources : list[:py:obj:`~.CUdevResource`] Array of resources to be included in the descriptor nbResources : unsigned int Number of resources passed in `resources` @@ -51235,7 +51235,7 @@ def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[C """ resources = [] if resources is None else resources if not all(isinstance(_x, (CUdevResource,)) for _x in resources): - raise TypeError("Argument 'resources' is not instance of type (expected Tuple[cydriver.CUdevResource,] or List[cydriver.CUdevResource,]") + raise TypeError("Argument 'resources' is not instance of type (expected tuple[cydriver.CUdevResource,] or list[cydriver.CUdevResource,]") cdef CUdevResourceDesc phDesc = CUdevResourceDesc() cdef cydriver.CUdevResource* cyresources = NULL if len(resources) > 1: @@ -52841,7 +52841,7 @@ def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDevic CUDA_ERROR_INVALID_GRAPHICS_CONTEXT pCudaDeviceCount : unsigned int Returned number of CUDA devices. - pCudaDevices : List[CUdevice] + pCudaDevices : list[CUdevice] Returned CUDA devices. See Also diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index e2e2fb361..5cac5a438 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 13.0.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -211,7 +211,7 @@ def nvrtcGetSupportedArchs(): nvrtcResult - :py:obj:`~.NVRTC_SUCCESS` - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` - supportedArchs : List[int] + supportedArchs : list[int] sorted array of supported architectures. """ cdef vector[int] supportedArchs @@ -228,7 +228,7 @@ def nvrtcGetSupportedArchs(): {{if 'nvrtcCreateProgram' in found_functions}} @cython.embedsignature(True) -def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional[Tuple[bytes] | List[bytes]], includeNames : Optional[Tuple[bytes] | List[bytes]]): +def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional[tuple[bytes] | list[bytes]], includeNames : Optional[tuple[bytes] | list[bytes]]): """ nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter `prog` with it. Parameters @@ -241,10 +241,10 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional numHeaders : int Number of headers used. `numHeaders` must be greater than or equal to 0. - headers : List[bytes] + headers : list[bytes] Sources of the headers. `headers` can be `NULL` when `numHeaders` is 0. - includeNames : List[bytes] + includeNames : list[bytes] Name of each header by which they can be included in the CUDA program source. `includeNames` can be `NULL` when `numHeaders` is 0. These headers must be included with the exact names specified @@ -267,10 +267,10 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional """ includeNames = [] if includeNames is None else includeNames if not all(isinstance(_x, (bytes)) for _x in includeNames): - raise TypeError("Argument 'includeNames' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'includeNames' is not instance of type (expected tuple[bytes] or list[bytes]") headers = [] if headers is None else headers if not all(isinstance(_x, (bytes)) for _x in headers): - raise TypeError("Argument 'headers' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'headers' is not instance of type (expected tuple[bytes] or list[bytes]") cdef nvrtcProgram prog = nvrtcProgram() if numHeaders > len(headers): raise RuntimeError("List is too small: " + str(len(headers)) + " < " + str(numHeaders)) if numHeaders > len(includeNames): raise RuntimeError("List is too small: " + str(len(includeNames)) + " < " + str(numHeaders)) @@ -322,7 +322,7 @@ def nvrtcDestroyProgram(prog): {{if 'nvrtcCompileProgram' in found_functions}} @cython.embedsignature(True) -def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | List[bytes]]): +def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | list[bytes]]): """ nvrtcCompileProgram compiles the given program. It supports compile options listed in :py:obj:`~.Supported Compile @@ -334,7 +334,7 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | CUDA Runtime Compilation program. numOptions : int Number of compiler options passed. - options : List[bytes] + options : list[bytes] Compiler options in the form of C string array. `options` can be `NULL` when `numOptions` is 0. @@ -353,7 +353,7 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | """ options = [] if options is None else options if not all(isinstance(_x, (bytes)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[bytes] or list[bytes]") cdef cynvrtc.nvrtcProgram cyprog if prog is None: pprog = 0 diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in index 05a7b8df5..bb5e0906f 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd.in +++ b/cuda_bindings/cuda/bindings/runtime.pxd.in @@ -429,7 +429,7 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail {{endif}} {{if 'cudaArraySparseProperties.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -461,7 +461,7 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. {{endif}} {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -648,7 +648,7 @@ cdef class cudaMemcpyNodeParams: Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} @@ -1042,7 +1042,7 @@ cdef class anon_struct5: Attributes ---------- {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -1175,7 +1175,7 @@ cdef class cudaResourceViewDesc: Last layer index {{endif}} {{if 'cudaResourceViewDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -1223,7 +1223,7 @@ cdef class cudaPointerAttributes: pointer if an invalid pointer has been passed to CUDA. {{endif}} {{if 'cudaPointerAttributes.reserved' in found_struct}} - reserved : List[long] + reserved : list[long] Must be zero {{endif}} @@ -1345,7 +1345,7 @@ cdef class cudaFuncAttributes: cudaFuncSetAttribute {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use. {{endif}} @@ -1910,11 +1910,11 @@ cdef class cudaDeviceProp: Maximum number of threads per block {{endif}} {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'cudaDeviceProp.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} @@ -1960,29 +1960,29 @@ cdef class cudaDeviceProp: Maximum 1D mipmapped texture size {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} - maxTexture2D : List[int] + maxTexture2D : list[int] Maximum 2D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} - maxTexture2DMipmap : List[int] + maxTexture2DMipmap : list[int] Maximum 2D mipmapped texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} - maxTexture2DLinear : List[int] + maxTexture2DLinear : list[int] Maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory {{endif}} {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} - maxTexture2DGather : List[int] + maxTexture2DGather : list[int] Maximum 2D texture dimensions if texture gather operations have to be performed {{endif}} {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} - maxTexture3D : List[int] + maxTexture3D : list[int] Maximum 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} - maxTexture3DAlt : List[int] + maxTexture3DAlt : list[int] Maximum alternate 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} @@ -1990,15 +1990,15 @@ cdef class cudaDeviceProp: Maximum Cubemap texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} - maxTexture1DLayered : List[int] + maxTexture1DLayered : list[int] Maximum 1D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} - maxTexture2DLayered : List[int] + maxTexture2DLayered : list[int] Maximum 2D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} - maxTextureCubemapLayered : List[int] + maxTextureCubemapLayered : list[int] Maximum Cubemap layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} @@ -2006,19 +2006,19 @@ cdef class cudaDeviceProp: Maximum 1D surface size {{endif}} {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} - maxSurface2D : List[int] + maxSurface2D : list[int] Maximum 2D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} - maxSurface3D : List[int] + maxSurface3D : list[int] Maximum 3D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} - maxSurface1DLayered : List[int] + maxSurface1DLayered : list[int] Maximum 1D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} - maxSurface2DLayered : List[int] + maxSurface2DLayered : list[int] Maximum 2D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} @@ -2026,7 +2026,7 @@ cdef class cudaDeviceProp: Maximum Cubemap surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} - maxSurfaceCubemapLayered : List[int] + maxSurfaceCubemapLayered : list[int] Maximum Cubemap layered surface dimensions {{endif}} {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} @@ -2259,7 +2259,7 @@ cdef class cudaDeviceProp: multi-node system. {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use {{endif}} @@ -2411,7 +2411,7 @@ cdef class cudaExternalMemoryHandleDesc: Flags must either be zero or cudaExternalMemoryDedicated {{endif}} {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -2447,7 +2447,7 @@ cdef class cudaExternalMemoryBufferDesc: Flags reserved for future use. Must be zero. {{endif}} {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -2490,7 +2490,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: Total number of levels in the mipmap chain {{endif}} {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -2580,7 +2580,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Flags reserved for the future. Must be zero. {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -2672,7 +2672,7 @@ cdef class anon_struct12: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2716,7 +2716,7 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2812,7 +2812,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2856,7 +2856,7 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3305,11 +3305,11 @@ cdef class cudaGraphNodeParams: Type of the node {{endif}} {{if 'cudaGraphNodeParams.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'cudaGraphNodeParams.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'cudaGraphNodeParams.kernel' in found_struct}} @@ -4044,7 +4044,7 @@ cdef class cudaTextureDesc: Attributes ---------- {{if 'cudaTextureDesc.addressMode' in found_struct}} - addressMode : List[cudaTextureAddressMode] + addressMode : list[cudaTextureAddressMode] Texture address mode for up to 3 dimensions {{endif}} {{if 'cudaTextureDesc.filterMode' in found_struct}} @@ -4060,7 +4060,7 @@ cdef class cudaTextureDesc: Perform sRGB->linear conversion during texture read {{endif}} {{if 'cudaTextureDesc.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Texture Border Color {{endif}} {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} @@ -4138,7 +4138,7 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -4160,11 +4160,11 @@ cdef class anon_union9: Attributes ---------- {{if True}} - pArray : List[cudaArray_t] + pArray : list[cudaArray_t] {{endif}} {{if True}} - pPitch : List[cudaPitchedPtr] + pPitch : list[cudaPitchedPtr] {{endif}} @@ -4195,7 +4195,7 @@ cdef class cudaEglFrame_st: {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} @@ -4787,7 +4787,7 @@ cdef class cudaEglPlaneDesc(cudaEglPlaneDesc_st): Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -4818,7 +4818,7 @@ cdef class cudaEglFrame(cudaEglFrame_st): {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index f17436058..dc7d4d1b1 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 13.0.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -6317,7 +6317,7 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail {{endif}} {{if 'cudaArraySparseProperties.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -6434,7 +6434,7 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. {{endif}} {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -7011,7 +7011,7 @@ cdef class cudaMemcpyNodeParams: Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} @@ -8233,7 +8233,7 @@ cdef class anon_struct5: Attributes ---------- {{if 'cudaResourceDesc.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -8539,7 +8539,7 @@ cdef class cudaResourceViewDesc: Last layer index {{endif}} {{if 'cudaResourceViewDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -8730,7 +8730,7 @@ cdef class cudaPointerAttributes: pointer if an invalid pointer has been passed to CUDA. {{endif}} {{if 'cudaPointerAttributes.reserved' in found_struct}} - reserved : List[long] + reserved : list[long] Must be zero {{endif}} @@ -8941,7 +8941,7 @@ cdef class cudaFuncAttributes: cudaFuncSetAttribute {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use. {{endif}} @@ -10688,11 +10688,11 @@ cdef class cudaDeviceProp: Maximum number of threads per block {{endif}} {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'cudaDeviceProp.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'cudaDeviceProp.totalConstMem' in found_struct}} @@ -10738,29 +10738,29 @@ cdef class cudaDeviceProp: Maximum 1D mipmapped texture size {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} - maxTexture2D : List[int] + maxTexture2D : list[int] Maximum 2D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} - maxTexture2DMipmap : List[int] + maxTexture2DMipmap : list[int] Maximum 2D mipmapped texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} - maxTexture2DLinear : List[int] + maxTexture2DLinear : list[int] Maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory {{endif}} {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} - maxTexture2DGather : List[int] + maxTexture2DGather : list[int] Maximum 2D texture dimensions if texture gather operations have to be performed {{endif}} {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} - maxTexture3D : List[int] + maxTexture3D : list[int] Maximum 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} - maxTexture3DAlt : List[int] + maxTexture3DAlt : list[int] Maximum alternate 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} @@ -10768,15 +10768,15 @@ cdef class cudaDeviceProp: Maximum Cubemap texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} - maxTexture1DLayered : List[int] + maxTexture1DLayered : list[int] Maximum 1D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} - maxTexture2DLayered : List[int] + maxTexture2DLayered : list[int] Maximum 2D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} - maxTextureCubemapLayered : List[int] + maxTextureCubemapLayered : list[int] Maximum Cubemap layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} @@ -10784,19 +10784,19 @@ cdef class cudaDeviceProp: Maximum 1D surface size {{endif}} {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} - maxSurface2D : List[int] + maxSurface2D : list[int] Maximum 2D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} - maxSurface3D : List[int] + maxSurface3D : list[int] Maximum 3D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} - maxSurface1DLayered : List[int] + maxSurface1DLayered : list[int] Maximum 1D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} - maxSurface2DLayered : List[int] + maxSurface2DLayered : list[int] Maximum 2D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} @@ -10804,7 +10804,7 @@ cdef class cudaDeviceProp: Maximum Cubemap surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} - maxSurfaceCubemapLayered : List[int] + maxSurfaceCubemapLayered : list[int] Maximum Cubemap layered surface dimensions {{endif}} {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} @@ -11037,7 +11037,7 @@ cdef class cudaDeviceProp: multi-node system. {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use {{endif}} @@ -12739,7 +12739,7 @@ cdef class cudaExternalMemoryHandleDesc: Flags must either be zero or cudaExternalMemoryDedicated {{endif}} {{if 'cudaExternalMemoryHandleDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -12864,7 +12864,7 @@ cdef class cudaExternalMemoryBufferDesc: Flags reserved for future use. Must be zero. {{endif}} {{if 'cudaExternalMemoryBufferDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -12978,7 +12978,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: Total number of levels in the mipmap chain {{endif}} {{if 'cudaExternalMemoryMipmappedArrayDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -13268,7 +13268,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Flags reserved for the future. Must be zero. {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Must be zero {{endif}} @@ -13534,7 +13534,7 @@ cdef class anon_struct12: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13648,7 +13648,7 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13914,7 +13914,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -14028,7 +14028,7 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -15358,11 +15358,11 @@ cdef class cudaGraphNodeParams: Type of the node {{endif}} {{if 'cudaGraphNodeParams.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'cudaGraphNodeParams.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'cudaGraphNodeParams.kernel' in found_struct}} @@ -17491,7 +17491,7 @@ cdef class cudaTextureDesc: Attributes ---------- {{if 'cudaTextureDesc.addressMode' in found_struct}} - addressMode : List[cudaTextureAddressMode] + addressMode : list[cudaTextureAddressMode] Texture address mode for up to 3 dimensions {{endif}} {{if 'cudaTextureDesc.filterMode' in found_struct}} @@ -17507,7 +17507,7 @@ cdef class cudaTextureDesc: Perform sRGB->linear conversion during texture read {{endif}} {{if 'cudaTextureDesc.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Texture Border Color {{endif}} {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} @@ -17788,7 +17788,7 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -17923,11 +17923,11 @@ cdef class anon_union9: Attributes ---------- {{if True}} - pArray : List[cudaArray_t] + pArray : list[cudaArray_t] {{endif}} {{if True}} - pPitch : List[cudaPitchedPtr] + pPitch : list[cudaPitchedPtr] {{endif}} @@ -17968,7 +17968,7 @@ cdef class anon_union9: def pArray(self): return [cudaArray_t(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : List[cudaArray_t]): + def pArray(self, pArray : list[cudaArray_t]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] @@ -17984,7 +17984,7 @@ cdef class anon_union9: string.memcpy(out_pPitch[_idx].getPtr(), &self._pvt_ptr[0].frame.pPitch[_idx], sizeof(cyruntime.cudaPitchedPtr)) return out_pPitch @pPitch.setter - def pPitch(self, pPitch : List[cudaPitchedPtr]): + def pPitch(self, pPitch : list[cudaPitchedPtr]): if len(pPitch) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) for _idx in range(len(pPitch)): @@ -18012,7 +18012,7 @@ cdef class cudaEglFrame_st: {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} @@ -18101,7 +18101,7 @@ cdef class cudaEglFrame_st: string.memcpy(out_planeDesc[_idx].getPtr(), &self._pvt_ptr[0].planeDesc[_idx], sizeof(cyruntime.cudaEglPlaneDesc)) return out_planeDesc @planeDesc.setter - def planeDesc(self, planeDesc : List[cudaEglPlaneDesc]): + def planeDesc(self, planeDesc : list[cudaEglPlaneDesc]): if len(planeDesc) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(planeDesc)) for _idx in range(len(planeDesc)): @@ -19724,7 +19724,7 @@ def cudaDeviceGetAttribute(attr not None : cudaDeviceAttr, int device): {{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} @cython.embedsignature(True) -def cudaDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOperation] | List[cudaAtomicOperation]], unsigned int count, int device): +def cudaDeviceGetHostAtomicCapabilities(operations : Optional[tuple[cudaAtomicOperation] | list[cudaAtomicOperation]], unsigned int count, int device): """ Queries details about atomic operations supported between the device and host. Returns in `*capabilities` the details about requested atomic @@ -19744,7 +19744,7 @@ def cudaDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOp Parameters ---------- - operations : List[:py:obj:`~.cudaAtomicOperation`] + operations : list[:py:obj:`~.cudaAtomicOperation`] Requested operations count : unsigned int Count of requested operations and size of capabilities @@ -19755,7 +19755,7 @@ def cudaDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOp ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` - capabilities : List[unsigned int] + capabilities : list[unsigned int] Returned capability details of each requested operation See Also @@ -19764,7 +19764,7 @@ def cudaDeviceGetHostAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOp """ operations = [] if operations is None else operations if not all(isinstance(_x, (cudaAtomicOperation)) for _x in operations): - raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cyruntime.cudaAtomicOperation] or List[cyruntime.cudaAtomicOperation]") + raise TypeError("Argument 'operations' is not instance of type (expected tuple[cyruntime.cudaAtomicOperation] or list[cyruntime.cudaAtomicOperation]") cdef unsigned int* cycapabilities = NULL pycapabilities = [] if count != 0: @@ -20053,7 +20053,7 @@ def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, {{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} @cython.embedsignature(True) -def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOperation] | List[cudaAtomicOperation]], unsigned int count, int srcDevice, int dstDevice): +def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[cudaAtomicOperation] | list[cudaAtomicOperation]], unsigned int count, int srcDevice, int dstDevice): """ Queries details about atomic operations supported between two devices. Returns in `*capabilities` the details about requested atomic @@ -20075,7 +20075,7 @@ def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOpe Parameters ---------- - operations : List[:py:obj:`~.cudaAtomicOperation`] + operations : list[:py:obj:`~.cudaAtomicOperation`] Requested operations count : unsigned int Count of requested operations and size of capabilities @@ -20088,7 +20088,7 @@ def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOpe ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` - capabilities : List[unsigned int] + capabilities : list[unsigned int] Returned capability details of each requested operation See Also @@ -20097,7 +20097,7 @@ def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[Tuple[cudaAtomicOpe """ operations = [] if operations is None else operations if not all(isinstance(_x, (cudaAtomicOperation)) for _x in operations): - raise TypeError("Argument 'operations' is not instance of type (expected Tuple[cyruntime.cudaAtomicOperation] or List[cyruntime.cudaAtomicOperation]") + raise TypeError("Argument 'operations' is not instance of type (expected tuple[cyruntime.cudaAtomicOperation] or list[cyruntime.cudaAtomicOperation]") cdef unsigned int* cycapabilities = NULL pycapabilities = [] if count != 0: @@ -21354,7 +21354,7 @@ def cudaStreamBeginCapture(stream, mode not None : cudaStreamCaptureMode): {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} @cython.embedsignature(True) -def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, mode not None : cudaStreamCaptureMode): +def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, mode not None : cudaStreamCaptureMode): """ Begins graph capture on a stream to an existing graph. Begin graph capture on `stream`. When a stream is in capture mode, all @@ -21379,10 +21379,10 @@ def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[c Stream in which to initiate capture. graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to capture into. - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0. - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t Number of dependencies. @@ -21406,10 +21406,10 @@ def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[c """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -21689,7 +21689,7 @@ def cudaStreamGetCaptureInfo(stream): are or become unreachable from the original stream at :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. - dependencies_out : List[:py:obj:`~.cudaGraphNode_t`] + dependencies_out : list[:py:obj:`~.cudaGraphNode_t`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -21698,7 +21698,7 @@ def cudaStreamGetCaptureInfo(stream): be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying. - edgeData_out : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData_out : list[:py:obj:`~.cudaGraphEdgeData`] Optional location to store a pointer to an array of graph edge data. This array parallels `dependencies_out`; the next node to be added has an edge to `dependencies_out`[i] with annotation @@ -21743,7 +21743,7 @@ def cudaStreamGetCaptureInfo(stream): {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} @cython.embedsignature(True) -def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): +def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream. Modifies the dependency set of a capturing stream. The dependency set @@ -21767,9 +21767,9 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cu ---------- stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] The set of dependencies to add - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t The size of the dependencies array @@ -21787,10 +21787,10 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cu """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaStream_t cystream if stream is None: pstream = 0 @@ -22721,7 +22721,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa {{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreSignalParams] | List[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): +def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreSignalParams] | list[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): """ Signals a set of external semaphore objects. Enqueues a signal operation on a set of externally allocated semaphore @@ -22812,9 +22812,9 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS Parameters ---------- - extSemArray : List[:py:obj:`~.cudaExternalSemaphore_t`] + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] Set of external semaphores to be signaled - paramsArray : List[:py:obj:`~.cudaExternalSemaphoreSignalParams`] + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreSignalParams`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to signal @@ -22840,10 +22840,10 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (cudaExternalSemaphoreSignalParams,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphoreSignalParams,] or List[cyruntime.cudaExternalSemaphoreSignalParams,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreSignalParams,] or list[cyruntime.cudaExternalSemaphoreSignalParams,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphore_t,] or List[cyruntime.cudaExternalSemaphore_t,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) @@ -22877,7 +22877,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS {{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreWaitParams] | List[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): +def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreWaitParams] | list[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): """ Waits on a set of external semaphore objects. Enqueues a wait operation on a set of externally allocated semaphore @@ -22941,9 +22941,9 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSem Parameters ---------- - extSemArray : List[:py:obj:`~.cudaExternalSemaphore_t`] + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] External semaphores to be waited on - paramsArray : List[:py:obj:`~.cudaExternalSemaphoreWaitParams`] + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreWaitParams`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to wait on @@ -22969,10 +22969,10 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSem cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (cudaExternalSemaphoreWaitParams,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphoreWaitParams,] or List[cyruntime.cudaExternalSemaphoreWaitParams,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreWaitParams,] or list[cyruntime.cudaExternalSemaphoreWaitParams,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphore_t,] or List[cyruntime.cudaExternalSemaphore_t,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) @@ -25859,7 +25859,7 @@ def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, st {{if 'cudaMemcpyBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, attrs : Optional[Tuple[cudaMemcpyAttributes] | List[cudaMemcpyAttributes]], attrsIdxs : Tuple[int] | List[int], size_t numAttrs, stream): +def cudaMemcpyBatchAsync(dsts : Optional[tuple[Any] | list[Any]], srcs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, attrs : Optional[tuple[cudaMemcpyAttributes] | list[cudaMemcpyAttributes]], attrsIdxs : tuple[int] | list[int], size_t numAttrs, stream): """ Performs a batch of memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -25933,17 +25933,17 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona Parameters ---------- - dsts : List[Any] + dsts : list[Any] Array of destination pointers. - srcs : List[Any] + srcs : list[Any] Array of memcpy source pointers. - sizes : List[int] + sizes : list[int] Array of sizes for memcpy operations. count : size_t Size of `dsts`, `srcs` and `sizes` arrays - attrs : List[:py:obj:`~.cudaMemcpyAttributes`] + attrs : list[:py:obj:`~.cudaMemcpyAttributes`] Array of memcpy attributes. - attrsIdxs : List[int] + attrsIdxs : list[int] Array of indices to specify which copies each entry in the `attrs` array applies to. The attributes specified in attrs[k] will be applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] @@ -25969,12 +25969,12 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona pstream = int(cudaStream_t(stream)) cystream = pstream if not all(isinstance(_x, (int)) for _x in attrsIdxs): - raise TypeError("Argument 'attrsIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") attrs = [] if attrs is None else attrs if not all(isinstance(_x, (cudaMemcpyAttributes,)) for _x in attrs): - raise TypeError("Argument 'attrs' is not instance of type (expected Tuple[cyruntime.cudaMemcpyAttributes,] or List[cyruntime.cudaMemcpyAttributes,]") + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cyruntime.cudaMemcpyAttributes,] or list[cyruntime.cudaMemcpyAttributes,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") srcs = [] if srcs is None else srcs dsts = [] if dsts is None else dsts pylist = [_HelperInputVoidPtr(pydsts) for pydsts in dsts] @@ -26009,7 +26009,7 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona {{if 'cudaMemcpy3DBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBatchOp] | List[cudaMemcpy3DBatchOp]], unsigned long long flags, stream): +def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBatchOp] | list[cudaMemcpy3DBatchOp]], unsigned long long flags, stream): """ Performs a batch of 3D memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -26095,7 +26095,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa ---------- numOps : size_t Total number of memcpy operations. - opList : List[:py:obj:`~.cudaMemcpy3DBatchOp`] + opList : list[:py:obj:`~.cudaMemcpy3DBatchOp`] Array of size `numOps` containing the actual memcpy operations. flags : unsigned long long Flags for future use, must be zero now. @@ -26118,7 +26118,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa cystream = pstream opList = [] if opList is None else opList if not all(isinstance(_x, (cudaMemcpy3DBatchOp,)) for _x in opList): - raise TypeError("Argument 'opList' is not instance of type (expected Tuple[cyruntime.cudaMemcpy3DBatchOp,] or List[cyruntime.cudaMemcpy3DBatchOp,]") + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cyruntime.cudaMemcpy3DBatchOp,] or list[cyruntime.cudaMemcpy3DBatchOp,]") if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) cdef cyruntime.cudaMemcpy3DBatchOp* cyopList = NULL if len(opList) > 1: @@ -26830,7 +26830,7 @@ def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocati {{if 'cudaMemPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[cudaMemLocation] | List[cudaMemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, stream): +def cudaMemPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, prefetchLocs : Optional[tuple[cudaMemLocation] | list[cudaMemLocation]], prefetchLocIdxs : tuple[int] | list[int], size_t numPrefetchLocs, unsigned long long flags, stream): """ Performs a batch of memory prefetches asynchronously. Performs a batch of memory prefetches. The batch as a whole executes in @@ -26867,15 +26867,15 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Parameters ---------- - dptrs : List[Any] + dptrs : list[Any] Array of pointers to be prefetched - sizes : List[int] + sizes : list[int] Array of sizes for memory prefetch operations. count : size_t Size of `dptrs` and `sizes` arrays. - prefetchLocs : List[:py:obj:`~.cudaMemLocation`] + prefetchLocs : list[:py:obj:`~.cudaMemLocation`] Array of locations to prefetch to. - prefetchLocIdxs : List[int] + prefetchLocIdxs : list[int] Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs[k] will be applied to copies starting from @@ -26904,12 +26904,12 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : pstream = int(cudaStream_t(stream)) cystream = pstream if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): - raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected tuple[int] or list[int]") prefetchLocs = [] if prefetchLocs is None else prefetchLocs if not all(isinstance(_x, (cudaMemLocation,)) for _x in prefetchLocs): - raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cyruntime.cudaMemLocation,] or List[cyruntime.cudaMemLocation,]") + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected tuple[cyruntime.cudaMemLocation,] or list[cyruntime.cudaMemLocation,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) @@ -26939,7 +26939,7 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : {{if 'cudaMemDiscardBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, unsigned long long flags, stream): +def cudaMemDiscardBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, unsigned long long flags, stream): """ Performs a batch of memory discards asynchronously. Performs a batch of memory discards. The batch as a whole executes in @@ -26971,9 +26971,9 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : T Parameters ---------- - dptrs : List[Any] + dptrs : list[Any] Array of pointers to be discarded - sizes : List[int] + sizes : list[int] Array of sizes for memory discard operations. count : size_t Size of `dptrs` and `sizes` arrays. @@ -26997,7 +26997,7 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : T pstream = int(cudaStream_t(stream)) cystream = pstream if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) @@ -27013,7 +27013,7 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : T {{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, prefetchLocs : Optional[Tuple[cudaMemLocation] | List[cudaMemLocation]], prefetchLocIdxs : Tuple[int] | List[int], size_t numPrefetchLocs, unsigned long long flags, stream): +def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, prefetchLocs : Optional[tuple[cudaMemLocation] | list[cudaMemLocation]], prefetchLocIdxs : tuple[int] | list[int], size_t numPrefetchLocs, unsigned long long flags, stream): """ Performs a batch of memory discards and prefetches asynchronously. Performs a batch of memory discards followed by prefetches. The batch @@ -27058,15 +27058,15 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]] Parameters ---------- - dptrs : List[Any] + dptrs : list[Any] Array of pointers to be discarded - sizes : List[int] + sizes : list[int] Array of sizes for memory discard operations. count : size_t Size of `dptrs` and `sizes` arrays. - prefetchLocs : List[:py:obj:`~.cudaMemLocation`] + prefetchLocs : list[:py:obj:`~.cudaMemLocation`] Array of locations to prefetch to. - prefetchLocIdxs : List[int] + prefetchLocIdxs : list[int] Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs[k] will be applied to operations starting from @@ -27095,12 +27095,12 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[Tuple[Any] | List[Any]] pstream = int(cudaStream_t(stream)) cystream = pstream if not all(isinstance(_x, (int)) for _x in prefetchLocIdxs): - raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'prefetchLocIdxs' is not instance of type (expected tuple[int] or list[int]") prefetchLocs = [] if prefetchLocs is None else prefetchLocs if not all(isinstance(_x, (cudaMemLocation,)) for _x in prefetchLocs): - raise TypeError("Argument 'prefetchLocs' is not instance of type (expected Tuple[cyruntime.cudaMemLocation,] or List[cyruntime.cudaMemLocation,]") + raise TypeError("Argument 'prefetchLocs' is not instance of type (expected tuple[cyruntime.cudaMemLocation,] or list[cyruntime.cudaMemLocation,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") dptrs = [] if dptrs is None else dptrs pylist = [_HelperInputVoidPtr(pydptrs) for pydptrs in dptrs] cdef _InputVoidPtrPtrHelper voidStarHelperdptrs = _InputVoidPtrPtrHelper(pylist) @@ -27477,7 +27477,7 @@ def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeA {{if 'cudaMemRangeGetAttributes' in found_functions}} @cython.embedsignature(True) -def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Optional[Tuple[cudaMemRangeAttribute] | List[cudaMemRangeAttribute]], size_t numAttributes, devPtr, size_t count): +def cudaMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Optional[tuple[cudaMemRangeAttribute] | list[cudaMemRangeAttribute]], size_t numAttributes, devPtr, size_t count): """ Query attributes of a given memory range. Query attributes of the memory range starting at `devPtr` with a size @@ -27510,9 +27510,9 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O Parameters ---------- - dataSizes : List[int] + dataSizes : list[int] Array containing the sizes of each result - attributes : List[:py:obj:`~.cudaMemRangeAttribute`] + attributes : list[:py:obj:`~.cudaMemRangeAttribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) numAttributes : size_t @@ -27526,7 +27526,7 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -27536,9 +27536,9 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O """ attributes = [] if attributes is None else attributes if not all(isinstance(_x, (cudaMemRangeAttribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cyruntime.cudaMemRangeAttribute] or List[cyruntime.cudaMemRangeAttribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cyruntime.cudaMemRangeAttribute] or list[cyruntime.cudaMemRangeAttribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): - raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr @@ -28209,14 +28209,14 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): {{if 'cudaMemPoolSetAccess' in found_functions}} @cython.embedsignature(True) -def cudaMemPoolSetAccess(memPool, descList : Optional[Tuple[cudaMemAccessDesc] | List[cudaMemAccessDesc]], size_t count): +def cudaMemPoolSetAccess(memPool, descList : Optional[tuple[cudaMemAccessDesc] | list[cudaMemAccessDesc]], size_t count): """ Controls visibility of pools between devices. Parameters ---------- pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` The pool being modified - map : List[:py:obj:`~.cudaMemAccessDesc`] + map : list[:py:obj:`~.cudaMemAccessDesc`] Array of access descriptors. Each descriptor instructs the access to enable for a single gpu count : size_t @@ -28233,7 +28233,7 @@ def cudaMemPoolSetAccess(memPool, descList : Optional[Tuple[cudaMemAccessDesc] | """ descList = [] if descList is None else descList if not all(isinstance(_x, (cudaMemAccessDesc,)) for _x in descList): - raise TypeError("Argument 'descList' is not instance of type (expected Tuple[cyruntime.cudaMemAccessDesc,] or List[cyruntime.cudaMemAccessDesc,]") + raise TypeError("Argument 'descList' is not instance of type (expected tuple[cyruntime.cudaMemAccessDesc,] or list[cyruntime.cudaMemAccessDesc,]") cdef cyruntime.cudaMemPool_t cymemPool if memPool is None: pmemPool = 0 @@ -30317,7 +30317,7 @@ def cudaGraphCreate(unsigned int flags): {{if 'cudaGraphAddKernelNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaKernelNodeParams]): +def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaKernelNodeParams]): """ Creates a kernel execution node and adds it to a graph. Creates a new kernel execution node and adds it to `graph` with @@ -30381,7 +30381,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30405,7 +30405,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30659,7 +30659,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, {{if 'cudaGraphAddMemcpyNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pCopyParams : Optional[cudaMemcpy3DParms]): +def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pCopyParams : Optional[cudaMemcpy3DParms]): """ Creates a memcpy node and adds it to a graph. Creates a new memcpy node and adds it to `graph` with `numDependencies` @@ -30681,7 +30681,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30701,7 +30701,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30735,7 +30735,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t {{if 'cudaGraphAddMemcpyNode1D' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, dst, src, size_t count, kind not None : cudaMemcpyKind): +def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dst, src, size_t count, kind not None : cudaMemcpyKind): """ Creates a 1D memcpy node and adds it to a graph. Creates a new 1D memcpy node and adds it to `graph` with @@ -30767,7 +30767,7 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30793,7 +30793,7 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30970,7 +30970,7 @@ def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : {{if 'cudaGraphAddMemsetNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pMemsetParams : Optional[cudaMemsetParams]): +def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pMemsetParams : Optional[cudaMemsetParams]): """ Creates a memset node and adds it to a graph. Creates a new memset node and adds it to `graph` with `numDependencies` @@ -30986,7 +30986,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31006,7 +31006,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31118,7 +31118,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) {{if 'cudaGraphAddHostNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaHostNodeParams]): +def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaHostNodeParams]): """ Creates a host execution node and adds it to a graph. Creates a new CPU execution node and adds it to `graph` with @@ -31135,7 +31135,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31155,7 +31155,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31267,7 +31267,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) {{if 'cudaGraphAddChildGraphNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, childGraph): +def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, childGraph): """ Creates a child graph node and adds it to a graph. Creates a new node which executes an embedded graph, and adds it to @@ -31287,7 +31287,7 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNo ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31315,7 +31315,7 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNo cychildGraph = pchildGraph pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31393,7 +31393,7 @@ def cudaGraphChildGraphNodeGetGraph(node): {{if 'cudaGraphAddEmptyNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphAddEmptyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): """ Creates an empty node and adds it to a graph. Creates a new node which performs no operation, and adds it to `graph` @@ -31413,7 +31413,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31431,7 +31431,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31464,7 +31464,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] {{if 'cudaGraphAddEventRecordNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, event): +def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): """ Creates an event record node and adds it to a graph. Creates a new event record node and adds it to `hGraph` with @@ -31483,7 +31483,7 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphN ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31511,7 +31511,7 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphN cyevent = pevent pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31629,7 +31629,7 @@ def cudaGraphEventRecordNodeSetEvent(node, event): {{if 'cudaGraphAddEventWaitNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, event): +def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): """ Creates an event wait node and adds it to a graph. Creates a new event wait node and adds it to `hGraph` with @@ -31651,7 +31651,7 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNod ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31679,7 +31679,7 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNod cyevent = pevent pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31797,7 +31797,7 @@ def cudaGraphEventWaitNodeSetEvent(node, event): {{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): +def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): """ Creates an external semaphore signal node and adds it to a graph. Creates a new external semaphore signal node and adds it to `graph` @@ -31815,7 +31815,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tup ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31835,7 +31835,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tup """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31954,7 +31954,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ {{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): +def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): """ Creates an external semaphore wait node and adds it to a graph. Creates a new external semaphore wait node and adds it to `graph` with @@ -31972,7 +31972,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31992,7 +31992,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -32111,7 +32111,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu {{if 'cudaGraphAddMemAllocNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaMemAllocNodeParams]): +def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaMemAllocNodeParams]): """ Creates an allocation node and adds it to a graph. Creates a new allocation node and adds it to `graph` with @@ -32168,7 +32168,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -32188,7 +32188,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -32265,7 +32265,7 @@ def cudaGraphMemAllocNodeGetParams(node): {{if 'cudaGraphAddMemFreeNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, dptr): +def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dptr): """ Creates a memory free node and adds it to a graph. Creates a new memory free node and adds it to `graph` with @@ -32300,7 +32300,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -32320,7 +32320,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -32686,7 +32686,7 @@ def cudaGraphGetNodes(graph, size_t numNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - nodes : List[:py:obj:`~.cudaGraphNode_t`] + nodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the nodes numNodes : int See description @@ -32745,7 +32745,7 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pRootNodes : List[:py:obj:`~.cudaGraphNode_t`] + pRootNodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the root nodes pNumRootNodes : int See description @@ -32811,11 +32811,11 @@ def cudaGraphGetEdges(graph, size_t numEdges = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional location to return edge data numEdges : int See description @@ -32900,9 +32900,9 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependencies - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array to return edge data for each dependency pNumDependencies : int See description @@ -32977,9 +32977,9 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - pDependentNodes : List[:py:obj:`~.cudaGraphNode_t`] + pDependentNodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional pointer to return edge data for dependent nodes pNumDependentNodes : int See description @@ -33027,7 +33027,7 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): {{if 'cudaGraphAddDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): +def cudaGraphAddDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` @@ -33041,11 +33041,11 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of edge data. If NULL, default (zeroed) edge data is assumed. numDependencies : size_t @@ -33062,13 +33062,13 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -33120,7 +33120,7 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li {{if 'cudaGraphRemoveDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): +def cudaGraphRemoveDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): """ Removes dependency edges from a graph. The number of `pDependencies` to be removed is defined by @@ -33137,11 +33137,11 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of edge data. If NULL, edge data is assumed to be default (zeroed). numDependencies : size_t @@ -33158,13 +33158,13 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -35083,7 +35083,7 @@ def cudaGraphReleaseUserObject(graph, object, unsigned int count): {{if 'cudaGraphAddNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): +def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): """ Adds a node of arbitrary type to a graph. Creates a new node in `graph` described by `nodeParams` with @@ -35109,9 +35109,9 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies. numDependencies : size_t @@ -35132,10 +35132,10 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -35547,7 +35547,7 @@ def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, uns {{if 'cudaLibraryLoadData' in found_functions}} @cython.embedsignature(True) -def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[cudaJitOption]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[cudaLibraryOption] | List[cudaLibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cudaLibraryLoadData(code, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified code and options. Takes a pointer `code` and loads the corresponding library `library` @@ -35589,15 +35589,15 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ ---------- code : Any Code to load - jitOptions : List[:py:obj:`~.cudaJitOption`] + jitOptions : list[:py:obj:`~.cudaJitOption`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.cudaLibraryOption`] + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -35616,11 +35616,11 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cyruntime.cudaLibraryOption] or List[cyruntime.cudaLibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr @@ -35646,7 +35646,7 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ {{if 'cudaLibraryLoadFromFile' in found_functions}} @cython.embedsignature(True) -def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitOption] | List[cudaJitOption]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[cudaLibraryOption] | List[cudaLibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified file and options. Takes a pointer `code` and loads the corresponding library `library` @@ -35688,15 +35688,15 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitO ---------- fileName : bytes File to load from - jitOptions : List[:py:obj:`~.cudaJitOption`] + jitOptions : list[:py:obj:`~.cudaJitOption`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.cudaLibraryOption`] + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -35715,11 +35715,11 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitO libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cyruntime.cudaLibraryOption] or List[cyruntime.cudaLibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() cdef vector[cyruntime.cudaJitOption] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] @@ -36032,7 +36032,7 @@ def cudaLibraryEnumerateKernels(unsigned int numKernels, lib): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` - kernels : List[:py:obj:`~.cudaKernel_t`] + kernels : list[:py:obj:`~.cudaKernel_t`] Buffer where the kernel handles are returned to See Also @@ -37084,7 +37084,7 @@ def cudaGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : cudaGLD pCudaDeviceCount : unsigned int Returned number of CUDA devices corresponding to the current OpenGL context - pCudaDevices : List[int] + pCudaDevices : list[int] Returned CUDA devices corresponding to the current OpenGL context See Also diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 2637f0b0e..6af49d1ef 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -84,7 +84,6 @@ select = [ ] ignore = [ - "UP006", "UP007", "E741", # ambiguous variable name such as I "B007", # rename unsued loop variable to _name diff --git a/cuda_core/cuda/core/experimental/_linker.py b/cuda_core/cuda/core/experimental/_linker.py index bda91fb46..2c35efd1b 100644 --- a/cuda_core/cuda/core/experimental/_linker.py +++ b/cuda_core/cuda/core/experimental/_linker.py @@ -8,7 +8,7 @@ import weakref from contextlib import contextmanager from dataclasses import dataclass -from typing import TYPE_CHECKING, List, Tuple, Union +from typing import TYPE_CHECKING, Union from warnings import warn if TYPE_CHECKING: @@ -140,14 +140,14 @@ class LinkerOptions: fma : bool, optional Use fast multiply-add. Default: True. - kernels_used : [Union[str, Tuple[str], List[str]]], optional + kernels_used : [Union[str, tuple[str], list[str]]], optional Pass a kernel or sequence of kernels that are used; any not in the list can be removed. - variables_used : [Union[str, Tuple[str], List[str]]], optional + variables_used : [Union[str, tuple[str], list[str]]], optional Pass a variable or sequence of variables that are used; any not in the list can be removed. optimize_unused_variables : bool, optional Assume that if a variable is not referenced in device code, it can be removed. Default: False. - ptxas_options : [Union[str, Tuple[str], List[str]]], optional + ptxas_options : [Union[str, tuple[str], list[str]]], optional Pass options to PTXAS. split_compile : int, optional Split compilation maximum thread count. Use 0 to use all available processors. Value of 1 disables split @@ -177,10 +177,10 @@ class LinkerOptions: prec_div: bool | None = None prec_sqrt: bool | None = None fma: bool | None = None - kernels_used: Union[str, Tuple[str], List[str]] | None = None - variables_used: Union[str, Tuple[str], List[str]] | None = None + kernels_used: Union[str, tuple[str], list[str]] | None = None + variables_used: Union[str, tuple[str], list[str]] | None = None optimize_unused_variables: bool | None = None - ptxas_options: Union[str, Tuple[str], List[str]] | None = None + ptxas_options: Union[str, tuple[str], list[str]] | None = None split_compile: int | None = None split_compile_extended: int | None = None no_cache: bool | None = None diff --git a/cuda_core/cuda/core/experimental/_memory.pyx b/cuda_core/cuda/core/experimental/_memory.pyx index 3eb80875e..44e7a77c7 100644 --- a/cuda_core/cuda/core/experimental/_memory.pyx +++ b/cuda_core/cuda/core/experimental/_memory.pyx @@ -11,7 +11,7 @@ from cuda.core.experimental._utils.cuda_utils cimport ( ) import abc -from typing import Tuple, TypeVar, Union +from typing import TypeVar, Union from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule from cuda.core.experimental._stream import Stream, default_stream @@ -183,8 +183,8 @@ cdef class Buffer: self, *, stream: int | None = None, - max_version: Tuple[int, int] | None = None, - dl_device: Tuple[int, int] | None = None, + max_version: tuple[int, int] | None = None, + dl_device: tuple[int, int] | None = None, copy: bool | None = None, ) -> PyCapsule: # Note: we ignore the stream argument entirely (as if it is -1). @@ -197,12 +197,12 @@ cdef class Buffer: versioned = False else: if not isinstance(max_version, tuple) or len(max_version) != 2: - raise BufferError(f"Expected max_version Tuple[int, int], got {max_version}") + raise BufferError(f"Expected max_version tuple[int, int], got {max_version}") versioned = max_version >= (1, 0) capsule = make_py_capsule(self, versioned) return capsule - def __dlpack_device__(self) -> Tuple[int, int]: + def __dlpack_device__(self) -> tuple[int, int]: cdef bint d = self.is_device_accessible cdef bint h = self.is_host_accessible if d and (not h): diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index fbba1db92..d8b875bce 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -6,7 +6,7 @@ import weakref from dataclasses import dataclass -from typing import TYPE_CHECKING, List, Tuple, Union +from typing import TYPE_CHECKING, Union from warnings import warn if TYPE_CHECKING: @@ -33,14 +33,14 @@ def _process_define_macro_inner(formatted_options, macro): return True if isinstance(macro, tuple): if len(macro) != 2 or any(not isinstance(val, str) for val in macro): - raise RuntimeError(f"Expected define_macro Tuple[str, str], got {macro}") + raise RuntimeError(f"Expected define_macro tuple[str, str], got {macro}") formatted_options.append(f"--define-macro={macro[0]}={macro[1]}") return True return False def _process_define_macro(formatted_options, macro): - union_type = "Union[str, Tuple[str, str]]" + union_type = "Union[str, tuple[str, str]]" if _process_define_macro_inner(formatted_options, macro): return if is_nested_sequence(macro): @@ -48,7 +48,7 @@ def _process_define_macro(formatted_options, macro): if not _process_define_macro_inner(formatted_options, seq_macro): raise RuntimeError(f"Expected define_macro {union_type}, got {seq_macro}") return - raise RuntimeError(f"Expected define_macro {union_type}, List[{union_type}], got {macro}") + raise RuntimeError(f"Expected define_macro {union_type}, list[{union_type}], got {macro}") @dataclass @@ -79,7 +79,7 @@ class ProgramOptions: Enable device code optimization. When specified along with ‘-G’, enables limited debug information generation for optimized device code. Default: None - ptxas_options : Union[str, List[str]], optional + ptxas_options : Union[str, list[str]], optional Specify one or more options directly to ptxas, the PTX optimizing assembler. Options should be strings. For example ["-v", "-O2"]. Default: None @@ -113,17 +113,17 @@ class ProgramOptions: gen_opt_lto : bool, optional Run the optimizer passes before generating the LTO IR. Default: False - define_macro : Union[str, Tuple[str, str], List[Union[str, Tuple[str, str]]]], optional + define_macro : Union[str, tuple[str, str], list[Union[str, tuple[str, str]]]], optional Predefine a macro. Can be either a string, in which case that macro will be set to 1, a 2 element tuple of strings, in which case the first element is defined as the second, or a list of strings or tuples. Default: None - undefine_macro : Union[str, List[str]], optional + undefine_macro : Union[str, list[str]], optional Cancel any previous definition of a macro, or list of macros. Default: None - include_path : Union[str, List[str]], optional + include_path : Union[str, list[str]], optional Add the directory or directories to the list of directories to be searched for headers. Default: None - pre_include : Union[str, List[str]], optional + pre_include : Union[str, list[str]], optional Preinclude one or more headers during preprocessing. Can be either a string or a list of strings. Default: None no_source_include : bool, optional @@ -156,13 +156,13 @@ class ProgramOptions: no_display_error_number : bool, optional Disable the display of a diagnostic number for warning messages. Default: False - diag_error : Union[int, List[int]], optional + diag_error : Union[int, list[int]], optional Emit error for a specified diagnostic message number or comma separated list of numbers. Default: None - diag_suppress : Union[int, List[int]], optional + diag_suppress : Union[int, list[int]], optional Suppress a specified diagnostic message number or comma separated list of numbers. Default: None - diag_warn : Union[int, List[int]], optional + diag_warn : Union[int, list[int]], optional Emit warning for a specified diagnostic message number or comma separated lis of numbers. Default: None brief_diagnostics : bool, optional @@ -189,7 +189,7 @@ class ProgramOptions: debug: bool | None = None lineinfo: bool | None = None device_code_optimize: bool | None = None - ptxas_options: Union[str, List[str], Tuple[str]] | None = None + ptxas_options: Union[str, list[str], tuple[str]] | None = None max_register_count: int | None = None ftz: bool | None = None prec_sqrt: bool | None = None @@ -200,11 +200,11 @@ class ProgramOptions: link_time_optimization: bool | None = None gen_opt_lto: bool | None = None define_macro: ( - Union[str, Tuple[str, str], List[Union[str, Tuple[str, str]]], Tuple[Union[str, Tuple[str, str]]]] | None + Union[str, tuple[str, str], list[Union[str, tuple[str, str]]], tuple[Union[str, tuple[str, str]]]] | None ) = None - undefine_macro: Union[str, List[str], Tuple[str]] | None = None - include_path: Union[str, List[str], Tuple[str]] | None = None - pre_include: Union[str, List[str], Tuple[str]] | None = None + undefine_macro: Union[str, list[str], tuple[str]] | None = None + include_path: Union[str, list[str], tuple[str]] | None = None + pre_include: Union[str, list[str], tuple[str]] | None = None no_source_include: bool | None = None std: str | None = None builtin_move_forward: bool | None = None @@ -215,9 +215,9 @@ class ProgramOptions: device_int128: bool | None = None optimization_info: str | None = None no_display_error_number: bool | None = None - diag_error: Union[int, List[int], Tuple[int]] | None = None - diag_suppress: Union[int, List[int], Tuple[int]] | None = None - diag_warn: Union[int, List[int], Tuple[int]] | None = None + diag_error: Union[int, list[int], tuple[int]] | None = None + diag_suppress: Union[int, list[int], tuple[int]] | None = None + diag_warn: Union[int, list[int], tuple[int]] | None = None brief_diagnostics: bool | None = None time: str | None = None split_compile: int | None = None @@ -453,7 +453,7 @@ def compile(self, target_type, name_expressions=(), logs=None): target_type : Any String of the targeted compilation type. Supported options are "ptx", "cubin" and "ltoir". - name_expressions : Union[List, Tuple], optional + name_expressions : Union[list, tuple], optional List of explicit name expressions to become accessible. (Default to no expressions) logs : Any, optional diff --git a/cuda_core/cuda/core/experimental/_stream.pyx b/cuda_core/cuda/core/experimental/_stream.pyx index d73156523..64ae09529 100644 --- a/cuda_core/cuda/core/experimental/_stream.pyx +++ b/cuda_core/cuda/core/experimental/_stream.pyx @@ -12,7 +12,7 @@ from cuda.core.experimental._utils.cuda_utils cimport ( import os import warnings from dataclasses import dataclass -from typing import TYPE_CHECKING, Optional, Protocol, Tuple, Union +from typing import TYPE_CHECKING, Optional, Protocol, Union if TYPE_CHECKING: import cuda.bindings @@ -47,7 +47,7 @@ cdef class StreamOptions: class IsStreamT(Protocol): - def __cuda_stream__(self) -> Tuple[int, int]: + def __cuda_stream__(self) -> tuple[int, int]: """ For any Python object that is meant to be interpreted as a CUDA stream, the intent can be communicated by implementing this protocol that returns a 2-tuple: The protocol @@ -201,7 +201,7 @@ cdef class Stream: self._owner = None self._handle = None - def __cuda_stream__(self) -> Tuple[int, int]: + def __cuda_stream__(self) -> tuple[int, int]: """Return an instance of a __cuda_stream__ protocol.""" return (0, int(self.handle)) diff --git a/cuda_core/cuda/core/experimental/_system.py b/cuda_core/cuda/core/experimental/_system.py index a4e54d1ba..cbbc1a83c 100644 --- a/cuda_core/cuda/core/experimental/_system.py +++ b/cuda_core/cuda/core/experimental/_system.py @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import Tuple - from cuda.core.experimental._device import Device from cuda.core.experimental._utils.cuda_utils import driver, handle_return, runtime @@ -26,7 +24,7 @@ def __init__(self): self._initialized = True @property - def driver_version(self) -> Tuple[int, int]: + def driver_version(self) -> tuple[int, int]: """ Query the CUDA driver version. diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 76e312b0d..360939661 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -97,7 +97,6 @@ select = [ ] ignore = [ - "UP006", "UP007", "E741", # ambiguous variable name such as I "B007", # rename unsued loop variable to _name diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index eb2a57f65..491521ff9 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -229,9 +229,9 @@ def test_buffer_dunder_dlpack(): buffer.__dlpack__(dl_device=()) with pytest.raises(BufferError, match=r"^Sorry, not supported: copy=True$"): buffer.__dlpack__(copy=True) - with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \(\)$"): + with pytest.raises(BufferError, match=r"^Expected max_version tuple\[int, int\], got \(\)$"): buffer.__dlpack__(max_version=()) - with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \(9, 8, 7\)$"): + with pytest.raises(BufferError, match=r"^Expected max_version tuple\[int, int\], got \(9, 8, 7\)$"): buffer.__dlpack__(max_version=(9, 8, 7)) From aebce8ee96f914fdf360176d9ab871f50df2db36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:15:31 -0400 Subject: [PATCH 082/113] Bump github/codeql-action (#939) Bumps the actions-monthly group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 3.29.11 to 3.30.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/3c3833e0f8c1c83d449a7478aa59c036a9165498...2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-monthly ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 99ff1c364..3926e2688 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,13 +31,13 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11 + uses: github/codeql-action/init@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11 + uses: github/codeql-action/analyze@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0 with: category: "/language:${{matrix.language}}" From fa07cf58ef5c70bb6a42e9aa859487e88f5699a2 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 3 Sep 2025 11:27:51 -0700 Subject: [PATCH 083/113] Sync pre-commit, workflow `bandit` versions (manually) (#913) * sync pre-commit, workflow bandit versions (manually) * Move `KEEP IN SYNC` comment on `rev` line, to make it more likely that it does not get overlooked after running `pre-commit autoupdate --freeze` * Undo change in .github/dependabot.yml (see https://github.com/NVIDIA/cuda-python/pull/913#discussion_r2319684758) --- .github/workflows/bandit.yml | 7 ++++++- .pre-commit-config.yaml | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index 46663929f..c57ffd351 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -20,4 +20,9 @@ jobs: security-events: write steps: - name: Perform Bandit Analysis - uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de + # KEEP IN SYNC WITH bandit rev in .pre-commit-config.yaml + # Current runner uses Python 3.8, so the action installs bandit==1.7.10 + # via `pip install bandit[sarif]`. If runner Python moves to >=3.9, + # the action will resolve to 1.8.x and you'll need to bump pre-commit. + # (Bandit >=1.8.0 dropped Python 3.8 via Requires-Python metadata.) + uses: PyCQA/bandit-action@8a1b30610f61f3f792fe7556e888c9d7dffa52de # v1.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4da2dddef..d65ffce91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,6 @@ ci: autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' autoupdate_schedule: quarterly - skip: [bandit] submodules: false # Please update the rev: SHAs below with this command: @@ -66,7 +65,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/PyCQA/bandit - rev: 2d0b675b04c80ae42277e10500db06a0a37bae17 # frozen: 1.8.6 + rev: "36fd65054fc8864b4037d0918904f9331512feb5" # frozen: 1.7.10 KEEP IN SYNC WITH .github/workflows/bandit.yml hooks: - id: bandit args: From 559f749972d35b56f1c4655e8df62ecf3bb0c71c Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Thu, 4 Sep 2025 16:40:12 -0700 Subject: [PATCH 084/113] Fixing `cuda_bindings` local build errors manifesting with GCC-13 on Linux (WSL) (#946) * Fixing cuda_bindings local build manifesting with GCC-13 on Linux (WSL) * [pre-commit.ci] auto code formatting --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- cuda_bindings/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 8f0349bcd..dabed2a13 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -248,12 +248,13 @@ def generate_output(infile, local): "-std=c++14", "-fpermissive", "-Wno-deprecated-declarations", - "-D _GLIBCXX_ASSERTIONS", "-fno-var-tracking-assignments", ] if "--debug" in sys.argv: extra_cythonize_kwargs["gdb_debug"] = True extra_compile_args += ["-g", "-O0"] + extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"] # libstdc++ + # extra_compile_args += ["-D _LIBCPP_ENABLE_ASSERTIONS"] # Consider: if clang, use libc++ preprocessor macros. else: extra_compile_args += ["-O3"] From 62e2650500d10621a0cbdcf1ce80cdfd6f3138c3 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 4 Sep 2025 17:13:44 -0700 Subject: [PATCH 085/113] Add `nccl` in supported_nvidia_libs.py (#945) * Add nvidia-nccl-cu12 to cuda_pathfinder/pyproject.toml nvidia_wheels_cu12 * Add nccl in supported_nvidia_libs.py * Bump pathfinder version to 1.2.2a0 --- .../cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py | 2 ++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/pyproject.toml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index 281d798b5..4b1eb5ce6 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -242,6 +242,7 @@ "cufftMp": ("libcufftMp.so.11",), "mathdx": ("libmathdx.so.0",), "cudss": ("libcudss.so.0",), + "nccl": ("libnccl.so.2",), "nvpl_fftw": ("libnvpl_fftw.so.0",), "nvshmem_host": ("libnvshmem_host.so.3",), } @@ -447,6 +448,7 @@ "cudss": ("nvidia/cu12/lib",), "cufftMp": ("nvidia/cufftmp/cu12/lib",), "mathdx": ("nvidia/cu13/lib", "nvidia/cu12/lib"), + "nccl": ("nvidia/nccl/lib",), "nvpl_fftw": ("nvpl/lib",), "nvshmem_host": ("nvidia/nvshmem/lib",), } diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 8b5c6913e..62f65a873 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.2.1" +__version__ = "1.2.2a0" diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index f7d596f5c..1964dd762 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -17,9 +17,10 @@ test = [ nvidia_wheels_cu12 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", - "nvidia-libmathdx-cu12", "nvidia-cudss-cu12", "nvidia-cufftmp-cu12; sys_platform != 'win32'", + "nvidia-libmathdx-cu12", + "nvidia-nccl-cu12; sys_platform != 'win32'", "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] nvidia_wheels_cu13 = [ From 1b78bb3196a5f76750ac8882e35b75a4911b52c1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Sep 2025 22:47:01 -0400 Subject: [PATCH 086/113] CI: Avoid manual lookup of the run ID in the release workflow (#918) * Initial plan * Implement automatic run ID lookup from git tag in release workflow Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Improve run ID lookup script with better error handling and tool validation Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add default empty string value to optional run-id input Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add comment explaining fetch-depth: 0 requirement for lookup-run-id script Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * [pre-commit.ci] auto code formatting * apply review comments --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: Leo Fang Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 40 ++++++++++++-- ci/tools/lookup-run-id | 99 +++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 5 deletions(-) create mode 100755 ci/tools/lookup-run-id diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e423b556..c10f6f049 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,9 +24,10 @@ on: required: true type: string run-id: - description: "The GHA run ID that generated validated artifacts" - required: true + description: "The GHA run ID that generated validated artifacts (optional - will be auto-detected from git tag if not provided)" + required: false type: string + default: "" build-ctk-ver: type: string required: true @@ -43,6 +44,32 @@ defaults: shell: bash --noprofile --norc -xeuo pipefail {0} jobs: + determine-run-id: + runs-on: ubuntu-latest + outputs: + run-id: ${{ steps.lookup-run-id.outputs.run-id }} + steps: + - name: Checkout Source + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + # fetch-depth: 0 is required so the lookup-run-id script can access all git tags + fetch-depth: 0 + + - name: Determine Run ID + id: lookup-run-id + env: + GH_TOKEN: ${{ github.token }} + run: | + if [[ -n "${{ inputs.run-id }}" ]]; then + echo "Using provided run ID: ${{ inputs.run-id }}" + echo "run-id=${{ inputs.run-id }}" >> $GITHUB_OUTPUT + else + echo "Auto-detecting run ID for tag: ${{ inputs.git-tag }}" + RUN_ID=$(./ci/tools/lookup-run-id "${{ inputs.git-tag }}" "${{ github.repository }}") + echo "Auto-detected run ID: $RUN_ID" + echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT + fi + check-tag: runs-on: ubuntu-latest steps: @@ -91,13 +118,14 @@ jobs: pull-requests: write needs: - check-tag + - determine-run-id secrets: inherit uses: ./.github/workflows/build-docs.yml with: build-ctk-ver: ${{ inputs.build-ctk-ver }} component: ${{ inputs.component }} git-tag: ${{ inputs.git-tag }} - run-id: ${{ inputs.run-id }} + run-id: ${{ needs.determine-run-id.outputs.run-id }} is-release: true upload-archive: @@ -106,11 +134,12 @@ jobs: contents: write needs: - check-tag + - determine-run-id secrets: inherit uses: ./.github/workflows/release-upload.yml with: git-tag: ${{ inputs.git-tag }} - run-id: ${{ inputs.run-id }} + run-id: ${{ needs.determine-run-id.outputs.run-id }} component: ${{ inputs.component }} publish-wheels: @@ -118,6 +147,7 @@ jobs: runs-on: ubuntu-latest needs: - check-tag + - determine-run-id environment: name: ${{ inputs.wheel-dst }} url: https://${{ (inputs.wheel-dst == 'testpypi' && 'test.') || '' }}pypi.org/p/${{ inputs.component }}/ @@ -131,7 +161,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./ci/tools/download-wheels "${{ inputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist" + ./ci/tools/download-wheels "${{ needs.determine-run-id.outputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist" - name: Publish package distributions to PyPI if: ${{ inputs.wheel-dst == 'pypi' }} diff --git a/ci/tools/lookup-run-id b/ci/tools/lookup-run-id new file mode 100755 index 000000000..db2f84b79 --- /dev/null +++ b/ci/tools/lookup-run-id @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# A utility script to find the GitHub Actions workflow run ID for a given git tag. +# This script looks for the CI workflow run that corresponds to the commit of the given tag. + +set -euo pipefail + +# Check required arguments +if [[ $# -lt 2 ]]; then + echo "Usage: $0 [workflow-name]" >&2 + echo " git-tag: The git tag to find the corresponding workflow run for" >&2 + echo " repository: The GitHub repository (e.g., NVIDIA/cuda-python)" >&2 + echo " workflow-name: Optional workflow name to filter by (default: CI)" >&2 + echo "" >&2 + echo "Examples:" >&2 + echo " $0 v13.0.1 NVIDIA/cuda-python" >&2 + echo " $0 v13.0.1 NVIDIA/cuda-python \"CI\"" >&2 + exit 1 +fi + +GIT_TAG="${1}" +REPOSITORY="${2}" +WORKFLOW_NAME="${3:-CI}" + +# Ensure we have required tools +if [[ -z "${GH_TOKEN:-}" ]]; then + echo "Error: GH_TOKEN environment variable is required" >&2 + exit 1 +fi + +if ! command -v jq >/dev/null 2>&1; then + echo "Error: jq is required but not installed" >&2 + exit 1 +fi + +if ! command -v gh >/dev/null 2>&1; then + echo "Error: GitHub CLI (gh) is required but not installed" >&2 + exit 1 +fi + +echo "Looking up run ID for tag: ${GIT_TAG} in repository: ${REPOSITORY}" >&2 + +# Resolve git tag to commit SHA +if ! COMMIT_SHA=$(git rev-parse "${GIT_TAG}"); then + echo "Error: Could not resolve git tag '${GIT_TAG}' to a commit SHA" >&2 + echo "Make sure the tag exists and you have fetched it" >&2 + exit 1 +fi + +echo "Resolved tag '${GIT_TAG}' to commit: ${COMMIT_SHA}" >&2 + +# Find workflow runs for this commit +echo "Searching for '${WORKFLOW_NAME}' workflow runs for commit: ${COMMIT_SHA}" >&2 + +# Get workflow runs for the commit, filter by workflow name and successful status +RUN_DATA=$(gh run list \ + --repo "${REPOSITORY}" \ + --commit "${COMMIT_SHA}" \ + --workflow "${WORKFLOW_NAME}" \ + --status completed \ + --json databaseId,workflowName,status,conclusion,headSha \ + --limit 10) + +if [[ -z "${RUN_DATA}" || "${RUN_DATA}" == "[]" ]]; then + echo "Error: No completed '${WORKFLOW_NAME}' workflow runs found for commit ${COMMIT_SHA}" >&2 + echo "Available workflow runs for this commit:" >&2 + gh run list --repo "${REPOSITORY}" --commit "${COMMIT_SHA}" --limit 10 || true + exit 1 +fi + +# Filter for successful runs (conclusion = success) and extract the run ID from the first one +RUN_ID=$(echo "${RUN_DATA}" | jq -r '.[] | select(.conclusion == "success") | .databaseId' | head -1) + +if [[ -z "${RUN_ID}" || "${RUN_ID}" == "null" ]]; then + echo "Error: No successful '${WORKFLOW_NAME}' workflow runs found for commit ${COMMIT_SHA}" >&2 + echo "Available workflow runs for this commit:" >&2 + gh run list --repo "$REPOSITORY" --commit "${COMMIT_SHA}" --limit 10 || true + echo "" >&2 + echo "Completed runs with their conclusions:" >&2 + echo "${RUN_DATA}" | jq -r '.[] | "\(.databaseId): \(.conclusion)"' >&2 + exit 1 +fi + +echo "Found workflow run ID: ${RUN_ID} for tag '${GIT_TAG}'" >&2 + +# Verify the run has the expected artifacts by checking if there are any artifacts +echo "Verifying artifacts exist for run ${RUN_ID}..." >&2 +ARTIFACT_LIST=$(gh run view "${RUN_ID}" --repo "${REPOSITORY}" --json url || echo "") + +if [[ -z "${ARTIFACT_LIST}" ]]; then + echo "Warning: Could not verify artifacts for workflow run ${RUN_ID}" >&2 +fi + +# Output the run ID (this is what gets used by calling scripts) +echo "${RUN_ID}" From b9427f180505862c0802dcf3ec5dfe7c3288e680 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 5 Sep 2025 13:50:28 -0400 Subject: [PATCH 087/113] fix pathfinder link (#948) --- cuda_python/docs/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_python/docs/source/conf.py b/cuda_python/docs/source/conf.py index 9bd3dcc78..7811ea322 100644 --- a/cuda_python/docs/source/conf.py +++ b/cuda_python/docs/source/conf.py @@ -86,6 +86,7 @@ rst_epilog = f""" .. _cuda.core: {CUDA_PYTHON_DOMAIN}/cuda-core/latest .. _cuda.bindings: {CUDA_PYTHON_DOMAIN}/cuda-bindings/latest +.. _cuda.pathfinder: {CUDA_PYTHON_DOMAIN}/cuda-pathfinder/latest .. _cuda.cccl.cooperative: https://nvidia.github.io/cccl/python/cooperative .. _cuda.cccl.parallel: https://nvidia.github.io/cccl/python/parallel .. _numba.cuda: https://nvidia.github.io/numba-cuda/ From b4644f2870afe1ed43e8094c8dfac5a99870702a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:02:05 -0400 Subject: [PATCH 088/113] CI: Consolidate test matrix configurations into ci/test-matrix.json with hard-coded values, optimized checkout, and prepared Windows self-hosted runner migration (#889) * Initial plan * Consolidate test matrices from workflows into ci/test-matrix.json Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Hard-code all GPU and ARCH values in test-matrix.json with 6 fields per entry Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Update Windows test matrix with a100 GPU and latest-1 driver, configure self-hosted runners Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * fix * Revert eed0b71 and change Windows DRIVER from latest-1 to latest Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add proxy cache setup to Windows workflow for self-hosted runners Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove Git for Windows and gh CLI installation steps, add T4 GPU support to Windows matrix Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Set fetch-depth: 1 for checkout steps and favor L4/T4 over A100 GPUs for Windows testing Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Revert Windows workflow to GitHub-hosted runners with TODO comments for future self-hosted migration Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * [pre-commit.ci] auto code formatting * Revert Win runner name change for now --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: Leo Fang Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/test-wheel-linux.yml | 85 +++++-------------- .github/workflows/test-wheel-windows.yml | 43 +++++----- ci/test-matrix.json | 100 +++++++++++++++++++++++ 3 files changed, 142 insertions(+), 86 deletions(-) create mode 100644 ci/test-matrix.json diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 88c8626f5..726ee9d44 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -34,86 +34,43 @@ jobs: outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 1 + - name: Validate Test Type run: | if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then echo "Invalid build type! Must be one of 'nightly', 'pull-request', or 'branch'." exit 1 fi + - name: Compute Python Test Matrix id: compute-matrix run: | - # Set a default GPU based upon architecture. - gpu="l4" - if [[ "${ARCH}" == "arm64" ]]; then - gpu="a100" - fi - # Add a special entry for the H100 runner on amd64. - special_runner="" - if [[ "${ARCH}" == "amd64" ]]; then - special_runner="- { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: 'H100', DRIVER: 'latest' }" - fi - - # Please keep the matrices sorted in ascending order by the following: - # - # [PY_VER, CUDA_VER, LOCAL_CTK, GPU, DRIVER] - # - # Note that DRIVER: `earliest` does not work with CUDA 12.9.0 and LOCAL_CTK: 0 does not work with CUDA 12.0.1. - # - export MATRICES=" - pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '13.0.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '13.0.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - ${special_runner} - nightly: - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - ${special_runner} - " - # Use the nightly matrix for branch tests MATRIX_TYPE="${BUILD_TYPE}" if [[ "${MATRIX_TYPE}" == "branch" ]]; then MATRIX_TYPE="nightly" fi - export MATRIX_TYPE - TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]') - export TEST_MATRIX + + # Read base matrix from JSON file for the specific architecture + TEST_MATRIX=$(jq --arg arch "$ARCH" --arg matrix_type "$MATRIX_TYPE" ' + .linux[$matrix_type] | + map(select(.ARCH == $arch)) + ' ci/test-matrix.json) + + # Add special runner for amd64 if applicable + if [[ "${ARCH}" == "amd64" ]]; then + SPECIAL_RUNNERS=$(jq ' + .linux.special_runners.amd64 + ' ci/test-matrix.json) + TEST_MATRIX=$(jq --argjson special "$SPECIAL_RUNNERS" '. + $special' <<< "$TEST_MATRIX") + fi MATRIX="$( - yq -n -o json 'env(TEST_MATRIX)' | \ - jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' + jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' <<< "$TEST_MATRIX" )" echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 797e082bf..d0b35e95c 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -32,6 +32,11 @@ jobs: outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 1 + - name: Validate Test Type run: | if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then @@ -41,40 +46,27 @@ jobs: - name: Compute Python Test Matrix id: compute-matrix run: | - # Please keep the matrices sorted in ascending order by the following: - # - # [PY_VER, CUDA_VER, LOCAL_CTK] - # - export MATRICES=" - pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '13.0.0', LOCAL_CTK: '1' } - nightly: - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1' } - " - # Use the nightly matrix for branch tests MATRIX_TYPE="${BUILD_TYPE}" if [[ "${MATRIX_TYPE}" == "branch" ]]; then MATRIX_TYPE="nightly" fi - export MATRIX_TYPE - TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]') - export TEST_MATRIX + + # Read base matrix from JSON file for the specific architecture + TEST_MATRIX=$(jq --arg arch "$ARCH" --arg matrix_type "$MATRIX_TYPE" ' + .windows[$matrix_type] | + map(select(.ARCH == $arch)) + ' ci/test-matrix.json) MATRIX="$( - yq -n -o json 'env(TEST_MATRIX)' | \ - jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' + jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' <<< "$TEST_MATRIX" )" echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" test: + # TODO: switch to this once the self-hosted runners are ready + # name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, GPU ${{ matrix.GPU }} name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }} # The build stage could fail but we want the CI to keep moving. needs: compute-matrix @@ -82,6 +74,8 @@ jobs: fail-fast: false matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} if: ${{ github.repository_owner == 'nvidia' && !cancelled() }} + # TODO: switch to self-hosted runners once they are ready + # runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1" runs-on: 'cuda-python-windows-gpu-github' steps: - name: Checkout ${{ github.event.repository.name }} @@ -90,6 +84,9 @@ jobs: fetch-depth: 0 # TODO: use setup-proxy-cache once we have self-hosted Windows runners + # - name: Setup proxy cache + # uses: nv-gha-runners/setup-proxy-cache@main + # continue-on-error: true - name: Update driver run: | @@ -98,6 +95,7 @@ jobs: - name: Ensure GPU is working run: nvidia-smi + # TODO: remove this block once self-hosted runners are ready - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... env: @@ -143,6 +141,7 @@ jobs: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + # TODO: remove this block once self-hosted runners are ready - name: Install gh cli # the GPU runner image does not have gh pre-installed... env: diff --git a/ci/test-matrix.json b/ci/test-matrix.json new file mode 100644 index 000000000..96bde257d --- /dev/null +++ b/ci/test-matrix.json @@ -0,0 +1,100 @@ +{ + "_description": "Test matrix configurations for CUDA Python CI workflows. This file consolidates the test matrices that were previously hardcoded in the workflow files. All GPU and ARCH values are hard-coded for each architecture: l4 GPU for amd64, a100 GPU for arm64.", + "_sorted_by": "Please keep matrices sorted in ascending order by [ARCH, PY_VER, CUDA_VER, LOCAL_CTK, GPU, DRIVER]", + "_notes": "DRIVER: 'earliest' does not work with CUDA 12.9.0 and LOCAL_CTK: 0 does not work with CUDA 12.0.1", + "linux": { + "pull-request": [ + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + ], + "nightly": [ + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + ], + "special_runners": { + "amd64": [ + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "H100", "DRIVER": "latest" } + ] + } + }, + "windows": { + "pull-request": [ + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + ], + "nightly": [ + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + ] + } +} From d64120bb6733391989174456daaf18643ea29711 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 5 Sep 2025 12:20:42 -0700 Subject: [PATCH 089/113] Initial version of `cuda.pathfinder._find_nvidia_headers` for `nvshmem` (#661) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * find_nvidia_headers.py initial version (untested). * Add tests/test_path_finder_find_headers.py, with hard-coded paths. * Better error message: UNKNOWN libname='unknown-libname' * if libname == "nvshmem" and IS_WINDOWS: return None * Move find_nvidia_headers.py → _headers/find_nvidia_headers.py * test_find_nvidia_headers.py: removed hard-wired paths, comments with more complete commands for setting up manual testing. * Make _find_nvidia_header_directory private for now. * test_find_nvidia_headers.py: Move comments with installation commands up. * Add `have_nvidia_nvshmem_package()` function to enable `assert hdr_dir is not None` * Add nvidia-nvshmem-cu12,13 in pyproject.toml * assert site-packages or dist-packages * Add CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS * Transfer `ci/`, `.github/` changes from PR #864 * Add CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS in `ci/`, `.github/` * reverse=True in sorting of "/usr/include/nvshmem_*" (find newest first) * Fix: assert site-packages or dist-packages only if have_nvidia_nvshmem_package() * pytest.skip("nvshmem has no Windows support.") * Add new cuda/pathfinder/_utils/conda_env.py and use from find_nvidia_headers.py * Add new cuda/pathfinder/_utils/env_vars_for_include.py and use from find_nvidia_headers.py * Revert "Add new cuda/pathfinder/_utils/env_vars_for_include.py and use from find_nvidia_headers.py" This reverts commit c90c393c1971d75dbdd924f9ade52c1886b82427. * Revert "Add new cuda/pathfinder/_utils/conda_env.py and use from find_nvidia_headers.py" This reverts commit eb2e78a4825619ea4d703709dbe25b9239af4ab8. * Bump pathfinder version to 1.2.2 and add release/1.2.2-notes.rst * Remove os.path.isdir() tests that are not strictly needed. * test_find_nvidia_headers.py: remove check for `dist-packages` because a .deb that installs into dist-packages does not exist. * Additional testing --- .github/workflows/test-wheel-linux.yml | 2 + .github/workflows/test-wheel-windows.yml | 2 + ci/tools/run-tests | 4 +- cuda_pathfinder/cuda/pathfinder/__init__.py | 3 + .../_headers/find_nvidia_headers.py | 42 +++++++++++++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/docs/nv-versions.json | 4 ++ cuda_pathfinder/docs/source/release.rst | 1 + .../docs/source/release/1.2.2-notes.rst | 19 ++++++ .../tests/test_find_nvidia_headers.py | 60 +++++++++++++++++++ 10 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py create mode 100644 cuda_pathfinder/docs/source/release/1.2.2-notes.rst create mode 100644 cuda_pathfinder/tests/test_find_nvidia_headers.py diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 726ee9d44..ce8f6d540 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -255,6 +255,7 @@ jobs: - name: Run cuda.pathfinder tests with see_what_works env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works + CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works run: run-tests pathfinder - name: Run cuda.bindings tests @@ -289,4 +290,5 @@ jobs: - name: Run cuda.pathfinder tests with all_must_work env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work + CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work run: run-tests pathfinder diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index d0b35e95c..8e18d553b 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -261,6 +261,7 @@ jobs: - name: Run cuda.pathfinder tests with see_what_works env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works + CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works shell: bash --noprofile --norc -xeuo pipefail {0} run: run-tests pathfinder @@ -298,5 +299,6 @@ jobs: - name: Run cuda.pathfinder tests with all_must_work env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work + CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work shell: bash --noprofile --norc -xeuo pipefail {0} run: run-tests pathfinder diff --git a/ci/tools/run-tests b/ci/tools/run-tests index ad1dbd6a9..22d6bd07c 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -31,7 +31,9 @@ popd if [[ "${test_module}" == "pathfinder" ]]; then pushd ./cuda_pathfinder - echo "Running pathfinder tests with ${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS}" + echo "Running pathfinder tests with " \ + "LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \ + "FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS}" pwd pytest -ra -s -v tests/ popd diff --git a/cuda_pathfinder/cuda/pathfinder/__init__.py b/cuda_pathfinder/cuda/pathfinder/__init__.py index 6bdeb151e..53f2527c7 100644 --- a/cuda_pathfinder/cuda/pathfinder/__init__.py +++ b/cuda_pathfinder/cuda/pathfinder/__init__.py @@ -7,4 +7,7 @@ from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( SUPPORTED_LIBNAMES as SUPPORTED_NVIDIA_LIBNAMES, # noqa: F401 ) +from cuda.pathfinder._headers.find_nvidia_headers import ( + find_nvidia_header_directory as _find_nvidia_header_directory, # noqa: F401 +) from cuda.pathfinder._version import __version__ as __version__ diff --git a/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py b/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py new file mode 100644 index 000000000..cc2c8654c --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import glob +import os +from typing import Optional + +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import IS_WINDOWS +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages + + +@functools.cache +def find_nvidia_header_directory(libname: str) -> Optional[str]: + if libname != "nvshmem": + raise RuntimeError(f"UNKNOWN {libname=}") + + if libname == "nvshmem" and IS_WINDOWS: + # nvshmem has no Windows support. + return None + + # Installed from a wheel + nvidia_sub_dirs = ("nvidia", "nvshmem", "include") + hdr_dir: str # help mypy + for hdr_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): + nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") + if os.path.isfile(nvshmem_h_path): + return hdr_dir + + conda_prefix = os.environ.get("CONDA_PREFIX") + if conda_prefix and os.path.isdir(conda_prefix): + hdr_dir = os.path.join(conda_prefix, "include") + nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") + if os.path.isfile(nvshmem_h_path): + return hdr_dir + + for hdr_dir in sorted(glob.glob("/usr/include/nvshmem_*"), reverse=True): + nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") + if os.path.isfile(nvshmem_h_path): + return hdr_dir + + return None diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 62f65a873..70aa6255c 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.2.2a0" +__version__ = "1.2.2" diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json index a8f26a1ae..eb5b96a0a 100644 --- a/cuda_pathfinder/docs/nv-versions.json +++ b/cuda_pathfinder/docs/nv-versions.json @@ -3,6 +3,10 @@ "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" }, + { + "version": "1.2.2", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.2/" + }, { "version": "1.2.1", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.1/" diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst index 56b4be814..b7c0ff6e1 100644 --- a/cuda_pathfinder/docs/source/release.rst +++ b/cuda_pathfinder/docs/source/release.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 3 + 1.2.2 1.2.1 1.2.0 1.1.0 diff --git a/cuda_pathfinder/docs/source/release/1.2.2-notes.rst b/cuda_pathfinder/docs/source/release/1.2.2-notes.rst new file mode 100644 index 000000000..0a483081e --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.2.2-notes.rst @@ -0,0 +1,19 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.2.2 Release notes +======================================= + +Released on Sep 8, 2025 + + +Highlights +---------- + +* Support nccl library (`PR #945 `_) + +* Add experimental ``cuda.pathfinder._find_nvidia_headers`` API, + currently limited to supporting ``nvshmem`` + (`PR #661 `_) diff --git a/cuda_pathfinder/tests/test_find_nvidia_headers.py b/cuda_pathfinder/tests/test_find_nvidia_headers.py new file mode 100644 index 000000000..2d432b0f2 --- /dev/null +++ b/cuda_pathfinder/tests/test_find_nvidia_headers.py @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Currently these installations are only manually tested: + +# conda create -y -n nvshmem python=3.12 +# conda activate nvshmem +# conda install -y conda-forge::libnvshmem3 conda-forge::libnvshmem-dev + +# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb +# sudo dpkg -i cuda-keyring_1.1-1_all.deb +# sudo apt update +# sudo apt install libnvshmem3-cuda-12 libnvshmem3-dev-cuda-12 +# sudo apt install libnvshmem3-cuda-13 libnvshmem3-dev-cuda-13 + +import functools +import importlib.metadata +import os +import re + +import pytest + +from cuda.pathfinder import _find_nvidia_header_directory as find_nvidia_header_directory +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import IS_WINDOWS + +STRICTNESS = os.environ.get("CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS", "see_what_works") +assert STRICTNESS in ("see_what_works", "all_must_work") + + +@functools.cache +def have_nvidia_nvshmem_package() -> bool: + pattern = re.compile(r"^nvidia-nvshmem-.*$") + return any( + pattern.match(dist.metadata["Name"]) for dist in importlib.metadata.distributions() if "Name" in dist.metadata + ) + + +def test_unknown_libname(): + with pytest.raises(RuntimeError, match=r"^UNKNOWN libname='unknown-libname'$"): + find_nvidia_header_directory("unknown-libname") + + +def test_find_libname_nvshmem(info_summary_append): + hdr_dir = find_nvidia_header_directory("nvshmem") + info_summary_append(f"{hdr_dir=!r}") + if IS_WINDOWS: + assert hdr_dir is None + pytest.skip("nvshmem has no Windows support.") + if hdr_dir: + assert os.path.isdir(hdr_dir) + assert os.path.isfile(os.path.join(hdr_dir, "nvshmem.h")) + if STRICTNESS == "all_must_work" or have_nvidia_nvshmem_package(): + assert hdr_dir is not None + if have_nvidia_nvshmem_package(): + hdr_dir_parts = hdr_dir.split(os.path.sep) + assert "site-packages" in hdr_dir_parts + elif conda_prefix := os.getenv("CONDA_PREFIX"): + assert hdr_dir.startswith(conda_prefix) + else: + assert hdr_dir.startswith("/usr/include/nvshmem_") From cf1379074ae992e90a003762940b7cece44aa2d6 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:27:23 -0400 Subject: [PATCH 090/113] Add CI infrastructure overview with hand-drawn SVG diagram, Mermaid alternative, and enhanced artifact flow visualization to CONTRIBUTING.md (#916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * Add CI infrastructure overview section to CONTRIBUTING.md - Added cuda-pathfinder component to the component guidelines list - Added footnote explaining cuda.bindings follows cuda-python contributing guide - Added comprehensive CI infrastructure overview section with: - Visual flowchart diagram showing build → test → release pipeline - Platform and runner details (self-hosted vs GitHub-hosted) - Artifact storage and propagation (GitHub Artifacts vs Cache) - Branch-specific workflows (main, backport, pull-request) - Key infrastructure details Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Address CI infrastructure feedback: update flowchart, fix footnotes, add SVG diagram Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Update SVG diagram with requested changes and move to ci/ directory Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove nv-gha-runners implementation detail and improve SVG diagram layout Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Convert SVG diagram to hand-drawn Excalidraw-like style Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove pull-request/* branches section from CONTRIBUTING.md Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Add artifact flow arrows and regeneration reference file Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SVG arrow styling and add parallel execution documentation Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SVG arrow styling and restructure CONTRIBUTING.md Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SVG arrow styling, move footnote to bottom, and add Mermaid diagram Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix SVG arrow positioning to prevent overlap with boxes and remove unnecessary markdown separator Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Manually adjust SVG marker sizes and text positions * Replace duplicated Mermaid content with file reference and update regeneration instructions Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Rename ci-pipeline.mmd to ci-pipeline.md * try this Updated the CI pipeline representation with a new image format. * Inline Mermaid diagram in CONTRIBUTING.md instead of file reference Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Delete ci/ci-pipeline.md * [pre-commit.ci] auto code formatting * Add SPDX headers to CI pipeline files Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Fix footnote formatting and convert .txt to .md for pipeline regeneration docs Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * md files don't need spdx * Remove pull-request/* branches trigger event references from CI documentation Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Update ci/ci-pipeline.svg * Add artifact flow arrows to TEST STAGE and remove empty line from SVG Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Apply suggestions from code review * Fix SVG artifact flow arrows and add wheel upload label Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> Co-authored-by: Leo Fang Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CONTRIBUTING.md | 134 +++++++++++++++++++++++++++++- ci/.ci-pipeline-regen.md | 106 ++++++++++++++++++++++++ ci/ci-pipeline.svg | 172 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 ci/.ci-pipeline-regen.md create mode 100644 ci/ci-pipeline.svg diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aac130218..183d21586 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,15 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of 2. You want to implement a feature, improvement, or bug fix: - Please refer to each component's guideline: - [`cuda.core`](https://nvidia.github.io/cuda-python/cuda-core/latest/contribute.html) - - [`cuda.bindings`](https://nvidia.github.io/cuda-python/cuda-bindings/latest/contribute.html) + - [`cuda.bindings`](https://nvidia.github.io/cuda-python/cuda-bindings/latest/contribute.html)[1](#footnote1) + - [`cuda.pathfinder`](https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/contribute.html) + +## Table of Contents + +- [Pre-commit](#pre-commit) +- [Code signing](#code-signing) +- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco) +- [CI infrastructure overview](#ci-infrastructure-overview) ## Pre-commit @@ -78,3 +86,127 @@ By making a contribution to this project, I certify that: maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` + +## CI infrastructure overview + +The CUDA Python project uses a comprehensive CI pipeline that builds, tests, and releases multiple components across different platforms. This section provides a visual overview of our CI infrastructure to help contributors understand the build and release process. + +### CI Pipeline Flow + +![CUDA Python CI Pipeline Flow](ci/ci-pipeline.svg) + +Alternative Mermaid diagram representation: + +```mermaid +flowchart TD + %% Trigger Events + subgraph TRIGGER["🔄 TRIGGER EVENTS"] + T1["• Push to main branch"] + T2["• Pull request
• Manual workflow dispatch"] + T1 --- T2 + end + + %% Build Stage + subgraph BUILD["🔨 BUILD STAGE"] + subgraph BUILD_PLATFORMS["Parallel Platform Builds"] + B1["linux-64
(Self-hosted)"] + B2["linux-aarch64
(Self-hosted)"] + B3["win-64
(GitHub-hosted)"] + end + BUILD_DETAILS["• Python versions: 3.9, 3.10, 3.11, 3.12, 3.13
• CUDA version: 13.0.0 (build-time)
• Components: cuda-core, cuda-bindings,
cuda-pathfinder, cuda-python"] + end + + %% Artifact Storage + subgraph ARTIFACTS["📦 ARTIFACT STORAGE"] + subgraph GITHUB_ARTIFACTS["GitHub Artifacts"] + GA1["• Wheel files (.whl)
• Test artifacts
• Documentation
(30-day retention)"] + end + subgraph GITHUB_CACHE["GitHub Cache"] + GC1["• Mini CTK cache"] + end + end + + %% Test Stage + subgraph TEST["🧪 TEST STAGE"] + subgraph TEST_PLATFORMS["Parallel Platform Tests"] + TS1["linux-64
(Self-hosted)"] + TS2["linux-aarch64
(Self-hosted)"] + TS3["win-64
(GitHub-hosted)"] + end + TEST_DETAILS["• Download wheels from artifacts
• Test against multiple CUDA runtime versions
• Run Python unit tests, Cython tests, examples"] + ARTIFACT_FLOWS["Artifact Flows:
• cuda-pathfinder: main → backport
• cuda-bindings: backport → main"] + end + + %% Release Pipeline + subgraph RELEASE["🚀 RELEASE PIPELINE"] + subgraph RELEASE_STAGES["Sequential Release Steps"] + R1["Validation
• Artifact integrity
• Git tag verification"] + R2["Publishing
• PyPI/TestPyPI
• Component or all releases"] + R3["Documentation
• GitHub Pages
• Release notes"] + R1 --> R2 --> R3 + end + RELEASE_DETAILS["• Manual workflow dispatch with run ID
• Supports individual component or full releases"] + end + + %% Main Flow + TRIGGER --> BUILD + BUILD -.->|"wheel upload"| ARTIFACTS + ARTIFACTS -.-> TEST + TEST --> RELEASE + + %% Artifact Flow Arrows (Cache Reuse) + GITHUB_CACHE -.->|"mini CTK reuse"| BUILD + GITHUB_CACHE -.->|"mini CTK reuse"| TEST + + %% Artifact Flow Arrows (Wheel Fetch) + GITHUB_ARTIFACTS -.->|"wheel fetch"| TEST + GITHUB_ARTIFACTS -.->|"wheel fetch"| RELEASE + + %% Styling + classDef triggerStyle fill:#e8f4fd,stroke:#2196F3,stroke-width:2px,color:#1976D2 + classDef buildStyle fill:#f3e5f5,stroke:#9C27B0,stroke-width:2px,color:#7B1FA2 + classDef artifactStyle fill:#fff3e0,stroke:#FF9800,stroke-width:2px,color:#F57C00 + classDef testStyle fill:#e8f5e8,stroke:#4CAF50,stroke-width:2px,color:#388E3C + classDef releaseStyle fill:#ffebee,stroke:#f44336,stroke-width:2px,color:#D32F2F + + class TRIGGER,T1,T2 triggerStyle + class BUILD,BUILD_PLATFORMS,B1,B2,B3,BUILD_DETAILS buildStyle + class ARTIFACTS,GITHUB_ARTIFACTS,GITHUB_CACHE,GA1,GC1 artifactStyle + class TEST,TEST_PLATFORMS,TS1,TS2,TS3,TEST_DETAILS,ARTIFACT_FLOWS testStyle + class RELEASE,RELEASE_STAGES,R1,R2,R3,RELEASE_DETAILS releaseStyle +``` + +### Pipeline Execution Details + +**Parallel Execution**: The CI pipeline leverages parallel execution to optimize build and test times: +- **Build Stage**: Different architectures/operating systems (linux-64, linux-aarch64, win-64) are built in parallel across their respective runners +- **Test Stage**: Different architectures/operating systems/CUDA versions are tested in parallel; documentation preview is also built in parallel with testing + +### Branch-specific Artifact Flow + +#### Main Branch +- **Build** → **Test** → **Documentation** → **Potential Release** +- Artifacts stored as `{component}-python{version}-{platform}-{sha}` +- Full test coverage across all platforms and CUDA versions +- **Artifact flow out**: `cuda-pathfinder` artifacts → backport branches + +#### Backport Branches +- **Build** → **Test** → **Backport PR Creation** +- Artifacts used for validation before creating backport pull requests +- Maintains compatibility with older CUDA versions +- **Artifact flow in**: `cuda-pathfinder` artifacts ← main branch +- **Artifact flow out**: older `cuda-bindings` artifacts → main branch + +### Key Infrastructure Details + +- **Self-hosted runners**: Used for Linux builds and GPU testing (more resources, faster builds) +- **GitHub-hosted runners**: Used for Windows builds and general tasks +- **Artifact retention**: 30 days for GitHub Artifacts (wheels, docs, tests) +- **Cache retention**: GitHub Cache for build dependencies and environments +- **Security**: All commits must be signed, untrusted code blocked +- **Parallel execution**: Matrix builds across Python versions and platforms +- **Component isolation**: Each component (core, bindings, pathfinder, python) can be built/released independently + +--- + +1: The `cuda-python` meta package shares the same license and the contributing guidelines as those of `cuda-bindings`. diff --git a/ci/.ci-pipeline-regen.md b/ci/.ci-pipeline-regen.md new file mode 100644 index 000000000..7ddf9b970 --- /dev/null +++ b/ci/.ci-pipeline-regen.md @@ -0,0 +1,106 @@ +# CUDA Python CI Pipeline SVG Regeneration Instructions + +This file contains the prompt and requirements for regenerating `ci-pipeline.svg` with the same styling and content. + +## Styling Requirements + +- Hand-drawn Excalidraw-style design with rough, sketchy borders +- Comic Sans MS font family for all text +- Imperfect lines and curves that mimic hand-drawn aesthetics +- Canvas size: 900x800 pixels +- Color scheme: + - Trigger Events: #e8f4fd background, #2196F3 border, #1976D2 text + - Build Stage: #f3e5f5 background, #9C27B0 border, #7B1FA2 text + - Artifact Storage: #fff3e0 background, #FF9800 border, #F57C00 text + - Test Stage: #e8f5e8 background, #4CAF50 border, #388E3C text + - Release Pipeline: #ffebee background, #f44336 border, #D32F2F text + +## Content Structure + +1. **Title**: "CUDA Python CI Pipeline Flow" + +2. **Trigger Events** (top blue box): + - Push to main branch + - Pull request + - Manual workflow dispatch + +3. **Build Stage** (purple box): + - Three platform boxes: linux-64 (Self-hosted), linux-aarch64 (Self-hosted), win-64 (GitHub-hosted) + - Details: Python versions 3.9-3.13, CUDA 13.0.0 (build-time) + - Components: cuda-core, cuda-bindings, cuda-pathfinder, cuda-python + +4. **Artifact Storage** (orange box): + - GitHub Artifacts box: Wheel files (.whl), Test artifacts, Documentation (30-day retention) + - GitHub Cache box: Mini CTK cache + +5. **Test Stage** (green box): + - Three platform boxes: linux-64 (Self-hosted), linux-aarch64 (Self-hosted), win-64 (GitHub-hosted) + - Details: Download wheels from artifacts, Test against multiple CUDA runtime versions, Run Python unit tests, Cython tests, examples + - Artifact Flows (in red text): + • cuda-pathfinder: main → backport + • cuda-bindings: backport → main + +6. **Release Pipeline** (red box): + - Three sequential boxes: Validation → Publishing → Documentation + - Validation: Artifact integrity, Git tag verification + - Publishing: PyPI/TestPyPI, Component or all releases + - Documentation: GitHub Pages, Release notes + - Details: Manual workflow dispatch with run ID, Supports individual component or full releases + +## Arrow Requirements + +- Main flow arrows: Trigger → Build → Artifact → Test → Release +- Additional artifact flow arrows (dashed, orange #FF9800): + - From GitHub Cache (mini CTK) back to Build Stage with "mini CTK reuse" label + - From GitHub Artifacts (wheels) to Release Pipeline with "wheel fetch" label + - **NEW**: From GitHub Cache (mini CTK) to Test Stage with "mini CTK reuse" label + - **NEW**: From GitHub Artifacts (wheels) to Test Stage with "wheel fetch" label +- Arrow marker definition with hand-drawn style (orange arrow heads, not black) +- Use stroke-dasharray="5,3" for artifact flow arrows + +## Critical Arrow Positioning Requirements (UPDATED) + +**IMPORTANT**: Arrows must NOT overlap with stage boxes. Ensure proper clearance: + +1. **Mini CTK reuse arrow** (GitHub Cache → Build Stage): + - Arrow endpoint Y coordinate must be BELOW the Build Stage box edge (y=292) + - Use y=295 or greater for the endpoint to ensure no overlap + - Position "mini CTK reuse" text to the RIGHT of the arrow (not left) for less visual clutter + - Text color should be orange (#FF9800) to match arrow + +2. **Wheel fetch arrow** (GitHub Artifacts → Release Pipeline): + - Arrow endpoint Y coordinate must be ABOVE the Release Pipeline box edge (y=652) + - Use y=645 or smaller for the endpoint to provide proper margin + - Position "wheel fetch" text between Test Stage and Release Pipeline boxes + - Text should be to the LEFT of the arrow for better spacing + +## Font Size Requirements (UPDATED) + +- ALL text labels must use consistent 12pt font size for readability +- No 9pt text - this is too small and hard to read +- Title: 16pt, Stage headers: 14pt, All other text: 12pt + +## Key Features + +- All boxes use rough, hand-drawn paths (not perfect rectangles) +- Text should be properly sized and positioned within boxes +- Platform boxes within each stage should be clearly separated +- Maintain consistent spacing and alignment +- Orange arrow heads must match the orange arrow color + +## Text Positioning + +- Use text-anchor="middle" for centered headers +- Use text-anchor="start" for left-aligned bullet points +- Ensure all text fits within their enclosing boxes +- Use transforms for angled text labels on artifact flow arrows +- Artifact flow arrow text positioning is critical - follow positioning requirements above + +## Recent Manual Adjustments Applied + +- Fixed arrow endpoint positioning to prevent overlap with stage boxes +- Moved mini CTK reuse arrow endpoint from y=285 to y=295 +- Moved wheel fetch arrow endpoint from y=650 to y=645 +- Repositioned text labels for better visual separation +- Standardized all text to 12pt font size for consistency +- Changed arrow heads from black to orange to match arrow color diff --git a/ci/ci-pipeline.svg b/ci/ci-pipeline.svg new file mode 100644 index 000000000..eeff4c69f --- /dev/null +++ b/ci/ci-pipeline.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + CUDA Python CI Pipeline Flow + + + + TRIGGER EVENTS + • Push to main branch + • Pull request + • Manual workflow dispatch + + + + + + BUILD STAGE + + + + linux-64 + Self-hosted + + + linux-aarch64 + Self-hosted + + + win-64 + GitHub-hosted + + + • Python versions: 3.9, 3.10, 3.11, 3.12, 3.13 + • CUDA version: 13.0.0 (build-time) + • Components: cuda-core, cuda-bindings, + cuda-pathfinder, cuda-python + + + + wheel upload + + + + ARTIFACT STORAGE + + + + GitHub Artifacts + • Wheel files (.whl) + • Test artifacts + • Documentation + (30-day retention) + + + GitHub Cache + • Mini CTK cache + + + + + + + + mini CTK reuse + + + + wheel fetch + + + + + mini CTK reuse + + + + wheel fetch + + + + TEST STAGE + + + + linux-64 + Self-hosted + + + linux-aarch64 + Self-hosted + + + win-64 + GitHub-hosted + + + • Download wheels from artifacts + • Test against multiple CUDA runtime versions + • Run Python unit tests, Cython tests, examples + Artifact Flows: + • cuda-pathfinder: main → backport + • cuda-bindings: backport → main + + + + + + + RELEASE PIPELINE + + + + Validation + • Artifact integrity + • Git tag verification + + + + + + Publishing + • PyPI/TestPyPI + • Component or all releases + + + + + + Documentation + • GitHub Pages + • Release notes + + + • Manual workflow dispatch with run ID + • Supports individual component or full releases + From 0e72a17da4f8e5dbda15e6a8bb99de5d6008ac91 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 9 Sep 2025 14:18:05 -0700 Subject: [PATCH 091/113] Add newly available nvidia-nccl-cu13 to nvidia_wheels_cu13 (#952) --- cuda_pathfinder/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 1964dd762..bffb42a82 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -26,6 +26,7 @@ nvidia_wheels_cu12 = [ nvidia_wheels_cu13 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,nvvm]==13.*", "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", + "nvidia-nccl-cu13; sys_platform != 'win32'", "nvidia-nvshmem-cu13; sys_platform != 'win32'", ] nvidia_wheels_host = [ From 978154cbda55b92e5b91fe6e40895f86d9798d22 Mon Sep 17 00:00:00 2001 From: "Marcus D. Hanwell" Date: Wed, 10 Sep 2025 12:00:33 -0400 Subject: [PATCH 092/113] CI: Move to self-hosted Windows GPU runners (#958) Migrate the Windows testing to use the new NV GHA runners. --- .github/workflows/test-wheel-windows.yml | 46 +++--------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 8e18d553b..6fe2270c6 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -65,28 +65,23 @@ jobs: echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" test: - # TODO: switch to this once the self-hosted runners are ready - # name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, GPU ${{ matrix.GPU }} - name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }} + name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, GPU ${{ matrix.GPU }} # The build stage could fail but we want the CI to keep moving. needs: compute-matrix strategy: fail-fast: false matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} if: ${{ github.repository_owner == 'nvidia' && !cancelled() }} - # TODO: switch to self-hosted runners once they are ready - # runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1" - runs-on: 'cuda-python-windows-gpu-github' + runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1" steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - # TODO: use setup-proxy-cache once we have self-hosted Windows runners - # - name: Setup proxy cache - # uses: nv-gha-runners/setup-proxy-cache@main - # continue-on-error: true + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true - name: Update driver run: | @@ -95,21 +90,6 @@ jobs: - name: Ensure GPU is working run: nvidia-smi - # TODO: remove this block once self-hosted runners are ready - - name: Install Git for Windows - # the GPU runner image does not have Git Bash pre-installed... - env: - # doesn't seem there's an easy way to avoid hard-coding it? - GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe - run: | - Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" - # Self-extracting, see https://gitforwindows.org/zip-archives-extracting-the-released-archives.html - Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' - ls -l PortableGit - echo "$((Get-Location).Path)\\PortableGit\\bin" >> $env:GITHUB_PATH - $env:Path += ";$((Get-Location).Path)\\PortableGit\\bin" - bash --version - - name: Set environment variables env: BUILD_CUDA_VER: ${{ inputs.build-ctk-ver }} @@ -141,22 +121,6 @@ jobs: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - # TODO: remove this block once self-hosted runners are ready - - name: Install gh cli - # the GPU runner image does not have gh pre-installed... - env: - # doesn't seem there's an easy way to avoid hard-coding it? - GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi - run: | - Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' - $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" - foreach ($p in $GH_POSSIBLE_PATHS) { - echo "$p" >> $env:GITHUB_PATH - $env:Path += ";$p" - } - gh --version - - name: Install zstd # the GPU runner image does not have zstd pre-installed... and it's needed by actions/cache if: ${{ matrix.LOCAL_CTK == '1' }} From 6daacba9d29ad4b2d9f81da027a02675b73e7fb3 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Wed, 10 Sep 2025 11:26:35 -0700 Subject: [PATCH 093/113] Updates KernelAttributes to avoid possible dangling handles. (#957) * Updates KernelAttributes to avoid possible dangling handles. * Simplifies the caching logic in KernelAttributes. --- cuda_core/cuda/core/experimental/_module.py | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_module.py b/cuda_core/cuda/core/experimental/_module.py index 63bb6ff26..c659a8d78 100644 --- a/cuda_core/cuda/core/experimental/_module.py +++ b/cuda_core/cuda/core/experimental/_module.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 +import weakref from collections import namedtuple from typing import Optional, Union from warnings import warn @@ -60,12 +61,12 @@ class KernelAttributes: def __new__(self, *args, **kwargs): raise RuntimeError("KernelAttributes cannot be instantiated directly. Please use Kernel APIs.") - slots = ("_handle", "_cache", "_backend_version", "_loader") + slots = ("_kernel", "_cache", "_backend_version", "_loader") @classmethod - def _init(cls, handle): + def _init(cls, kernel): self = super().__new__(cls) - self._handle = handle + self._kernel = weakref.ref(kernel) self._cache = {} self._backend_version = "new" if (_py_major_ver >= 12 and _driver_ver >= 12000) else "old" @@ -74,20 +75,23 @@ def _init(cls, handle): def _get_cached_attribute(self, device_id: int, attribute: driver.CUfunction_attribute) -> int: """Helper function to get a cached attribute or fetch and cache it if not present.""" - if device_id in self._cache and attribute in self._cache[device_id]: - return self._cache[device_id][attribute] + cache_key = device_id, attribute + result = self._cache.get(cache_key, cache_key) + if result is not cache_key: + return result + kernel = self._kernel() + if kernel is None: + raise RuntimeError("Cannot access kernel attributes for expired Kernel object") if self._backend_version == "new": - result = handle_return(self._loader["attribute"](attribute, self._handle, device_id)) + result = handle_return(self._loader["attribute"](attribute, kernel._handle, device_id)) else: # "old" backend warn( "Device ID argument is ignored when getting attribute from kernel when cuda version < 12. ", RuntimeWarning, stacklevel=2, ) - result = handle_return(self._loader["attribute"](attribute, self._handle)) - if device_id not in self._cache: - self._cache[device_id] = {} - self._cache[device_id][attribute] = result + result = handle_return(self._loader["attribute"](attribute, kernel._handle)) + self._cache[cache_key] = result return result def max_threads_per_block(self, device_id: int = None) -> int: @@ -365,7 +369,7 @@ class Kernel: """ - __slots__ = ("_handle", "_module", "_attributes", "_occupancy") + __slots__ = ("_handle", "_module", "_attributes", "_occupancy", "__weakref__") def __new__(self, *args, **kwargs): raise RuntimeError("Kernel objects cannot be instantiated directly. Please use ObjectCode APIs.") @@ -385,7 +389,7 @@ def _from_obj(cls, obj, mod): def attributes(self) -> KernelAttributes: """Get the read-only attributes of this kernel.""" if self._attributes is None: - self._attributes = KernelAttributes._init(self._handle) + self._attributes = KernelAttributes._init(self) return self._attributes def _get_arguments_info(self, param_info=False) -> tuple[int, list[ParamInfo]]: From acfe6540e4240f5ccbbab2d58d974042f759ca84 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 10 Sep 2025 19:07:11 -0400 Subject: [PATCH 094/113] Fix #938: Call win32 APIs directly (#942) * Fix #938: Call win32 APIs directly * Address comments from PR * Address comments from PR * Remove APIs * Don't check return type * Address comments in PR --- .../cuda/bindings/_bindings/cydriver.pyx.in | 3898 +++++------------ .../cuda/bindings/_bindings/cynvrtc.pyx.in | 173 +- .../cuda/bindings/_internal/cufile_linux.pyx | 36 +- .../bindings/_internal/nvjitlink_linux.pyx | 36 +- .../bindings/_internal/nvjitlink_windows.pyx | 148 +- .../cuda/bindings/_internal/nvvm_linux.pyx | 36 +- .../cuda/bindings/_internal/nvvm_windows.pyx | 143 +- cuda_bindings/cuda/bindings/_lib/windll.pxd | 39 + .../docs/source/release/13.X.Y-notes.rst | 1 + cuda_bindings/pyproject.toml | 1 - 10 files changed, 1405 insertions(+), 3106 deletions(-) create mode 100644 cuda_bindings/cuda/bindings/_lib/windll.pxd diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 909c18e7d..6eba78880 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -4,12 +4,11 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os -import win32api -from pywintypes import error +cimport cuda.bindings._lib.windll as windll {{else}} cimport cuda.bindings._lib.dlfcn as dlfcn {{endif}} -from libc.stdint cimport intptr_t +from libc.stdint cimport intptr_t, uintptr_t import os import sys cimport cuda.bindings._bindings.loader as loader @@ -513,24 +512,19 @@ cdef int _cuPythonInit() except -1 nogil: {{endif}} {{if 'Windows' == platform.system()}} - LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 - try: - handle = win32api.LoadLibraryEx(path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except error as e: + handle = windll.LoadLibraryExW(path, NULL, windll.LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: raise RuntimeError('Failed to LoadLibraryEx ' + path) {{else}} handle = dlfcn.dlopen(bytes(path, encoding='utf-8'), dlfcn.RTLD_NOW) - if (handle == NULL): + if handle == NULL: raise RuntimeError('Failed to dlopen ' + path) {{endif}} # Get latest __cuGetProcAddress_v2 global __cuGetProcAddress_v2 {{if 'Windows' == platform.system()}} - try: - __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') - except: - pass + __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') {{else}} __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') {{endif}} @@ -2770,3886 +2764,2224 @@ cdef int _cuPythonInit() except -1 nogil: # Get all PTDS version of functions pass {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy_ptds') - except: - pass + global __cuMemcpy + __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy_ptds') {{endif}} {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer_ptds') - except: - pass + global __cuMemcpyPeer + __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer_ptds') {{endif}} {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') - except: - pass + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') {{endif}} {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') - except: - pass + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') {{endif}} {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') - except: - pass + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') {{endif}} {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') - except: - pass + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') {{endif}} {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') - except: - pass + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') {{endif}} {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') - except: - pass + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') {{endif}} {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') - except: - pass + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') {{endif}} {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') - except: - pass + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') {{endif}} {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') - except: - pass + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') {{endif}} {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') - except: - pass + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') {{endif}} {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') - except: - pass + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') {{endif}} {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') - except: - pass + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') {{endif}} {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') - except: - pass + global __cuMemcpyAsync + __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') {{endif}} {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') - except: - pass + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') {{endif}} {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - except: - pass + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') {{endif}} {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - except: - pass + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') {{endif}} {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - except: - pass + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') {{endif}} {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - except: - pass + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') {{endif}} {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - except: - pass + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') {{endif}} {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') - except: - pass + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') {{endif}} {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') - except: - pass + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') {{endif}} {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') - except: - pass + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') {{endif}} {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - try: - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') - except: - pass + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') {{endif}} {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - try: - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') - except: - pass + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') - except: - pass + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') {{endif}} {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') - except: - pass + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') {{endif}} {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') - except: - pass + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') {{endif}} {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') - except: - pass + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') {{endif}} {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') - except: - pass + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') {{endif}} {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') - except: - pass + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') {{endif}} {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') - except: - pass + global __cuMemsetD8Async + __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') {{endif}} {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') - except: - pass + global __cuMemsetD16Async + __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') {{endif}} {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') - except: - pass + global __cuMemsetD32Async + __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') {{endif}} {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') - except: - pass + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') {{endif}} {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') - except: - pass + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') {{endif}} {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') - except: - pass + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') {{endif}} {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') - except: - pass + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') {{endif}} {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') - except: - pass + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') {{endif}} {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') - except: - pass + global __cuMemFreeAsync + __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') {{endif}} {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') - except: - pass + global __cuMemAllocAsync + __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') {{endif}} {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') - except: - pass + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') - except: - pass + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') {{endif}} {{if 'cuMemPrefetchBatchAsync' in found_functions}} - try: - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') - except: - pass + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') {{endif}} {{if 'cuMemDiscardBatchAsync' in found_functions}} - try: - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') - except: - pass + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') {{endif}} {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - try: - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') - except: - pass + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') {{endif}} {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') - except: - pass + global __cuStreamGetPriority + __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') {{endif}} {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') - except: - pass + global __cuStreamGetDevice + __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') {{endif}} {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') - except: - pass + global __cuStreamGetFlags + __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') {{endif}} {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId_ptsz') - except: - pass + global __cuStreamGetId + __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId_ptsz') {{endif}} {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') - except: - pass + global __cuStreamGetCtx + __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') {{endif}} {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') - except: - pass + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') {{endif}} {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') - except: - pass + global __cuStreamWaitEvent + __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') {{endif}} {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') - except: - pass + global __cuStreamAddCallback + __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') {{endif}} {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') - except: - pass + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') {{endif}} {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') - except: - pass + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') {{endif}} {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') - except: - pass + global __cuStreamEndCapture + __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') {{endif}} {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') - except: - pass + global __cuStreamIsCapturing + __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - except: - pass + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - except: - pass + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') {{endif}} {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') - except: - pass + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') {{endif}} {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery_ptsz') - except: - pass + global __cuStreamQuery + __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery_ptsz') {{endif}} {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') - except: - pass + global __cuStreamSynchronize + __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') {{endif}} {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') - except: - pass + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') {{endif}} {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') - except: - pass + global __cuStreamGetAttribute + __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') {{endif}} {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') - except: - pass + global __cuStreamSetAttribute + __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') {{endif}} {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord_ptsz') - except: - pass + global __cuEventRecord + __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord_ptsz') {{endif}} {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') - except: - pass + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') {{endif}} {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - except: - pass + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') {{endif}} {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - except: - pass + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') {{endif}} {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') - except: - pass + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') {{endif}} {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') - except: - pass + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') {{endif}} {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') - except: - pass + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') {{endif}} {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') - except: - pass + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') {{endif}} {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') - except: - pass + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') {{endif}} {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel_ptsz') - except: - pass + global __cuLaunchKernel + __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel_ptsz') {{endif}} {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') - except: - pass + global __cuLaunchKernelEx + __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') {{endif}} {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') - except: - pass + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') {{endif}} {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') - except: - pass + global __cuLaunchHostFunc + __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') {{endif}} {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') - except: - pass + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') {{endif}} {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload_ptsz') - except: - pass + global __cuGraphUpload + __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload_ptsz') {{endif}} {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch_ptsz') - except: - pass + global __cuGraphLaunch + __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch_ptsz') {{endif}} {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') - except: - pass + global __cuGraphicsMapResources + __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') {{endif}} {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') - except: - pass + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') {{endif}} else: # Else get the regular version pass {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy') - except: - pass + global __cuMemcpy + __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy') {{endif}} {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer') - except: - pass + global __cuMemcpyPeer + __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer') {{endif}} {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2') - except: - pass + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2') {{endif}} {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2') - except: - pass + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2') {{endif}} {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2') - except: - pass + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2') {{endif}} {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2') - except: - pass + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2') {{endif}} {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2') - except: - pass + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2') {{endif}} {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2') - except: - pass + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2') {{endif}} {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2') - except: - pass + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2') {{endif}} {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2') - except: - pass + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2') {{endif}} {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2') - except: - pass + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2') {{endif}} {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') - except: - pass + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') {{endif}} {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2') - except: - pass + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2') {{endif}} {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer') - except: - pass + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer') {{endif}} {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync') - except: - pass + global __cuMemcpyAsync + __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync') {{endif}} {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync') - except: - pass + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync') {{endif}} {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') - except: - pass + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') {{endif}} {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') - except: - pass + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') {{endif}} {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') - except: - pass + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') {{endif}} {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') - except: - pass + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') {{endif}} {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') - except: - pass + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') {{endif}} {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') - except: - pass + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') {{endif}} {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') - except: - pass + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') {{endif}} {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') - except: - pass + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') {{endif}} {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - try: - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') - except: - pass + global __cuMemcpyBatchAsync_v2 + __cuMemcpyBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') {{endif}} {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - try: - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') - except: - pass + global __cuMemcpy3DBatchAsync_v2 + __cuMemcpy3DBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2') - except: - pass + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2') {{endif}} {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2') - except: - pass + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2') {{endif}} {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2') - except: - pass + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2') {{endif}} {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2') - except: - pass + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2') {{endif}} {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2') - except: - pass + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2') {{endif}} {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2') - except: - pass + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2') {{endif}} {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async') - except: - pass + global __cuMemsetD8Async + __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async') {{endif}} {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async') - except: - pass + global __cuMemsetD16Async + __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async') {{endif}} {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async') - except: - pass + global __cuMemsetD32Async + __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async') {{endif}} {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async') - except: - pass + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async') {{endif}} {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async') - except: - pass + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async') {{endif}} {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async') - except: - pass + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async') {{endif}} {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync') - except: - pass + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync') {{endif}} {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync') - except: - pass + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync') {{endif}} {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync') - except: - pass + global __cuMemFreeAsync + __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync') {{endif}} {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync') - except: - pass + global __cuMemAllocAsync + __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync') {{endif}} {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') - except: - pass + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') - except: - pass + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') {{endif}} {{if 'cuMemPrefetchBatchAsync' in found_functions}} - try: - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') - except: - pass + global __cuMemPrefetchBatchAsync + __cuMemPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') {{endif}} {{if 'cuMemDiscardBatchAsync' in found_functions}} - try: - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardBatchAsync') - except: - pass + global __cuMemDiscardBatchAsync + __cuMemDiscardBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardBatchAsync') {{endif}} {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - try: - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = win32api.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') - except: - pass + global __cuMemDiscardAndPrefetchBatchAsync + __cuMemDiscardAndPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') {{endif}} {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority') - except: - pass + global __cuStreamGetPriority + __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority') {{endif}} {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice') - except: - pass + global __cuStreamGetDevice + __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice') {{endif}} {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags') - except: - pass + global __cuStreamGetFlags + __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags') {{endif}} {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId') - except: - pass + global __cuStreamGetId + __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId') {{endif}} {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx') - except: - pass + global __cuStreamGetCtx + __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx') {{endif}} {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2') - except: - pass + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2') {{endif}} {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent') - except: - pass + global __cuStreamWaitEvent + __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent') {{endif}} {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback') - except: - pass + global __cuStreamAddCallback + __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback') {{endif}} {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2') - except: - pass + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2') {{endif}} {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') - except: - pass + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') {{endif}} {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture') - except: - pass + global __cuStreamEndCapture + __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture') {{endif}} {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing') - except: - pass + global __cuStreamIsCapturing + __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing') {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') - except: - pass + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') - except: - pass + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') {{endif}} {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync') - except: - pass + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync') {{endif}} {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery') - except: - pass + global __cuStreamQuery + __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery') {{endif}} {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize') - except: - pass + global __cuStreamSynchronize + __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize') {{endif}} {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes') - except: - pass + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes') {{endif}} {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute') - except: - pass + global __cuStreamGetAttribute + __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute') {{endif}} {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute') - except: - pass + global __cuStreamSetAttribute + __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute') {{endif}} {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord') - except: - pass + global __cuEventRecord + __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord') {{endif}} {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags') - except: - pass + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags') {{endif}} {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') - except: - pass + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') {{endif}} {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') - except: - pass + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') {{endif}} {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2') - except: - pass + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2') {{endif}} {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2') - except: - pass + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2') {{endif}} {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2') - except: - pass + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2') {{endif}} {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2') - except: - pass + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2') {{endif}} {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') - except: - pass + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') {{endif}} {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel') - except: - pass + global __cuLaunchKernel + __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel') {{endif}} {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx') - except: - pass + global __cuLaunchKernelEx + __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx') {{endif}} {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel') - except: - pass + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel') {{endif}} {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc') - except: - pass + global __cuLaunchHostFunc + __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc') {{endif}} {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams') - except: - pass + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams') {{endif}} {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload') - except: - pass + global __cuGraphUpload + __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload') {{endif}} {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch') - except: - pass + global __cuGraphLaunch + __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch') {{endif}} {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources') - except: - pass + global __cuGraphicsMapResources + __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources') {{endif}} {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources') - except: - pass + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources') {{endif}} # Get remaining functions {{if 'cuGetErrorString' in found_functions}} - try: - global __cuGetErrorString - __cuGetErrorString = win32api.GetProcAddress(handle, 'cuGetErrorString') - except: - pass + global __cuGetErrorString + __cuGetErrorString = windll.GetProcAddress(handle, 'cuGetErrorString') {{endif}} {{if 'cuGetErrorName' in found_functions}} - try: - global __cuGetErrorName - __cuGetErrorName = win32api.GetProcAddress(handle, 'cuGetErrorName') - except: - pass + global __cuGetErrorName + __cuGetErrorName = windll.GetProcAddress(handle, 'cuGetErrorName') {{endif}} {{if 'cuInit' in found_functions}} - try: - global __cuInit - __cuInit = win32api.GetProcAddress(handle, 'cuInit') - except: - pass + global __cuInit + __cuInit = windll.GetProcAddress(handle, 'cuInit') {{endif}} {{if 'cuDriverGetVersion' in found_functions}} - try: - global __cuDriverGetVersion - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - except: - pass + global __cuDriverGetVersion + __cuDriverGetVersion = windll.GetProcAddress(handle, 'cuDriverGetVersion') {{endif}} {{if 'cuDeviceGet' in found_functions}} - try: - global __cuDeviceGet - __cuDeviceGet = win32api.GetProcAddress(handle, 'cuDeviceGet') - except: - pass + global __cuDeviceGet + __cuDeviceGet = windll.GetProcAddress(handle, 'cuDeviceGet') {{endif}} {{if 'cuDeviceGetCount' in found_functions}} - try: - global __cuDeviceGetCount - __cuDeviceGetCount = win32api.GetProcAddress(handle, 'cuDeviceGetCount') - except: - pass + global __cuDeviceGetCount + __cuDeviceGetCount = windll.GetProcAddress(handle, 'cuDeviceGetCount') {{endif}} {{if 'cuDeviceGetName' in found_functions}} - try: - global __cuDeviceGetName - __cuDeviceGetName = win32api.GetProcAddress(handle, 'cuDeviceGetName') - except: - pass + global __cuDeviceGetName + __cuDeviceGetName = windll.GetProcAddress(handle, 'cuDeviceGetName') {{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}} - try: - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = win32api.GetProcAddress(handle, 'cuDeviceGetUuid_v2') - except: - pass + global __cuDeviceGetUuid_v2 + __cuDeviceGetUuid_v2 = windll.GetProcAddress(handle, 'cuDeviceGetUuid_v2') {{endif}} {{if 'cuDeviceGetLuid' in found_functions}} - try: - global __cuDeviceGetLuid - __cuDeviceGetLuid = win32api.GetProcAddress(handle, 'cuDeviceGetLuid') - except: - pass + global __cuDeviceGetLuid + __cuDeviceGetLuid = windll.GetProcAddress(handle, 'cuDeviceGetLuid') {{endif}} {{if 'cuDeviceTotalMem_v2' in found_functions}} - try: - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = win32api.GetProcAddress(handle, 'cuDeviceTotalMem_v2') - except: - pass + global __cuDeviceTotalMem_v2 + __cuDeviceTotalMem_v2 = windll.GetProcAddress(handle, 'cuDeviceTotalMem_v2') {{endif}} {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - try: - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = win32api.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - except: - pass + global __cuDeviceGetTexture1DLinearMaxWidth + __cuDeviceGetTexture1DLinearMaxWidth = windll.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') {{endif}} {{if 'cuDeviceGetAttribute' in found_functions}} - try: - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetAttribute') - except: - pass + global __cuDeviceGetAttribute + __cuDeviceGetAttribute = windll.GetProcAddress(handle, 'cuDeviceGetAttribute') {{endif}} {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - try: - global __cuDeviceGetHostAtomicCapabilities - __cuDeviceGetHostAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') - except: - pass + global __cuDeviceGetHostAtomicCapabilities + __cuDeviceGetHostAtomicCapabilities = windll.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') {{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - try: - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = win32api.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') - except: - pass + global __cuDeviceGetNvSciSyncAttributes + __cuDeviceGetNvSciSyncAttributes = windll.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') {{endif}} {{if 'cuDeviceSetMemPool' in found_functions}} - try: - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = win32api.GetProcAddress(handle, 'cuDeviceSetMemPool') - except: - pass + global __cuDeviceSetMemPool + __cuDeviceSetMemPool = windll.GetProcAddress(handle, 'cuDeviceSetMemPool') {{endif}} {{if 'cuDeviceGetMemPool' in found_functions}} - try: - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetMemPool') - except: - pass + global __cuDeviceGetMemPool + __cuDeviceGetMemPool = windll.GetProcAddress(handle, 'cuDeviceGetMemPool') {{endif}} {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - try: - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') - except: - pass + global __cuDeviceGetDefaultMemPool + __cuDeviceGetDefaultMemPool = windll.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') {{endif}} {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - try: - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = win32api.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') - except: - pass + global __cuDeviceGetExecAffinitySupport + __cuDeviceGetExecAffinitySupport = windll.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') {{endif}} {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - try: - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = win32api.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') - except: - pass + global __cuFlushGPUDirectRDMAWrites + __cuFlushGPUDirectRDMAWrites = windll.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') {{endif}} {{if 'cuDeviceGetProperties' in found_functions}} - try: - global __cuDeviceGetProperties - __cuDeviceGetProperties = win32api.GetProcAddress(handle, 'cuDeviceGetProperties') - except: - pass + global __cuDeviceGetProperties + __cuDeviceGetProperties = windll.GetProcAddress(handle, 'cuDeviceGetProperties') {{endif}} {{if 'cuDeviceComputeCapability' in found_functions}} - try: - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = win32api.GetProcAddress(handle, 'cuDeviceComputeCapability') - except: - pass + global __cuDeviceComputeCapability + __cuDeviceComputeCapability = windll.GetProcAddress(handle, 'cuDeviceComputeCapability') {{endif}} {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - try: - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') - except: - pass + global __cuDevicePrimaryCtxRetain + __cuDevicePrimaryCtxRetain = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') {{endif}} {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') - except: - pass + global __cuDevicePrimaryCtxRelease_v2 + __cuDevicePrimaryCtxRelease_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') {{endif}} {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') - except: - pass + global __cuDevicePrimaryCtxSetFlags_v2 + __cuDevicePrimaryCtxSetFlags_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') {{endif}} {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - try: - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') - except: - pass + global __cuDevicePrimaryCtxGetState + __cuDevicePrimaryCtxGetState = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') {{endif}} {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') - except: - pass + global __cuDevicePrimaryCtxReset_v2 + __cuDevicePrimaryCtxReset_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') {{endif}} {{if 'cuCtxCreate_v4' in found_functions}} - try: - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = win32api.GetProcAddress(handle, 'cuCtxCreate_v4') - except: - pass + global __cuCtxCreate_v4 + __cuCtxCreate_v4 = windll.GetProcAddress(handle, 'cuCtxCreate_v4') {{endif}} {{if 'cuCtxDestroy_v2' in found_functions}} - try: - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = win32api.GetProcAddress(handle, 'cuCtxDestroy_v2') - except: - pass + global __cuCtxDestroy_v2 + __cuCtxDestroy_v2 = windll.GetProcAddress(handle, 'cuCtxDestroy_v2') {{endif}} {{if 'cuCtxPushCurrent_v2' in found_functions}} - try: - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPushCurrent_v2') - except: - pass + global __cuCtxPushCurrent_v2 + __cuCtxPushCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPushCurrent_v2') {{endif}} {{if 'cuCtxPopCurrent_v2' in found_functions}} - try: - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPopCurrent_v2') - except: - pass + global __cuCtxPopCurrent_v2 + __cuCtxPopCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPopCurrent_v2') {{endif}} {{if 'cuCtxSetCurrent' in found_functions}} - try: - global __cuCtxSetCurrent - __cuCtxSetCurrent = win32api.GetProcAddress(handle, 'cuCtxSetCurrent') - except: - pass + global __cuCtxSetCurrent + __cuCtxSetCurrent = windll.GetProcAddress(handle, 'cuCtxSetCurrent') {{endif}} {{if 'cuCtxGetCurrent' in found_functions}} - try: - global __cuCtxGetCurrent - __cuCtxGetCurrent = win32api.GetProcAddress(handle, 'cuCtxGetCurrent') - except: - pass + global __cuCtxGetCurrent + __cuCtxGetCurrent = windll.GetProcAddress(handle, 'cuCtxGetCurrent') {{endif}} {{if 'cuCtxGetDevice' in found_functions}} - try: - global __cuCtxGetDevice - __cuCtxGetDevice = win32api.GetProcAddress(handle, 'cuCtxGetDevice') - except: - pass + global __cuCtxGetDevice + __cuCtxGetDevice = windll.GetProcAddress(handle, 'cuCtxGetDevice') {{endif}} {{if 'cuCtxGetDevice_v2' in found_functions}} - try: - global __cuCtxGetDevice_v2 - __cuCtxGetDevice_v2 = win32api.GetProcAddress(handle, 'cuCtxGetDevice_v2') - except: - pass + global __cuCtxGetDevice_v2 + __cuCtxGetDevice_v2 = windll.GetProcAddress(handle, 'cuCtxGetDevice_v2') {{endif}} {{if 'cuCtxGetFlags' in found_functions}} - try: - global __cuCtxGetFlags - __cuCtxGetFlags = win32api.GetProcAddress(handle, 'cuCtxGetFlags') - except: - pass + global __cuCtxGetFlags + __cuCtxGetFlags = windll.GetProcAddress(handle, 'cuCtxGetFlags') {{endif}} {{if 'cuCtxSetFlags' in found_functions}} - try: - global __cuCtxSetFlags - __cuCtxSetFlags = win32api.GetProcAddress(handle, 'cuCtxSetFlags') - except: - pass + global __cuCtxSetFlags + __cuCtxSetFlags = windll.GetProcAddress(handle, 'cuCtxSetFlags') {{endif}} {{if 'cuCtxGetId' in found_functions}} - try: - global __cuCtxGetId - __cuCtxGetId = win32api.GetProcAddress(handle, 'cuCtxGetId') - except: - pass + global __cuCtxGetId + __cuCtxGetId = windll.GetProcAddress(handle, 'cuCtxGetId') {{endif}} {{if 'cuCtxSynchronize' in found_functions}} - try: - global __cuCtxSynchronize - __cuCtxSynchronize = win32api.GetProcAddress(handle, 'cuCtxSynchronize') - except: - pass + global __cuCtxSynchronize + __cuCtxSynchronize = windll.GetProcAddress(handle, 'cuCtxSynchronize') {{endif}} {{if 'cuCtxSynchronize_v2' in found_functions}} - try: - global __cuCtxSynchronize_v2 - __cuCtxSynchronize_v2 = win32api.GetProcAddress(handle, 'cuCtxSynchronize_v2') - except: - pass + global __cuCtxSynchronize_v2 + __cuCtxSynchronize_v2 = windll.GetProcAddress(handle, 'cuCtxSynchronize_v2') {{endif}} {{if 'cuCtxSetLimit' in found_functions}} - try: - global __cuCtxSetLimit - __cuCtxSetLimit = win32api.GetProcAddress(handle, 'cuCtxSetLimit') - except: - pass + global __cuCtxSetLimit + __cuCtxSetLimit = windll.GetProcAddress(handle, 'cuCtxSetLimit') {{endif}} {{if 'cuCtxGetLimit' in found_functions}} - try: - global __cuCtxGetLimit - __cuCtxGetLimit = win32api.GetProcAddress(handle, 'cuCtxGetLimit') - except: - pass + global __cuCtxGetLimit + __cuCtxGetLimit = windll.GetProcAddress(handle, 'cuCtxGetLimit') {{endif}} {{if 'cuCtxGetCacheConfig' in found_functions}} - try: - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxGetCacheConfig') - except: - pass + global __cuCtxGetCacheConfig + __cuCtxGetCacheConfig = windll.GetProcAddress(handle, 'cuCtxGetCacheConfig') {{endif}} {{if 'cuCtxSetCacheConfig' in found_functions}} - try: - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxSetCacheConfig') - except: - pass + global __cuCtxSetCacheConfig + __cuCtxSetCacheConfig = windll.GetProcAddress(handle, 'cuCtxSetCacheConfig') {{endif}} {{if 'cuCtxGetApiVersion' in found_functions}} - try: - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = win32api.GetProcAddress(handle, 'cuCtxGetApiVersion') - except: - pass + global __cuCtxGetApiVersion + __cuCtxGetApiVersion = windll.GetProcAddress(handle, 'cuCtxGetApiVersion') {{endif}} {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - try: - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = win32api.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') - except: - pass + global __cuCtxGetStreamPriorityRange + __cuCtxGetStreamPriorityRange = windll.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') {{endif}} {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - try: - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = win32api.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') - except: - pass + global __cuCtxResetPersistingL2Cache + __cuCtxResetPersistingL2Cache = windll.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') {{endif}} {{if 'cuCtxGetExecAffinity' in found_functions}} - try: - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = win32api.GetProcAddress(handle, 'cuCtxGetExecAffinity') - except: - pass + global __cuCtxGetExecAffinity + __cuCtxGetExecAffinity = windll.GetProcAddress(handle, 'cuCtxGetExecAffinity') {{endif}} {{if 'cuCtxRecordEvent' in found_functions}} - try: - global __cuCtxRecordEvent - __cuCtxRecordEvent = win32api.GetProcAddress(handle, 'cuCtxRecordEvent') - except: - pass + global __cuCtxRecordEvent + __cuCtxRecordEvent = windll.GetProcAddress(handle, 'cuCtxRecordEvent') {{endif}} {{if 'cuCtxWaitEvent' in found_functions}} - try: - global __cuCtxWaitEvent - __cuCtxWaitEvent = win32api.GetProcAddress(handle, 'cuCtxWaitEvent') - except: - pass + global __cuCtxWaitEvent + __cuCtxWaitEvent = windll.GetProcAddress(handle, 'cuCtxWaitEvent') {{endif}} {{if 'cuCtxAttach' in found_functions}} - try: - global __cuCtxAttach - __cuCtxAttach = win32api.GetProcAddress(handle, 'cuCtxAttach') - except: - pass + global __cuCtxAttach + __cuCtxAttach = windll.GetProcAddress(handle, 'cuCtxAttach') {{endif}} {{if 'cuCtxDetach' in found_functions}} - try: - global __cuCtxDetach - __cuCtxDetach = win32api.GetProcAddress(handle, 'cuCtxDetach') - except: - pass + global __cuCtxDetach + __cuCtxDetach = windll.GetProcAddress(handle, 'cuCtxDetach') {{endif}} {{if 'cuCtxGetSharedMemConfig' in found_functions}} - try: - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') - except: - pass + global __cuCtxGetSharedMemConfig + __cuCtxGetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') {{endif}} {{if 'cuCtxSetSharedMemConfig' in found_functions}} - try: - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') - except: - pass + global __cuCtxSetSharedMemConfig + __cuCtxSetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') {{endif}} {{if 'cuModuleLoad' in found_functions}} - try: - global __cuModuleLoad - __cuModuleLoad = win32api.GetProcAddress(handle, 'cuModuleLoad') - except: - pass + global __cuModuleLoad + __cuModuleLoad = windll.GetProcAddress(handle, 'cuModuleLoad') {{endif}} {{if 'cuModuleLoadData' in found_functions}} - try: - global __cuModuleLoadData - __cuModuleLoadData = win32api.GetProcAddress(handle, 'cuModuleLoadData') - except: - pass + global __cuModuleLoadData + __cuModuleLoadData = windll.GetProcAddress(handle, 'cuModuleLoadData') {{endif}} {{if 'cuModuleLoadDataEx' in found_functions}} - try: - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = win32api.GetProcAddress(handle, 'cuModuleLoadDataEx') - except: - pass + global __cuModuleLoadDataEx + __cuModuleLoadDataEx = windll.GetProcAddress(handle, 'cuModuleLoadDataEx') {{endif}} {{if 'cuModuleLoadFatBinary' in found_functions}} - try: - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = win32api.GetProcAddress(handle, 'cuModuleLoadFatBinary') - except: - pass + global __cuModuleLoadFatBinary + __cuModuleLoadFatBinary = windll.GetProcAddress(handle, 'cuModuleLoadFatBinary') {{endif}} {{if 'cuModuleUnload' in found_functions}} - try: - global __cuModuleUnload - __cuModuleUnload = win32api.GetProcAddress(handle, 'cuModuleUnload') - except: - pass + global __cuModuleUnload + __cuModuleUnload = windll.GetProcAddress(handle, 'cuModuleUnload') {{endif}} {{if 'cuModuleGetLoadingMode' in found_functions}} - try: - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = win32api.GetProcAddress(handle, 'cuModuleGetLoadingMode') - except: - pass + global __cuModuleGetLoadingMode + __cuModuleGetLoadingMode = windll.GetProcAddress(handle, 'cuModuleGetLoadingMode') {{endif}} {{if 'cuModuleGetFunction' in found_functions}} - try: - global __cuModuleGetFunction - __cuModuleGetFunction = win32api.GetProcAddress(handle, 'cuModuleGetFunction') - except: - pass + global __cuModuleGetFunction + __cuModuleGetFunction = windll.GetProcAddress(handle, 'cuModuleGetFunction') {{endif}} {{if 'cuModuleGetFunctionCount' in found_functions}} - try: - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = win32api.GetProcAddress(handle, 'cuModuleGetFunctionCount') - except: - pass + global __cuModuleGetFunctionCount + __cuModuleGetFunctionCount = windll.GetProcAddress(handle, 'cuModuleGetFunctionCount') {{endif}} {{if 'cuModuleEnumerateFunctions' in found_functions}} - try: - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = win32api.GetProcAddress(handle, 'cuModuleEnumerateFunctions') - except: - pass + global __cuModuleEnumerateFunctions + __cuModuleEnumerateFunctions = windll.GetProcAddress(handle, 'cuModuleEnumerateFunctions') {{endif}} {{if 'cuModuleGetGlobal_v2' in found_functions}} - try: - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = win32api.GetProcAddress(handle, 'cuModuleGetGlobal_v2') - except: - pass + global __cuModuleGetGlobal_v2 + __cuModuleGetGlobal_v2 = windll.GetProcAddress(handle, 'cuModuleGetGlobal_v2') {{endif}} {{if 'cuLinkCreate_v2' in found_functions}} - try: - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = win32api.GetProcAddress(handle, 'cuLinkCreate_v2') - except: - pass + global __cuLinkCreate_v2 + __cuLinkCreate_v2 = windll.GetProcAddress(handle, 'cuLinkCreate_v2') {{endif}} {{if 'cuLinkAddData_v2' in found_functions}} - try: - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = win32api.GetProcAddress(handle, 'cuLinkAddData_v2') - except: - pass + global __cuLinkAddData_v2 + __cuLinkAddData_v2 = windll.GetProcAddress(handle, 'cuLinkAddData_v2') {{endif}} {{if 'cuLinkAddFile_v2' in found_functions}} - try: - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = win32api.GetProcAddress(handle, 'cuLinkAddFile_v2') - except: - pass + global __cuLinkAddFile_v2 + __cuLinkAddFile_v2 = windll.GetProcAddress(handle, 'cuLinkAddFile_v2') {{endif}} {{if 'cuLinkComplete' in found_functions}} - try: - global __cuLinkComplete - __cuLinkComplete = win32api.GetProcAddress(handle, 'cuLinkComplete') - except: - pass + global __cuLinkComplete + __cuLinkComplete = windll.GetProcAddress(handle, 'cuLinkComplete') {{endif}} {{if 'cuLinkDestroy' in found_functions}} - try: - global __cuLinkDestroy - __cuLinkDestroy = win32api.GetProcAddress(handle, 'cuLinkDestroy') - except: - pass + global __cuLinkDestroy + __cuLinkDestroy = windll.GetProcAddress(handle, 'cuLinkDestroy') {{endif}} {{if 'cuModuleGetTexRef' in found_functions}} - try: - global __cuModuleGetTexRef - __cuModuleGetTexRef = win32api.GetProcAddress(handle, 'cuModuleGetTexRef') - except: - pass + global __cuModuleGetTexRef + __cuModuleGetTexRef = windll.GetProcAddress(handle, 'cuModuleGetTexRef') {{endif}} {{if 'cuModuleGetSurfRef' in found_functions}} - try: - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = win32api.GetProcAddress(handle, 'cuModuleGetSurfRef') - except: - pass + global __cuModuleGetSurfRef + __cuModuleGetSurfRef = windll.GetProcAddress(handle, 'cuModuleGetSurfRef') {{endif}} {{if 'cuLibraryLoadData' in found_functions}} - try: - global __cuLibraryLoadData - __cuLibraryLoadData = win32api.GetProcAddress(handle, 'cuLibraryLoadData') - except: - pass + global __cuLibraryLoadData + __cuLibraryLoadData = windll.GetProcAddress(handle, 'cuLibraryLoadData') {{endif}} {{if 'cuLibraryLoadFromFile' in found_functions}} - try: - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = win32api.GetProcAddress(handle, 'cuLibraryLoadFromFile') - except: - pass + global __cuLibraryLoadFromFile + __cuLibraryLoadFromFile = windll.GetProcAddress(handle, 'cuLibraryLoadFromFile') {{endif}} {{if 'cuLibraryUnload' in found_functions}} - try: - global __cuLibraryUnload - __cuLibraryUnload = win32api.GetProcAddress(handle, 'cuLibraryUnload') - except: - pass + global __cuLibraryUnload + __cuLibraryUnload = windll.GetProcAddress(handle, 'cuLibraryUnload') {{endif}} {{if 'cuLibraryGetKernel' in found_functions}} - try: - global __cuLibraryGetKernel - __cuLibraryGetKernel = win32api.GetProcAddress(handle, 'cuLibraryGetKernel') - except: - pass + global __cuLibraryGetKernel + __cuLibraryGetKernel = windll.GetProcAddress(handle, 'cuLibraryGetKernel') {{endif}} {{if 'cuLibraryGetKernelCount' in found_functions}} - try: - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = win32api.GetProcAddress(handle, 'cuLibraryGetKernelCount') - except: - pass + global __cuLibraryGetKernelCount + __cuLibraryGetKernelCount = windll.GetProcAddress(handle, 'cuLibraryGetKernelCount') {{endif}} {{if 'cuLibraryEnumerateKernels' in found_functions}} - try: - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = win32api.GetProcAddress(handle, 'cuLibraryEnumerateKernels') - except: - pass + global __cuLibraryEnumerateKernels + __cuLibraryEnumerateKernels = windll.GetProcAddress(handle, 'cuLibraryEnumerateKernels') {{endif}} {{if 'cuLibraryGetModule' in found_functions}} - try: - global __cuLibraryGetModule - __cuLibraryGetModule = win32api.GetProcAddress(handle, 'cuLibraryGetModule') - except: - pass + global __cuLibraryGetModule + __cuLibraryGetModule = windll.GetProcAddress(handle, 'cuLibraryGetModule') {{endif}} {{if 'cuKernelGetFunction' in found_functions}} - try: - global __cuKernelGetFunction - __cuKernelGetFunction = win32api.GetProcAddress(handle, 'cuKernelGetFunction') - except: - pass + global __cuKernelGetFunction + __cuKernelGetFunction = windll.GetProcAddress(handle, 'cuKernelGetFunction') {{endif}} {{if 'cuKernelGetLibrary' in found_functions}} - try: - global __cuKernelGetLibrary - __cuKernelGetLibrary = win32api.GetProcAddress(handle, 'cuKernelGetLibrary') - except: - pass + global __cuKernelGetLibrary + __cuKernelGetLibrary = windll.GetProcAddress(handle, 'cuKernelGetLibrary') {{endif}} {{if 'cuLibraryGetGlobal' in found_functions}} - try: - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = win32api.GetProcAddress(handle, 'cuLibraryGetGlobal') - except: - pass + global __cuLibraryGetGlobal + __cuLibraryGetGlobal = windll.GetProcAddress(handle, 'cuLibraryGetGlobal') {{endif}} {{if 'cuLibraryGetManaged' in found_functions}} - try: - global __cuLibraryGetManaged - __cuLibraryGetManaged = win32api.GetProcAddress(handle, 'cuLibraryGetManaged') - except: - pass + global __cuLibraryGetManaged + __cuLibraryGetManaged = windll.GetProcAddress(handle, 'cuLibraryGetManaged') {{endif}} {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - try: - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = win32api.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') - except: - pass + global __cuLibraryGetUnifiedFunction + __cuLibraryGetUnifiedFunction = windll.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') {{endif}} {{if 'cuKernelGetAttribute' in found_functions}} - try: - global __cuKernelGetAttribute - __cuKernelGetAttribute = win32api.GetProcAddress(handle, 'cuKernelGetAttribute') - except: - pass + global __cuKernelGetAttribute + __cuKernelGetAttribute = windll.GetProcAddress(handle, 'cuKernelGetAttribute') {{endif}} {{if 'cuKernelSetAttribute' in found_functions}} - try: - global __cuKernelSetAttribute - __cuKernelSetAttribute = win32api.GetProcAddress(handle, 'cuKernelSetAttribute') - except: - pass + global __cuKernelSetAttribute + __cuKernelSetAttribute = windll.GetProcAddress(handle, 'cuKernelSetAttribute') {{endif}} {{if 'cuKernelSetCacheConfig' in found_functions}} - try: - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = win32api.GetProcAddress(handle, 'cuKernelSetCacheConfig') - except: - pass + global __cuKernelSetCacheConfig + __cuKernelSetCacheConfig = windll.GetProcAddress(handle, 'cuKernelSetCacheConfig') {{endif}} {{if 'cuKernelGetName' in found_functions}} - try: - global __cuKernelGetName - __cuKernelGetName = win32api.GetProcAddress(handle, 'cuKernelGetName') - except: - pass + global __cuKernelGetName + __cuKernelGetName = windll.GetProcAddress(handle, 'cuKernelGetName') {{endif}} {{if 'cuKernelGetParamInfo' in found_functions}} - try: - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = win32api.GetProcAddress(handle, 'cuKernelGetParamInfo') - except: - pass + global __cuKernelGetParamInfo + __cuKernelGetParamInfo = windll.GetProcAddress(handle, 'cuKernelGetParamInfo') {{endif}} {{if 'cuMemGetInfo_v2' in found_functions}} - try: - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = win32api.GetProcAddress(handle, 'cuMemGetInfo_v2') - except: - pass + global __cuMemGetInfo_v2 + __cuMemGetInfo_v2 = windll.GetProcAddress(handle, 'cuMemGetInfo_v2') {{endif}} {{if 'cuMemAlloc_v2' in found_functions}} - try: - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = win32api.GetProcAddress(handle, 'cuMemAlloc_v2') - except: - pass + global __cuMemAlloc_v2 + __cuMemAlloc_v2 = windll.GetProcAddress(handle, 'cuMemAlloc_v2') {{endif}} {{if 'cuMemAllocPitch_v2' in found_functions}} - try: - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = win32api.GetProcAddress(handle, 'cuMemAllocPitch_v2') - except: - pass + global __cuMemAllocPitch_v2 + __cuMemAllocPitch_v2 = windll.GetProcAddress(handle, 'cuMemAllocPitch_v2') {{endif}} {{if 'cuMemFree_v2' in found_functions}} - try: - global __cuMemFree_v2 - __cuMemFree_v2 = win32api.GetProcAddress(handle, 'cuMemFree_v2') - except: - pass + global __cuMemFree_v2 + __cuMemFree_v2 = windll.GetProcAddress(handle, 'cuMemFree_v2') {{endif}} {{if 'cuMemGetAddressRange_v2' in found_functions}} - try: - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = win32api.GetProcAddress(handle, 'cuMemGetAddressRange_v2') - except: - pass + global __cuMemGetAddressRange_v2 + __cuMemGetAddressRange_v2 = windll.GetProcAddress(handle, 'cuMemGetAddressRange_v2') {{endif}} {{if 'cuMemAllocHost_v2' in found_functions}} - try: - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = win32api.GetProcAddress(handle, 'cuMemAllocHost_v2') - except: - pass + global __cuMemAllocHost_v2 + __cuMemAllocHost_v2 = windll.GetProcAddress(handle, 'cuMemAllocHost_v2') {{endif}} {{if 'cuMemFreeHost' in found_functions}} - try: - global __cuMemFreeHost - __cuMemFreeHost = win32api.GetProcAddress(handle, 'cuMemFreeHost') - except: - pass + global __cuMemFreeHost + __cuMemFreeHost = windll.GetProcAddress(handle, 'cuMemFreeHost') {{endif}} {{if 'cuMemHostAlloc' in found_functions}} - try: - global __cuMemHostAlloc - __cuMemHostAlloc = win32api.GetProcAddress(handle, 'cuMemHostAlloc') - except: - pass + global __cuMemHostAlloc + __cuMemHostAlloc = windll.GetProcAddress(handle, 'cuMemHostAlloc') {{endif}} {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - try: - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = win32api.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') - except: - pass + global __cuMemHostGetDevicePointer_v2 + __cuMemHostGetDevicePointer_v2 = windll.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') {{endif}} {{if 'cuMemHostGetFlags' in found_functions}} - try: - global __cuMemHostGetFlags - __cuMemHostGetFlags = win32api.GetProcAddress(handle, 'cuMemHostGetFlags') - except: - pass + global __cuMemHostGetFlags + __cuMemHostGetFlags = windll.GetProcAddress(handle, 'cuMemHostGetFlags') {{endif}} {{if 'cuMemAllocManaged' in found_functions}} - try: - global __cuMemAllocManaged - __cuMemAllocManaged = win32api.GetProcAddress(handle, 'cuMemAllocManaged') - except: - pass + global __cuMemAllocManaged + __cuMemAllocManaged = windll.GetProcAddress(handle, 'cuMemAllocManaged') {{endif}} {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - try: - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') - except: - pass + global __cuDeviceRegisterAsyncNotification + __cuDeviceRegisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') {{endif}} {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - try: - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') - except: - pass + global __cuDeviceUnregisterAsyncNotification + __cuDeviceUnregisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') {{endif}} {{if 'cuDeviceGetByPCIBusId' in found_functions}} - try: - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') - except: - pass + global __cuDeviceGetByPCIBusId + __cuDeviceGetByPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') {{endif}} {{if 'cuDeviceGetPCIBusId' in found_functions}} - try: - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetPCIBusId') - except: - pass + global __cuDeviceGetPCIBusId + __cuDeviceGetPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetPCIBusId') {{endif}} {{if 'cuIpcGetEventHandle' in found_functions}} - try: - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = win32api.GetProcAddress(handle, 'cuIpcGetEventHandle') - except: - pass + global __cuIpcGetEventHandle + __cuIpcGetEventHandle = windll.GetProcAddress(handle, 'cuIpcGetEventHandle') {{endif}} {{if 'cuIpcOpenEventHandle' in found_functions}} - try: - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = win32api.GetProcAddress(handle, 'cuIpcOpenEventHandle') - except: - pass + global __cuIpcOpenEventHandle + __cuIpcOpenEventHandle = windll.GetProcAddress(handle, 'cuIpcOpenEventHandle') {{endif}} {{if 'cuIpcGetMemHandle' in found_functions}} - try: - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = win32api.GetProcAddress(handle, 'cuIpcGetMemHandle') - except: - pass + global __cuIpcGetMemHandle + __cuIpcGetMemHandle = windll.GetProcAddress(handle, 'cuIpcGetMemHandle') {{endif}} {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - try: - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = win32api.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') - except: - pass + global __cuIpcOpenMemHandle_v2 + __cuIpcOpenMemHandle_v2 = windll.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') {{endif}} {{if 'cuIpcCloseMemHandle' in found_functions}} - try: - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = win32api.GetProcAddress(handle, 'cuIpcCloseMemHandle') - except: - pass + global __cuIpcCloseMemHandle + __cuIpcCloseMemHandle = windll.GetProcAddress(handle, 'cuIpcCloseMemHandle') {{endif}} {{if 'cuMemHostRegister_v2' in found_functions}} - try: - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = win32api.GetProcAddress(handle, 'cuMemHostRegister_v2') - except: - pass + global __cuMemHostRegister_v2 + __cuMemHostRegister_v2 = windll.GetProcAddress(handle, 'cuMemHostRegister_v2') {{endif}} {{if 'cuMemHostUnregister' in found_functions}} - try: - global __cuMemHostUnregister - __cuMemHostUnregister = win32api.GetProcAddress(handle, 'cuMemHostUnregister') - except: - pass + global __cuMemHostUnregister + __cuMemHostUnregister = windll.GetProcAddress(handle, 'cuMemHostUnregister') {{endif}} {{if 'cuArrayCreate_v2' in found_functions}} - try: - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = win32api.GetProcAddress(handle, 'cuArrayCreate_v2') - except: - pass + global __cuArrayCreate_v2 + __cuArrayCreate_v2 = windll.GetProcAddress(handle, 'cuArrayCreate_v2') {{endif}} {{if 'cuArrayGetDescriptor_v2' in found_functions}} - try: - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') - except: - pass + global __cuArrayGetDescriptor_v2 + __cuArrayGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') {{endif}} {{if 'cuArrayGetSparseProperties' in found_functions}} - try: - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuArrayGetSparseProperties') - except: - pass + global __cuArrayGetSparseProperties + __cuArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuArrayGetSparseProperties') {{endif}} {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - try: - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') - except: - pass + global __cuMipmappedArrayGetSparseProperties + __cuMipmappedArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') {{endif}} {{if 'cuArrayGetMemoryRequirements' in found_functions}} - try: - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') - except: - pass + global __cuArrayGetMemoryRequirements + __cuArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') {{endif}} {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - try: - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') - except: - pass + global __cuMipmappedArrayGetMemoryRequirements + __cuMipmappedArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') {{endif}} {{if 'cuArrayGetPlane' in found_functions}} - try: - global __cuArrayGetPlane - __cuArrayGetPlane = win32api.GetProcAddress(handle, 'cuArrayGetPlane') - except: - pass + global __cuArrayGetPlane + __cuArrayGetPlane = windll.GetProcAddress(handle, 'cuArrayGetPlane') {{endif}} {{if 'cuArrayDestroy' in found_functions}} - try: - global __cuArrayDestroy - __cuArrayDestroy = win32api.GetProcAddress(handle, 'cuArrayDestroy') - except: - pass + global __cuArrayDestroy + __cuArrayDestroy = windll.GetProcAddress(handle, 'cuArrayDestroy') {{endif}} {{if 'cuArray3DCreate_v2' in found_functions}} - try: - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = win32api.GetProcAddress(handle, 'cuArray3DCreate_v2') - except: - pass + global __cuArray3DCreate_v2 + __cuArray3DCreate_v2 = windll.GetProcAddress(handle, 'cuArray3DCreate_v2') {{endif}} {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - try: - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') - except: - pass + global __cuArray3DGetDescriptor_v2 + __cuArray3DGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') {{endif}} {{if 'cuMipmappedArrayCreate' in found_functions}} - try: - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = win32api.GetProcAddress(handle, 'cuMipmappedArrayCreate') - except: - pass + global __cuMipmappedArrayCreate + __cuMipmappedArrayCreate = windll.GetProcAddress(handle, 'cuMipmappedArrayCreate') {{endif}} {{if 'cuMipmappedArrayGetLevel' in found_functions}} - try: - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') - except: - pass + global __cuMipmappedArrayGetLevel + __cuMipmappedArrayGetLevel = windll.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') {{endif}} {{if 'cuMipmappedArrayDestroy' in found_functions}} - try: - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = win32api.GetProcAddress(handle, 'cuMipmappedArrayDestroy') - except: - pass + global __cuMipmappedArrayDestroy + __cuMipmappedArrayDestroy = windll.GetProcAddress(handle, 'cuMipmappedArrayDestroy') {{endif}} {{if 'cuMemGetHandleForAddressRange' in found_functions}} - try: - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = win32api.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') - except: - pass + global __cuMemGetHandleForAddressRange + __cuMemGetHandleForAddressRange = windll.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') {{endif}} {{if 'cuMemAddressReserve' in found_functions}} - try: - global __cuMemAddressReserve - __cuMemAddressReserve = win32api.GetProcAddress(handle, 'cuMemAddressReserve') - except: - pass + global __cuMemAddressReserve + __cuMemAddressReserve = windll.GetProcAddress(handle, 'cuMemAddressReserve') {{endif}} {{if 'cuMemAddressFree' in found_functions}} - try: - global __cuMemAddressFree - __cuMemAddressFree = win32api.GetProcAddress(handle, 'cuMemAddressFree') - except: - pass + global __cuMemAddressFree + __cuMemAddressFree = windll.GetProcAddress(handle, 'cuMemAddressFree') {{endif}} {{if 'cuMemCreate' in found_functions}} - try: - global __cuMemCreate - __cuMemCreate = win32api.GetProcAddress(handle, 'cuMemCreate') - except: - pass + global __cuMemCreate + __cuMemCreate = windll.GetProcAddress(handle, 'cuMemCreate') {{endif}} {{if 'cuMemRelease' in found_functions}} - try: - global __cuMemRelease - __cuMemRelease = win32api.GetProcAddress(handle, 'cuMemRelease') - except: - pass + global __cuMemRelease + __cuMemRelease = windll.GetProcAddress(handle, 'cuMemRelease') {{endif}} {{if 'cuMemMap' in found_functions}} - try: - global __cuMemMap - __cuMemMap = win32api.GetProcAddress(handle, 'cuMemMap') - except: - pass + global __cuMemMap + __cuMemMap = windll.GetProcAddress(handle, 'cuMemMap') {{endif}} {{if 'cuMemUnmap' in found_functions}} - try: - global __cuMemUnmap - __cuMemUnmap = win32api.GetProcAddress(handle, 'cuMemUnmap') - except: - pass + global __cuMemUnmap + __cuMemUnmap = windll.GetProcAddress(handle, 'cuMemUnmap') {{endif}} {{if 'cuMemSetAccess' in found_functions}} - try: - global __cuMemSetAccess - __cuMemSetAccess = win32api.GetProcAddress(handle, 'cuMemSetAccess') - except: - pass + global __cuMemSetAccess + __cuMemSetAccess = windll.GetProcAddress(handle, 'cuMemSetAccess') {{endif}} {{if 'cuMemGetAccess' in found_functions}} - try: - global __cuMemGetAccess - __cuMemGetAccess = win32api.GetProcAddress(handle, 'cuMemGetAccess') - except: - pass + global __cuMemGetAccess + __cuMemGetAccess = windll.GetProcAddress(handle, 'cuMemGetAccess') {{endif}} {{if 'cuMemExportToShareableHandle' in found_functions}} - try: - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemExportToShareableHandle') - except: - pass + global __cuMemExportToShareableHandle + __cuMemExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemExportToShareableHandle') {{endif}} {{if 'cuMemImportFromShareableHandle' in found_functions}} - try: - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemImportFromShareableHandle') - except: - pass + global __cuMemImportFromShareableHandle + __cuMemImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemImportFromShareableHandle') {{endif}} {{if 'cuMemGetAllocationGranularity' in found_functions}} - try: - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = win32api.GetProcAddress(handle, 'cuMemGetAllocationGranularity') - except: - pass + global __cuMemGetAllocationGranularity + __cuMemGetAllocationGranularity = windll.GetProcAddress(handle, 'cuMemGetAllocationGranularity') {{endif}} {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - try: - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = win32api.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') - except: - pass + global __cuMemGetAllocationPropertiesFromHandle + __cuMemGetAllocationPropertiesFromHandle = windll.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') {{endif}} {{if 'cuMemRetainAllocationHandle' in found_functions}} - try: - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = win32api.GetProcAddress(handle, 'cuMemRetainAllocationHandle') - except: - pass + global __cuMemRetainAllocationHandle + __cuMemRetainAllocationHandle = windll.GetProcAddress(handle, 'cuMemRetainAllocationHandle') {{endif}} {{if 'cuMemPoolTrimTo' in found_functions}} - try: - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = win32api.GetProcAddress(handle, 'cuMemPoolTrimTo') - except: - pass + global __cuMemPoolTrimTo + __cuMemPoolTrimTo = windll.GetProcAddress(handle, 'cuMemPoolTrimTo') {{endif}} {{if 'cuMemPoolSetAttribute' in found_functions}} - try: - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolSetAttribute') - except: - pass + global __cuMemPoolSetAttribute + __cuMemPoolSetAttribute = windll.GetProcAddress(handle, 'cuMemPoolSetAttribute') {{endif}} {{if 'cuMemPoolGetAttribute' in found_functions}} - try: - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolGetAttribute') - except: - pass + global __cuMemPoolGetAttribute + __cuMemPoolGetAttribute = windll.GetProcAddress(handle, 'cuMemPoolGetAttribute') {{endif}} {{if 'cuMemPoolSetAccess' in found_functions}} - try: - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = win32api.GetProcAddress(handle, 'cuMemPoolSetAccess') - except: - pass + global __cuMemPoolSetAccess + __cuMemPoolSetAccess = windll.GetProcAddress(handle, 'cuMemPoolSetAccess') {{endif}} {{if 'cuMemPoolGetAccess' in found_functions}} - try: - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = win32api.GetProcAddress(handle, 'cuMemPoolGetAccess') - except: - pass + global __cuMemPoolGetAccess + __cuMemPoolGetAccess = windll.GetProcAddress(handle, 'cuMemPoolGetAccess') {{endif}} {{if 'cuMemPoolCreate' in found_functions}} - try: - global __cuMemPoolCreate - __cuMemPoolCreate = win32api.GetProcAddress(handle, 'cuMemPoolCreate') - except: - pass + global __cuMemPoolCreate + __cuMemPoolCreate = windll.GetProcAddress(handle, 'cuMemPoolCreate') {{endif}} {{if 'cuMemPoolDestroy' in found_functions}} - try: - global __cuMemPoolDestroy - __cuMemPoolDestroy = win32api.GetProcAddress(handle, 'cuMemPoolDestroy') - except: - pass + global __cuMemPoolDestroy + __cuMemPoolDestroy = windll.GetProcAddress(handle, 'cuMemPoolDestroy') {{endif}} {{if 'cuMemGetDefaultMemPool' in found_functions}} - try: - global __cuMemGetDefaultMemPool - __cuMemGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuMemGetDefaultMemPool') - except: - pass + global __cuMemGetDefaultMemPool + __cuMemGetDefaultMemPool = windll.GetProcAddress(handle, 'cuMemGetDefaultMemPool') {{endif}} {{if 'cuMemGetMemPool' in found_functions}} - try: - global __cuMemGetMemPool - __cuMemGetMemPool = win32api.GetProcAddress(handle, 'cuMemGetMemPool') - except: - pass + global __cuMemGetMemPool + __cuMemGetMemPool = windll.GetProcAddress(handle, 'cuMemGetMemPool') {{endif}} {{if 'cuMemSetMemPool' in found_functions}} - try: - global __cuMemSetMemPool - __cuMemSetMemPool = win32api.GetProcAddress(handle, 'cuMemSetMemPool') - except: - pass + global __cuMemSetMemPool + __cuMemSetMemPool = windll.GetProcAddress(handle, 'cuMemSetMemPool') {{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - try: - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') - except: - pass + global __cuMemPoolExportToShareableHandle + __cuMemPoolExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') {{endif}} {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - try: - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') - except: - pass + global __cuMemPoolImportFromShareableHandle + __cuMemPoolImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') {{endif}} {{if 'cuMemPoolExportPointer' in found_functions}} - try: - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = win32api.GetProcAddress(handle, 'cuMemPoolExportPointer') - except: - pass + global __cuMemPoolExportPointer + __cuMemPoolExportPointer = windll.GetProcAddress(handle, 'cuMemPoolExportPointer') {{endif}} {{if 'cuMemPoolImportPointer' in found_functions}} - try: - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = win32api.GetProcAddress(handle, 'cuMemPoolImportPointer') - except: - pass + global __cuMemPoolImportPointer + __cuMemPoolImportPointer = windll.GetProcAddress(handle, 'cuMemPoolImportPointer') {{endif}} {{if 'cuMulticastCreate' in found_functions}} - try: - global __cuMulticastCreate - __cuMulticastCreate = win32api.GetProcAddress(handle, 'cuMulticastCreate') - except: - pass + global __cuMulticastCreate + __cuMulticastCreate = windll.GetProcAddress(handle, 'cuMulticastCreate') {{endif}} {{if 'cuMulticastAddDevice' in found_functions}} - try: - global __cuMulticastAddDevice - __cuMulticastAddDevice = win32api.GetProcAddress(handle, 'cuMulticastAddDevice') - except: - pass + global __cuMulticastAddDevice + __cuMulticastAddDevice = windll.GetProcAddress(handle, 'cuMulticastAddDevice') {{endif}} {{if 'cuMulticastBindMem' in found_functions}} - try: - global __cuMulticastBindMem - __cuMulticastBindMem = win32api.GetProcAddress(handle, 'cuMulticastBindMem') - except: - pass + global __cuMulticastBindMem + __cuMulticastBindMem = windll.GetProcAddress(handle, 'cuMulticastBindMem') {{endif}} {{if 'cuMulticastBindAddr' in found_functions}} - try: - global __cuMulticastBindAddr - __cuMulticastBindAddr = win32api.GetProcAddress(handle, 'cuMulticastBindAddr') - except: - pass + global __cuMulticastBindAddr + __cuMulticastBindAddr = windll.GetProcAddress(handle, 'cuMulticastBindAddr') {{endif}} {{if 'cuMulticastUnbind' in found_functions}} - try: - global __cuMulticastUnbind - __cuMulticastUnbind = win32api.GetProcAddress(handle, 'cuMulticastUnbind') - except: - pass + global __cuMulticastUnbind + __cuMulticastUnbind = windll.GetProcAddress(handle, 'cuMulticastUnbind') {{endif}} {{if 'cuMulticastGetGranularity' in found_functions}} - try: - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = win32api.GetProcAddress(handle, 'cuMulticastGetGranularity') - except: - pass + global __cuMulticastGetGranularity + __cuMulticastGetGranularity = windll.GetProcAddress(handle, 'cuMulticastGetGranularity') {{endif}} {{if 'cuPointerGetAttribute' in found_functions}} - try: - global __cuPointerGetAttribute - __cuPointerGetAttribute = win32api.GetProcAddress(handle, 'cuPointerGetAttribute') - except: - pass + global __cuPointerGetAttribute + __cuPointerGetAttribute = windll.GetProcAddress(handle, 'cuPointerGetAttribute') {{endif}} {{if 'cuMemAdvise_v2' in found_functions}} - try: - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = win32api.GetProcAddress(handle, 'cuMemAdvise_v2') - except: - pass + global __cuMemAdvise_v2 + __cuMemAdvise_v2 = windll.GetProcAddress(handle, 'cuMemAdvise_v2') {{endif}} {{if 'cuMemRangeGetAttribute' in found_functions}} - try: - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = win32api.GetProcAddress(handle, 'cuMemRangeGetAttribute') - except: - pass + global __cuMemRangeGetAttribute + __cuMemRangeGetAttribute = windll.GetProcAddress(handle, 'cuMemRangeGetAttribute') {{endif}} {{if 'cuMemRangeGetAttributes' in found_functions}} - try: - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = win32api.GetProcAddress(handle, 'cuMemRangeGetAttributes') - except: - pass + global __cuMemRangeGetAttributes + __cuMemRangeGetAttributes = windll.GetProcAddress(handle, 'cuMemRangeGetAttributes') {{endif}} {{if 'cuPointerSetAttribute' in found_functions}} - try: - global __cuPointerSetAttribute - __cuPointerSetAttribute = win32api.GetProcAddress(handle, 'cuPointerSetAttribute') - except: - pass + global __cuPointerSetAttribute + __cuPointerSetAttribute = windll.GetProcAddress(handle, 'cuPointerSetAttribute') {{endif}} {{if 'cuPointerGetAttributes' in found_functions}} - try: - global __cuPointerGetAttributes - __cuPointerGetAttributes = win32api.GetProcAddress(handle, 'cuPointerGetAttributes') - except: - pass + global __cuPointerGetAttributes + __cuPointerGetAttributes = windll.GetProcAddress(handle, 'cuPointerGetAttributes') {{endif}} {{if 'cuStreamCreate' in found_functions}} - try: - global __cuStreamCreate - __cuStreamCreate = win32api.GetProcAddress(handle, 'cuStreamCreate') - except: - pass + global __cuStreamCreate + __cuStreamCreate = windll.GetProcAddress(handle, 'cuStreamCreate') {{endif}} {{if 'cuStreamCreateWithPriority' in found_functions}} - try: - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = win32api.GetProcAddress(handle, 'cuStreamCreateWithPriority') - except: - pass + global __cuStreamCreateWithPriority + __cuStreamCreateWithPriority = windll.GetProcAddress(handle, 'cuStreamCreateWithPriority') {{endif}} {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - try: - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = win32api.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') - except: - pass + global __cuThreadExchangeStreamCaptureMode + __cuThreadExchangeStreamCaptureMode = windll.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') {{endif}} {{if 'cuStreamDestroy_v2' in found_functions}} - try: - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = win32api.GetProcAddress(handle, 'cuStreamDestroy_v2') - except: - pass + global __cuStreamDestroy_v2 + __cuStreamDestroy_v2 = windll.GetProcAddress(handle, 'cuStreamDestroy_v2') {{endif}} {{if 'cuEventCreate' in found_functions}} - try: - global __cuEventCreate - __cuEventCreate = win32api.GetProcAddress(handle, 'cuEventCreate') - except: - pass + global __cuEventCreate + __cuEventCreate = windll.GetProcAddress(handle, 'cuEventCreate') {{endif}} {{if 'cuEventQuery' in found_functions}} - try: - global __cuEventQuery - __cuEventQuery = win32api.GetProcAddress(handle, 'cuEventQuery') - except: - pass + global __cuEventQuery + __cuEventQuery = windll.GetProcAddress(handle, 'cuEventQuery') {{endif}} {{if 'cuEventSynchronize' in found_functions}} - try: - global __cuEventSynchronize - __cuEventSynchronize = win32api.GetProcAddress(handle, 'cuEventSynchronize') - except: - pass + global __cuEventSynchronize + __cuEventSynchronize = windll.GetProcAddress(handle, 'cuEventSynchronize') {{endif}} {{if 'cuEventDestroy_v2' in found_functions}} - try: - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = win32api.GetProcAddress(handle, 'cuEventDestroy_v2') - except: - pass + global __cuEventDestroy_v2 + __cuEventDestroy_v2 = windll.GetProcAddress(handle, 'cuEventDestroy_v2') {{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}} - try: - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = win32api.GetProcAddress(handle, 'cuEventElapsedTime_v2') - except: - pass + global __cuEventElapsedTime_v2 + __cuEventElapsedTime_v2 = windll.GetProcAddress(handle, 'cuEventElapsedTime_v2') {{endif}} {{if 'cuImportExternalMemory' in found_functions}} - try: - global __cuImportExternalMemory - __cuImportExternalMemory = win32api.GetProcAddress(handle, 'cuImportExternalMemory') - except: - pass + global __cuImportExternalMemory + __cuImportExternalMemory = windll.GetProcAddress(handle, 'cuImportExternalMemory') {{endif}} {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - try: - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') - except: - pass + global __cuExternalMemoryGetMappedBuffer + __cuExternalMemoryGetMappedBuffer = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') {{endif}} {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - try: - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') - except: - pass + global __cuExternalMemoryGetMappedMipmappedArray + __cuExternalMemoryGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') {{endif}} {{if 'cuDestroyExternalMemory' in found_functions}} - try: - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = win32api.GetProcAddress(handle, 'cuDestroyExternalMemory') - except: - pass + global __cuDestroyExternalMemory + __cuDestroyExternalMemory = windll.GetProcAddress(handle, 'cuDestroyExternalMemory') {{endif}} {{if 'cuImportExternalSemaphore' in found_functions}} - try: - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = win32api.GetProcAddress(handle, 'cuImportExternalSemaphore') - except: - pass + global __cuImportExternalSemaphore + __cuImportExternalSemaphore = windll.GetProcAddress(handle, 'cuImportExternalSemaphore') {{endif}} {{if 'cuDestroyExternalSemaphore' in found_functions}} - try: - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = win32api.GetProcAddress(handle, 'cuDestroyExternalSemaphore') - except: - pass + global __cuDestroyExternalSemaphore + __cuDestroyExternalSemaphore = windll.GetProcAddress(handle, 'cuDestroyExternalSemaphore') {{endif}} {{if 'cuFuncGetAttribute' in found_functions}} - try: - global __cuFuncGetAttribute - __cuFuncGetAttribute = win32api.GetProcAddress(handle, 'cuFuncGetAttribute') - except: - pass + global __cuFuncGetAttribute + __cuFuncGetAttribute = windll.GetProcAddress(handle, 'cuFuncGetAttribute') {{endif}} {{if 'cuFuncSetAttribute' in found_functions}} - try: - global __cuFuncSetAttribute - __cuFuncSetAttribute = win32api.GetProcAddress(handle, 'cuFuncSetAttribute') - except: - pass + global __cuFuncSetAttribute + __cuFuncSetAttribute = windll.GetProcAddress(handle, 'cuFuncSetAttribute') {{endif}} {{if 'cuFuncSetCacheConfig' in found_functions}} - try: - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = win32api.GetProcAddress(handle, 'cuFuncSetCacheConfig') - except: - pass + global __cuFuncSetCacheConfig + __cuFuncSetCacheConfig = windll.GetProcAddress(handle, 'cuFuncSetCacheConfig') {{endif}} {{if 'cuFuncGetModule' in found_functions}} - try: - global __cuFuncGetModule - __cuFuncGetModule = win32api.GetProcAddress(handle, 'cuFuncGetModule') - except: - pass + global __cuFuncGetModule + __cuFuncGetModule = windll.GetProcAddress(handle, 'cuFuncGetModule') {{endif}} {{if 'cuFuncGetName' in found_functions}} - try: - global __cuFuncGetName - __cuFuncGetName = win32api.GetProcAddress(handle, 'cuFuncGetName') - except: - pass + global __cuFuncGetName + __cuFuncGetName = windll.GetProcAddress(handle, 'cuFuncGetName') {{endif}} {{if 'cuFuncGetParamInfo' in found_functions}} - try: - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = win32api.GetProcAddress(handle, 'cuFuncGetParamInfo') - except: - pass + global __cuFuncGetParamInfo + __cuFuncGetParamInfo = windll.GetProcAddress(handle, 'cuFuncGetParamInfo') {{endif}} {{if 'cuFuncIsLoaded' in found_functions}} - try: - global __cuFuncIsLoaded - __cuFuncIsLoaded = win32api.GetProcAddress(handle, 'cuFuncIsLoaded') - except: - pass + global __cuFuncIsLoaded + __cuFuncIsLoaded = windll.GetProcAddress(handle, 'cuFuncIsLoaded') {{endif}} {{if 'cuFuncLoad' in found_functions}} - try: - global __cuFuncLoad - __cuFuncLoad = win32api.GetProcAddress(handle, 'cuFuncLoad') - except: - pass + global __cuFuncLoad + __cuFuncLoad = windll.GetProcAddress(handle, 'cuFuncLoad') {{endif}} {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - try: - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') - except: - pass + global __cuLaunchCooperativeKernelMultiDevice + __cuLaunchCooperativeKernelMultiDevice = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') {{endif}} {{if 'cuFuncSetBlockShape' in found_functions}} - try: - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = win32api.GetProcAddress(handle, 'cuFuncSetBlockShape') - except: - pass + global __cuFuncSetBlockShape + __cuFuncSetBlockShape = windll.GetProcAddress(handle, 'cuFuncSetBlockShape') {{endif}} {{if 'cuFuncSetSharedSize' in found_functions}} - try: - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = win32api.GetProcAddress(handle, 'cuFuncSetSharedSize') - except: - pass + global __cuFuncSetSharedSize + __cuFuncSetSharedSize = windll.GetProcAddress(handle, 'cuFuncSetSharedSize') {{endif}} {{if 'cuParamSetSize' in found_functions}} - try: - global __cuParamSetSize - __cuParamSetSize = win32api.GetProcAddress(handle, 'cuParamSetSize') - except: - pass + global __cuParamSetSize + __cuParamSetSize = windll.GetProcAddress(handle, 'cuParamSetSize') {{endif}} {{if 'cuParamSeti' in found_functions}} - try: - global __cuParamSeti - __cuParamSeti = win32api.GetProcAddress(handle, 'cuParamSeti') - except: - pass + global __cuParamSeti + __cuParamSeti = windll.GetProcAddress(handle, 'cuParamSeti') {{endif}} {{if 'cuParamSetf' in found_functions}} - try: - global __cuParamSetf - __cuParamSetf = win32api.GetProcAddress(handle, 'cuParamSetf') - except: - pass + global __cuParamSetf + __cuParamSetf = windll.GetProcAddress(handle, 'cuParamSetf') {{endif}} {{if 'cuParamSetv' in found_functions}} - try: - global __cuParamSetv - __cuParamSetv = win32api.GetProcAddress(handle, 'cuParamSetv') - except: - pass + global __cuParamSetv + __cuParamSetv = windll.GetProcAddress(handle, 'cuParamSetv') {{endif}} {{if 'cuLaunch' in found_functions}} - try: - global __cuLaunch - __cuLaunch = win32api.GetProcAddress(handle, 'cuLaunch') - except: - pass + global __cuLaunch + __cuLaunch = windll.GetProcAddress(handle, 'cuLaunch') {{endif}} {{if 'cuLaunchGrid' in found_functions}} - try: - global __cuLaunchGrid - __cuLaunchGrid = win32api.GetProcAddress(handle, 'cuLaunchGrid') - except: - pass + global __cuLaunchGrid + __cuLaunchGrid = windll.GetProcAddress(handle, 'cuLaunchGrid') {{endif}} {{if 'cuLaunchGridAsync' in found_functions}} - try: - global __cuLaunchGridAsync - __cuLaunchGridAsync = win32api.GetProcAddress(handle, 'cuLaunchGridAsync') - except: - pass + global __cuLaunchGridAsync + __cuLaunchGridAsync = windll.GetProcAddress(handle, 'cuLaunchGridAsync') {{endif}} {{if 'cuParamSetTexRef' in found_functions}} - try: - global __cuParamSetTexRef - __cuParamSetTexRef = win32api.GetProcAddress(handle, 'cuParamSetTexRef') - except: - pass + global __cuParamSetTexRef + __cuParamSetTexRef = windll.GetProcAddress(handle, 'cuParamSetTexRef') {{endif}} {{if 'cuFuncSetSharedMemConfig' in found_functions}} - try: - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') - except: - pass + global __cuFuncSetSharedMemConfig + __cuFuncSetSharedMemConfig = windll.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') {{endif}} {{if 'cuGraphCreate' in found_functions}} - try: - global __cuGraphCreate - __cuGraphCreate = win32api.GetProcAddress(handle, 'cuGraphCreate') - except: - pass + global __cuGraphCreate + __cuGraphCreate = windll.GetProcAddress(handle, 'cuGraphCreate') {{endif}} {{if 'cuGraphAddKernelNode_v2' in found_functions}} - try: - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') - except: - pass + global __cuGraphAddKernelNode_v2 + __cuGraphAddKernelNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') {{endif}} {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') - except: - pass + global __cuGraphKernelNodeGetParams_v2 + __cuGraphKernelNodeGetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') {{endif}} {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') - except: - pass + global __cuGraphKernelNodeSetParams_v2 + __cuGraphKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') {{endif}} {{if 'cuGraphAddMemcpyNode' in found_functions}} - try: - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = win32api.GetProcAddress(handle, 'cuGraphAddMemcpyNode') - except: - pass + global __cuGraphAddMemcpyNode + __cuGraphAddMemcpyNode = windll.GetProcAddress(handle, 'cuGraphAddMemcpyNode') {{endif}} {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') - except: - pass + global __cuGraphMemcpyNodeGetParams + __cuGraphMemcpyNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') {{endif}} {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') - except: - pass + global __cuGraphMemcpyNodeSetParams + __cuGraphMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') {{endif}} {{if 'cuGraphAddMemsetNode' in found_functions}} - try: - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = win32api.GetProcAddress(handle, 'cuGraphAddMemsetNode') - except: - pass + global __cuGraphAddMemsetNode + __cuGraphAddMemsetNode = windll.GetProcAddress(handle, 'cuGraphAddMemsetNode') {{endif}} {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - try: - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') - except: - pass + global __cuGraphMemsetNodeGetParams + __cuGraphMemsetNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') {{endif}} {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') - except: - pass + global __cuGraphMemsetNodeSetParams + __cuGraphMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') {{endif}} {{if 'cuGraphAddHostNode' in found_functions}} - try: - global __cuGraphAddHostNode - __cuGraphAddHostNode = win32api.GetProcAddress(handle, 'cuGraphAddHostNode') - except: - pass + global __cuGraphAddHostNode + __cuGraphAddHostNode = windll.GetProcAddress(handle, 'cuGraphAddHostNode') {{endif}} {{if 'cuGraphHostNodeGetParams' in found_functions}} - try: - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeGetParams') - except: - pass + global __cuGraphHostNodeGetParams + __cuGraphHostNodeGetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeGetParams') {{endif}} {{if 'cuGraphHostNodeSetParams' in found_functions}} - try: - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeSetParams') - except: - pass + global __cuGraphHostNodeSetParams + __cuGraphHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeSetParams') {{endif}} {{if 'cuGraphAddChildGraphNode' in found_functions}} - try: - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = win32api.GetProcAddress(handle, 'cuGraphAddChildGraphNode') - except: - pass + global __cuGraphAddChildGraphNode + __cuGraphAddChildGraphNode = windll.GetProcAddress(handle, 'cuGraphAddChildGraphNode') {{endif}} {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - try: - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = win32api.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') - except: - pass + global __cuGraphChildGraphNodeGetGraph + __cuGraphChildGraphNodeGetGraph = windll.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') {{endif}} {{if 'cuGraphAddEmptyNode' in found_functions}} - try: - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = win32api.GetProcAddress(handle, 'cuGraphAddEmptyNode') - except: - pass + global __cuGraphAddEmptyNode + __cuGraphAddEmptyNode = windll.GetProcAddress(handle, 'cuGraphAddEmptyNode') {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - try: - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = win32api.GetProcAddress(handle, 'cuGraphAddEventRecordNode') - except: - pass + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + __cuGraphAddEventRecordNode = windll.GetProcAddress(handle, 'cuGraphAddEventRecordNode') {{endif}} {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') - except: - pass + global __cuGraphEventRecordNodeGetEvent + __cuGraphEventRecordNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') {{endif}} {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') - except: - pass + global __cuGraphEventRecordNodeSetEvent + __cuGraphEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') {{endif}} {{if 'cuGraphAddEventWaitNode' in found_functions}} - try: - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddEventWaitNode') - except: - pass + global __cuGraphAddEventWaitNode + __cuGraphAddEventWaitNode = windll.GetProcAddress(handle, 'cuGraphAddEventWaitNode') {{endif}} {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') - except: - pass + global __cuGraphEventWaitNodeGetEvent + __cuGraphEventWaitNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') {{endif}} {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') - except: - pass + global __cuGraphEventWaitNodeSetEvent + __cuGraphEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') {{endif}} {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') - except: - pass + global __cuGraphAddExternalSemaphoresSignalNode + __cuGraphAddExternalSemaphoresSignalNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') {{endif}} {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - except: - pass + global __cuGraphExternalSemaphoresSignalNodeGetParams + __cuGraphExternalSemaphoresSignalNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') {{endif}} {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - except: - pass + global __cuGraphExternalSemaphoresSignalNodeSetParams + __cuGraphExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') {{endif}} {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') - except: - pass + global __cuGraphAddExternalSemaphoresWaitNode + __cuGraphAddExternalSemaphoresWaitNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') {{endif}} {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - except: - pass + global __cuGraphExternalSemaphoresWaitNodeGetParams + __cuGraphExternalSemaphoresWaitNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') {{endif}} {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - except: - pass + global __cuGraphExternalSemaphoresWaitNodeSetParams + __cuGraphExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') {{endif}} {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - try: - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = win32api.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') - except: - pass + global __cuGraphAddBatchMemOpNode + __cuGraphAddBatchMemOpNode = windll.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') {{endif}} {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') - except: - pass + global __cuGraphBatchMemOpNodeGetParams + __cuGraphBatchMemOpNodeGetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') {{endif}} {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') - except: - pass + global __cuGraphBatchMemOpNodeSetParams + __cuGraphBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') {{endif}} {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') - except: - pass + global __cuGraphExecBatchMemOpNodeSetParams + __cuGraphExecBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') {{endif}} {{if 'cuGraphAddMemAllocNode' in found_functions}} - try: - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = win32api.GetProcAddress(handle, 'cuGraphAddMemAllocNode') - except: - pass + global __cuGraphAddMemAllocNode + __cuGraphAddMemAllocNode = windll.GetProcAddress(handle, 'cuGraphAddMemAllocNode') {{endif}} {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - try: - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') - except: - pass + global __cuGraphMemAllocNodeGetParams + __cuGraphMemAllocNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') {{endif}} {{if 'cuGraphAddMemFreeNode' in found_functions}} - try: - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = win32api.GetProcAddress(handle, 'cuGraphAddMemFreeNode') - except: - pass + global __cuGraphAddMemFreeNode + __cuGraphAddMemFreeNode = windll.GetProcAddress(handle, 'cuGraphAddMemFreeNode') {{endif}} {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - try: - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') - except: - pass + global __cuGraphMemFreeNodeGetParams + __cuGraphMemFreeNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') {{endif}} {{if 'cuDeviceGraphMemTrim' in found_functions}} - try: - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = win32api.GetProcAddress(handle, 'cuDeviceGraphMemTrim') - except: - pass + global __cuDeviceGraphMemTrim + __cuDeviceGraphMemTrim = windll.GetProcAddress(handle, 'cuDeviceGraphMemTrim') {{endif}} {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') - except: - pass + global __cuDeviceGetGraphMemAttribute + __cuDeviceGetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') {{endif}} {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') - except: - pass + global __cuDeviceSetGraphMemAttribute + __cuDeviceSetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') {{endif}} {{if 'cuGraphClone' in found_functions}} - try: - global __cuGraphClone - __cuGraphClone = win32api.GetProcAddress(handle, 'cuGraphClone') - except: - pass + global __cuGraphClone + __cuGraphClone = windll.GetProcAddress(handle, 'cuGraphClone') {{endif}} {{if 'cuGraphNodeFindInClone' in found_functions}} - try: - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = win32api.GetProcAddress(handle, 'cuGraphNodeFindInClone') - except: - pass + global __cuGraphNodeFindInClone + __cuGraphNodeFindInClone = windll.GetProcAddress(handle, 'cuGraphNodeFindInClone') {{endif}} {{if 'cuGraphNodeGetType' in found_functions}} - try: - global __cuGraphNodeGetType - __cuGraphNodeGetType = win32api.GetProcAddress(handle, 'cuGraphNodeGetType') - except: - pass + global __cuGraphNodeGetType + __cuGraphNodeGetType = windll.GetProcAddress(handle, 'cuGraphNodeGetType') {{endif}} {{if 'cuGraphGetNodes' in found_functions}} - try: - global __cuGraphGetNodes - __cuGraphGetNodes = win32api.GetProcAddress(handle, 'cuGraphGetNodes') - except: - pass + global __cuGraphGetNodes + __cuGraphGetNodes = windll.GetProcAddress(handle, 'cuGraphGetNodes') {{endif}} {{if 'cuGraphGetRootNodes' in found_functions}} - try: - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = win32api.GetProcAddress(handle, 'cuGraphGetRootNodes') - except: - pass + global __cuGraphGetRootNodes + __cuGraphGetRootNodes = windll.GetProcAddress(handle, 'cuGraphGetRootNodes') {{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}} - try: - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = win32api.GetProcAddress(handle, 'cuGraphGetEdges_v2') - except: - pass + global __cuGraphGetEdges_v2 + __cuGraphGetEdges_v2 = windll.GetProcAddress(handle, 'cuGraphGetEdges_v2') {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - try: - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') - except: - pass + global __cuGraphNodeGetDependencies_v2 + __cuGraphNodeGetDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - try: - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') - except: - pass + global __cuGraphNodeGetDependentNodes_v2 + __cuGraphNodeGetDependentNodes_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} - try: - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphAddDependencies_v2') - except: - pass + global __cuGraphAddDependencies_v2 + __cuGraphAddDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphAddDependencies_v2') {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - try: - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') - except: - pass + global __cuGraphRemoveDependencies_v2 + __cuGraphRemoveDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') {{endif}} {{if 'cuGraphDestroyNode' in found_functions}} - try: - global __cuGraphDestroyNode - __cuGraphDestroyNode = win32api.GetProcAddress(handle, 'cuGraphDestroyNode') - except: - pass + global __cuGraphDestroyNode + __cuGraphDestroyNode = windll.GetProcAddress(handle, 'cuGraphDestroyNode') {{endif}} {{if 'cuGraphInstantiateWithFlags' in found_functions}} - try: - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') - except: - pass + global __cuGraphInstantiateWithFlags + __cuGraphInstantiateWithFlags = windll.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') {{endif}} {{if 'cuGraphExecGetFlags' in found_functions}} - try: - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = win32api.GetProcAddress(handle, 'cuGraphExecGetFlags') - except: - pass + global __cuGraphExecGetFlags + __cuGraphExecGetFlags = windll.GetProcAddress(handle, 'cuGraphExecGetFlags') {{endif}} {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') - except: - pass + global __cuGraphExecKernelNodeSetParams_v2 + __cuGraphExecKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') {{endif}} {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') - except: - pass + global __cuGraphExecMemcpyNodeSetParams + __cuGraphExecMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') {{endif}} {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') - except: - pass + global __cuGraphExecMemsetNodeSetParams + __cuGraphExecMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') {{endif}} {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - try: - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') - except: - pass + global __cuGraphExecHostNodeSetParams + __cuGraphExecHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') {{endif}} {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - try: - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') - except: - pass + global __cuGraphExecChildGraphNodeSetParams + __cuGraphExecChildGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') {{endif}} {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') - except: - pass + global __cuGraphExecEventRecordNodeSetEvent + __cuGraphExecEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') {{endif}} {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') - except: - pass + global __cuGraphExecEventWaitNodeSetEvent + __cuGraphExecEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') {{endif}} {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - except: - pass + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + __cuGraphExecExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') {{endif}} {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - except: - pass + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + __cuGraphExecExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') {{endif}} {{if 'cuGraphNodeSetEnabled' in found_functions}} - try: - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeSetEnabled') - except: - pass + global __cuGraphNodeSetEnabled + __cuGraphNodeSetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeSetEnabled') {{endif}} {{if 'cuGraphNodeGetEnabled' in found_functions}} - try: - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeGetEnabled') - except: - pass + global __cuGraphNodeGetEnabled + __cuGraphNodeGetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeGetEnabled') {{endif}} {{if 'cuGraphExecDestroy' in found_functions}} - try: - global __cuGraphExecDestroy - __cuGraphExecDestroy = win32api.GetProcAddress(handle, 'cuGraphExecDestroy') - except: - pass + global __cuGraphExecDestroy + __cuGraphExecDestroy = windll.GetProcAddress(handle, 'cuGraphExecDestroy') {{endif}} {{if 'cuGraphDestroy' in found_functions}} - try: - global __cuGraphDestroy - __cuGraphDestroy = win32api.GetProcAddress(handle, 'cuGraphDestroy') - except: - pass + global __cuGraphDestroy + __cuGraphDestroy = windll.GetProcAddress(handle, 'cuGraphDestroy') {{endif}} {{if 'cuGraphExecUpdate_v2' in found_functions}} - try: - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = win32api.GetProcAddress(handle, 'cuGraphExecUpdate_v2') - except: - pass + global __cuGraphExecUpdate_v2 + __cuGraphExecUpdate_v2 = windll.GetProcAddress(handle, 'cuGraphExecUpdate_v2') {{endif}} {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - try: - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = win32api.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') - except: - pass + global __cuGraphKernelNodeCopyAttributes + __cuGraphKernelNodeCopyAttributes = windll.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') {{endif}} {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') - except: - pass + global __cuGraphKernelNodeGetAttribute + __cuGraphKernelNodeGetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') {{endif}} {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') - except: - pass + global __cuGraphKernelNodeSetAttribute + __cuGraphKernelNodeSetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') {{endif}} {{if 'cuGraphDebugDotPrint' in found_functions}} - try: - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = win32api.GetProcAddress(handle, 'cuGraphDebugDotPrint') - except: - pass + global __cuGraphDebugDotPrint + __cuGraphDebugDotPrint = windll.GetProcAddress(handle, 'cuGraphDebugDotPrint') {{endif}} {{if 'cuUserObjectCreate' in found_functions}} - try: - global __cuUserObjectCreate - __cuUserObjectCreate = win32api.GetProcAddress(handle, 'cuUserObjectCreate') - except: - pass + global __cuUserObjectCreate + __cuUserObjectCreate = windll.GetProcAddress(handle, 'cuUserObjectCreate') {{endif}} {{if 'cuUserObjectRetain' in found_functions}} - try: - global __cuUserObjectRetain - __cuUserObjectRetain = win32api.GetProcAddress(handle, 'cuUserObjectRetain') - except: - pass + global __cuUserObjectRetain + __cuUserObjectRetain = windll.GetProcAddress(handle, 'cuUserObjectRetain') {{endif}} {{if 'cuUserObjectRelease' in found_functions}} - try: - global __cuUserObjectRelease - __cuUserObjectRelease = win32api.GetProcAddress(handle, 'cuUserObjectRelease') - except: - pass + global __cuUserObjectRelease + __cuUserObjectRelease = windll.GetProcAddress(handle, 'cuUserObjectRelease') {{endif}} {{if 'cuGraphRetainUserObject' in found_functions}} - try: - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = win32api.GetProcAddress(handle, 'cuGraphRetainUserObject') - except: - pass + global __cuGraphRetainUserObject + __cuGraphRetainUserObject = windll.GetProcAddress(handle, 'cuGraphRetainUserObject') {{endif}} {{if 'cuGraphReleaseUserObject' in found_functions}} - try: - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = win32api.GetProcAddress(handle, 'cuGraphReleaseUserObject') - except: - pass + global __cuGraphReleaseUserObject + __cuGraphReleaseUserObject = windll.GetProcAddress(handle, 'cuGraphReleaseUserObject') {{endif}} {{if 'cuGraphAddNode_v2' in found_functions}} - try: - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddNode_v2') - except: - pass + global __cuGraphAddNode_v2 + __cuGraphAddNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddNode_v2') {{endif}} {{if 'cuGraphNodeSetParams' in found_functions}} - try: - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphNodeSetParams') - except: - pass + global __cuGraphNodeSetParams + __cuGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphNodeSetParams') {{endif}} {{if 'cuGraphExecNodeSetParams' in found_functions}} - try: - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecNodeSetParams') - except: - pass + global __cuGraphExecNodeSetParams + __cuGraphExecNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecNodeSetParams') {{endif}} {{if 'cuGraphConditionalHandleCreate' in found_functions}} - try: - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = win32api.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') - except: - pass + global __cuGraphConditionalHandleCreate + __cuGraphConditionalHandleCreate = windll.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') {{endif}} {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - except: - pass + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + __cuOccupancyMaxActiveBlocksPerMultiprocessor = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') {{endif}} {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - except: - pass + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') {{endif}} {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') - except: - pass + global __cuOccupancyMaxPotentialBlockSize + __cuOccupancyMaxPotentialBlockSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') {{endif}} {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - except: - pass + global __cuOccupancyMaxPotentialBlockSizeWithFlags + __cuOccupancyMaxPotentialBlockSizeWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') {{endif}} {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - try: - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = win32api.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - except: - pass + global __cuOccupancyAvailableDynamicSMemPerBlock + __cuOccupancyAvailableDynamicSMemPerBlock = windll.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') {{endif}} {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') - except: - pass + global __cuOccupancyMaxPotentialClusterSize + __cuOccupancyMaxPotentialClusterSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') {{endif}} {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - try: - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') - except: - pass + global __cuOccupancyMaxActiveClusters + __cuOccupancyMaxActiveClusters = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') {{endif}} {{if 'cuTexRefSetArray' in found_functions}} - try: - global __cuTexRefSetArray - __cuTexRefSetArray = win32api.GetProcAddress(handle, 'cuTexRefSetArray') - except: - pass + global __cuTexRefSetArray + __cuTexRefSetArray = windll.GetProcAddress(handle, 'cuTexRefSetArray') {{endif}} {{if 'cuTexRefSetMipmappedArray' in found_functions}} - try: - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') - except: - pass + global __cuTexRefSetMipmappedArray + __cuTexRefSetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') {{endif}} {{if 'cuTexRefSetAddress_v2' in found_functions}} - try: - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress_v2') - except: - pass + global __cuTexRefSetAddress_v2 + __cuTexRefSetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefSetAddress_v2') {{endif}} {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - try: - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') - except: - pass + global __cuTexRefSetAddress2D_v3 + __cuTexRefSetAddress2D_v3 = windll.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') {{endif}} {{if 'cuTexRefSetFormat' in found_functions}} - try: - global __cuTexRefSetFormat - __cuTexRefSetFormat = win32api.GetProcAddress(handle, 'cuTexRefSetFormat') - except: - pass + global __cuTexRefSetFormat + __cuTexRefSetFormat = windll.GetProcAddress(handle, 'cuTexRefSetFormat') {{endif}} {{if 'cuTexRefSetAddressMode' in found_functions}} - try: - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefSetAddressMode') - except: - pass + global __cuTexRefSetAddressMode + __cuTexRefSetAddressMode = windll.GetProcAddress(handle, 'cuTexRefSetAddressMode') {{endif}} {{if 'cuTexRefSetFilterMode' in found_functions}} - try: - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetFilterMode') - except: - pass + global __cuTexRefSetFilterMode + __cuTexRefSetFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetFilterMode') {{endif}} {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') - except: - pass + global __cuTexRefSetMipmapFilterMode + __cuTexRefSetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') {{endif}} {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') - except: - pass + global __cuTexRefSetMipmapLevelBias + __cuTexRefSetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') {{endif}} {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') - except: - pass + global __cuTexRefSetMipmapLevelClamp + __cuTexRefSetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') {{endif}} {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') - except: - pass + global __cuTexRefSetMaxAnisotropy + __cuTexRefSetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') {{endif}} {{if 'cuTexRefSetBorderColor' in found_functions}} - try: - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefSetBorderColor') - except: - pass + global __cuTexRefSetBorderColor + __cuTexRefSetBorderColor = windll.GetProcAddress(handle, 'cuTexRefSetBorderColor') {{endif}} {{if 'cuTexRefSetFlags' in found_functions}} - try: - global __cuTexRefSetFlags - __cuTexRefSetFlags = win32api.GetProcAddress(handle, 'cuTexRefSetFlags') - except: - pass + global __cuTexRefSetFlags + __cuTexRefSetFlags = windll.GetProcAddress(handle, 'cuTexRefSetFlags') {{endif}} {{if 'cuTexRefGetAddress_v2' in found_functions}} - try: - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefGetAddress_v2') - except: - pass + global __cuTexRefGetAddress_v2 + __cuTexRefGetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefGetAddress_v2') {{endif}} {{if 'cuTexRefGetArray' in found_functions}} - try: - global __cuTexRefGetArray - __cuTexRefGetArray = win32api.GetProcAddress(handle, 'cuTexRefGetArray') - except: - pass + global __cuTexRefGetArray + __cuTexRefGetArray = windll.GetProcAddress(handle, 'cuTexRefGetArray') {{endif}} {{if 'cuTexRefGetMipmappedArray' in found_functions}} - try: - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') - except: - pass + global __cuTexRefGetMipmappedArray + __cuTexRefGetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') {{endif}} {{if 'cuTexRefGetAddressMode' in found_functions}} - try: - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefGetAddressMode') - except: - pass + global __cuTexRefGetAddressMode + __cuTexRefGetAddressMode = windll.GetProcAddress(handle, 'cuTexRefGetAddressMode') {{endif}} {{if 'cuTexRefGetFilterMode' in found_functions}} - try: - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetFilterMode') - except: - pass + global __cuTexRefGetFilterMode + __cuTexRefGetFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetFilterMode') {{endif}} {{if 'cuTexRefGetFormat' in found_functions}} - try: - global __cuTexRefGetFormat - __cuTexRefGetFormat = win32api.GetProcAddress(handle, 'cuTexRefGetFormat') - except: - pass + global __cuTexRefGetFormat + __cuTexRefGetFormat = windll.GetProcAddress(handle, 'cuTexRefGetFormat') {{endif}} {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') - except: - pass + global __cuTexRefGetMipmapFilterMode + __cuTexRefGetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') {{endif}} {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') - except: - pass + global __cuTexRefGetMipmapLevelBias + __cuTexRefGetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') {{endif}} {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') - except: - pass + global __cuTexRefGetMipmapLevelClamp + __cuTexRefGetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') {{endif}} {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') - except: - pass + global __cuTexRefGetMaxAnisotropy + __cuTexRefGetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') {{endif}} {{if 'cuTexRefGetBorderColor' in found_functions}} - try: - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefGetBorderColor') - except: - pass + global __cuTexRefGetBorderColor + __cuTexRefGetBorderColor = windll.GetProcAddress(handle, 'cuTexRefGetBorderColor') {{endif}} {{if 'cuTexRefGetFlags' in found_functions}} - try: - global __cuTexRefGetFlags - __cuTexRefGetFlags = win32api.GetProcAddress(handle, 'cuTexRefGetFlags') - except: - pass + global __cuTexRefGetFlags + __cuTexRefGetFlags = windll.GetProcAddress(handle, 'cuTexRefGetFlags') {{endif}} {{if 'cuTexRefCreate' in found_functions}} - try: - global __cuTexRefCreate - __cuTexRefCreate = win32api.GetProcAddress(handle, 'cuTexRefCreate') - except: - pass + global __cuTexRefCreate + __cuTexRefCreate = windll.GetProcAddress(handle, 'cuTexRefCreate') {{endif}} {{if 'cuTexRefDestroy' in found_functions}} - try: - global __cuTexRefDestroy - __cuTexRefDestroy = win32api.GetProcAddress(handle, 'cuTexRefDestroy') - except: - pass + global __cuTexRefDestroy + __cuTexRefDestroy = windll.GetProcAddress(handle, 'cuTexRefDestroy') {{endif}} {{if 'cuSurfRefSetArray' in found_functions}} - try: - global __cuSurfRefSetArray - __cuSurfRefSetArray = win32api.GetProcAddress(handle, 'cuSurfRefSetArray') - except: - pass + global __cuSurfRefSetArray + __cuSurfRefSetArray = windll.GetProcAddress(handle, 'cuSurfRefSetArray') {{endif}} {{if 'cuSurfRefGetArray' in found_functions}} - try: - global __cuSurfRefGetArray - __cuSurfRefGetArray = win32api.GetProcAddress(handle, 'cuSurfRefGetArray') - except: - pass + global __cuSurfRefGetArray + __cuSurfRefGetArray = windll.GetProcAddress(handle, 'cuSurfRefGetArray') {{endif}} {{if 'cuTexObjectCreate' in found_functions}} - try: - global __cuTexObjectCreate - __cuTexObjectCreate = win32api.GetProcAddress(handle, 'cuTexObjectCreate') - except: - pass + global __cuTexObjectCreate + __cuTexObjectCreate = windll.GetProcAddress(handle, 'cuTexObjectCreate') {{endif}} {{if 'cuTexObjectDestroy' in found_functions}} - try: - global __cuTexObjectDestroy - __cuTexObjectDestroy = win32api.GetProcAddress(handle, 'cuTexObjectDestroy') - except: - pass + global __cuTexObjectDestroy + __cuTexObjectDestroy = windll.GetProcAddress(handle, 'cuTexObjectDestroy') {{endif}} {{if 'cuTexObjectGetResourceDesc' in found_functions}} - try: - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') - except: - pass + global __cuTexObjectGetResourceDesc + __cuTexObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') {{endif}} {{if 'cuTexObjectGetTextureDesc' in found_functions}} - try: - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') - except: - pass + global __cuTexObjectGetTextureDesc + __cuTexObjectGetTextureDesc = windll.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') {{endif}} {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - try: - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') - except: - pass + global __cuTexObjectGetResourceViewDesc + __cuTexObjectGetResourceViewDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') {{endif}} {{if 'cuSurfObjectCreate' in found_functions}} - try: - global __cuSurfObjectCreate - __cuSurfObjectCreate = win32api.GetProcAddress(handle, 'cuSurfObjectCreate') - except: - pass + global __cuSurfObjectCreate + __cuSurfObjectCreate = windll.GetProcAddress(handle, 'cuSurfObjectCreate') {{endif}} {{if 'cuSurfObjectDestroy' in found_functions}} - try: - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = win32api.GetProcAddress(handle, 'cuSurfObjectDestroy') - except: - pass + global __cuSurfObjectDestroy + __cuSurfObjectDestroy = windll.GetProcAddress(handle, 'cuSurfObjectDestroy') {{endif}} {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - try: - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') - except: - pass + global __cuSurfObjectGetResourceDesc + __cuSurfObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') {{endif}} {{if 'cuTensorMapEncodeTiled' in found_functions}} - try: - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = win32api.GetProcAddress(handle, 'cuTensorMapEncodeTiled') - except: - pass + global __cuTensorMapEncodeTiled + __cuTensorMapEncodeTiled = windll.GetProcAddress(handle, 'cuTensorMapEncodeTiled') {{endif}} {{if 'cuTensorMapEncodeIm2col' in found_functions}} - try: - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') - except: - pass + global __cuTensorMapEncodeIm2col + __cuTensorMapEncodeIm2col = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') {{endif}} {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - try: - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') - except: - pass + global __cuTensorMapEncodeIm2colWide + __cuTensorMapEncodeIm2colWide = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') {{endif}} {{if 'cuTensorMapReplaceAddress' in found_functions}} - try: - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = win32api.GetProcAddress(handle, 'cuTensorMapReplaceAddress') - except: - pass + global __cuTensorMapReplaceAddress + __cuTensorMapReplaceAddress = windll.GetProcAddress(handle, 'cuTensorMapReplaceAddress') {{endif}} {{if 'cuDeviceCanAccessPeer' in found_functions}} - try: - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = win32api.GetProcAddress(handle, 'cuDeviceCanAccessPeer') - except: - pass + global __cuDeviceCanAccessPeer + __cuDeviceCanAccessPeer = windll.GetProcAddress(handle, 'cuDeviceCanAccessPeer') {{endif}} {{if 'cuCtxEnablePeerAccess' in found_functions}} - try: - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxEnablePeerAccess') - except: - pass + global __cuCtxEnablePeerAccess + __cuCtxEnablePeerAccess = windll.GetProcAddress(handle, 'cuCtxEnablePeerAccess') {{endif}} {{if 'cuCtxDisablePeerAccess' in found_functions}} - try: - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxDisablePeerAccess') - except: - pass + global __cuCtxDisablePeerAccess + __cuCtxDisablePeerAccess = windll.GetProcAddress(handle, 'cuCtxDisablePeerAccess') {{endif}} {{if 'cuDeviceGetP2PAttribute' in found_functions}} - try: - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') - except: - pass + global __cuDeviceGetP2PAttribute + __cuDeviceGetP2PAttribute = windll.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') {{endif}} {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - try: - global __cuDeviceGetP2PAtomicCapabilities - __cuDeviceGetP2PAtomicCapabilities = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') - except: - pass + global __cuDeviceGetP2PAtomicCapabilities + __cuDeviceGetP2PAtomicCapabilities = windll.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') {{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}} - try: - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = win32api.GetProcAddress(handle, 'cuGraphicsUnregisterResource') - except: - pass + global __cuGraphicsUnregisterResource + __cuGraphicsUnregisterResource = windll.GetProcAddress(handle, 'cuGraphicsUnregisterResource') {{endif}} {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - try: - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = win32api.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') - except: - pass + global __cuGraphicsSubResourceGetMappedArray + __cuGraphicsSubResourceGetMappedArray = windll.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') {{endif}} {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - try: - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - except: - pass + global __cuGraphicsResourceGetMappedMipmappedArray + __cuGraphicsResourceGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') {{endif}} {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - try: - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') - except: - pass + global __cuGraphicsResourceGetMappedPointer_v2 + __cuGraphicsResourceGetMappedPointer_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') {{endif}} {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - try: - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') - except: - pass + global __cuGraphicsResourceSetMapFlags_v2 + __cuGraphicsResourceSetMapFlags_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') {{endif}} {{if 'cuGetProcAddress_v2' in found_functions}} - try: - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') - except: - pass + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') {{endif}} {{if 'cuCoredumpGetAttribute' in found_functions}} - try: - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpGetAttribute') - except: - pass + global __cuCoredumpGetAttribute + __cuCoredumpGetAttribute = windll.GetProcAddress(handle, 'cuCoredumpGetAttribute') {{endif}} {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') - except: - pass + global __cuCoredumpGetAttributeGlobal + __cuCoredumpGetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') {{endif}} {{if 'cuCoredumpSetAttribute' in found_functions}} - try: - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpSetAttribute') - except: - pass + global __cuCoredumpSetAttribute + __cuCoredumpSetAttribute = windll.GetProcAddress(handle, 'cuCoredumpSetAttribute') {{endif}} {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') - except: - pass + global __cuCoredumpSetAttributeGlobal + __cuCoredumpSetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') {{endif}} {{if 'cuGetExportTable' in found_functions}} - try: - global __cuGetExportTable - __cuGetExportTable = win32api.GetProcAddress(handle, 'cuGetExportTable') - except: - pass + global __cuGetExportTable + __cuGetExportTable = windll.GetProcAddress(handle, 'cuGetExportTable') {{endif}} {{if 'cuGreenCtxCreate' in found_functions}} - try: - global __cuGreenCtxCreate - __cuGreenCtxCreate = win32api.GetProcAddress(handle, 'cuGreenCtxCreate') - except: - pass + global __cuGreenCtxCreate + __cuGreenCtxCreate = windll.GetProcAddress(handle, 'cuGreenCtxCreate') {{endif}} {{if 'cuGreenCtxDestroy' in found_functions}} - try: - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = win32api.GetProcAddress(handle, 'cuGreenCtxDestroy') - except: - pass + global __cuGreenCtxDestroy + __cuGreenCtxDestroy = windll.GetProcAddress(handle, 'cuGreenCtxDestroy') {{endif}} {{if 'cuCtxFromGreenCtx' in found_functions}} - try: - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = win32api.GetProcAddress(handle, 'cuCtxFromGreenCtx') - except: - pass + global __cuCtxFromGreenCtx + __cuCtxFromGreenCtx = windll.GetProcAddress(handle, 'cuCtxFromGreenCtx') {{endif}} {{if 'cuDeviceGetDevResource' in found_functions}} - try: - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = win32api.GetProcAddress(handle, 'cuDeviceGetDevResource') - except: - pass + global __cuDeviceGetDevResource + __cuDeviceGetDevResource = windll.GetProcAddress(handle, 'cuDeviceGetDevResource') {{endif}} {{if 'cuCtxGetDevResource' in found_functions}} - try: - global __cuCtxGetDevResource - __cuCtxGetDevResource = win32api.GetProcAddress(handle, 'cuCtxGetDevResource') - except: - pass + global __cuCtxGetDevResource + __cuCtxGetDevResource = windll.GetProcAddress(handle, 'cuCtxGetDevResource') {{endif}} {{if 'cuGreenCtxGetDevResource' in found_functions}} - try: - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = win32api.GetProcAddress(handle, 'cuGreenCtxGetDevResource') - except: - pass + global __cuGreenCtxGetDevResource + __cuGreenCtxGetDevResource = windll.GetProcAddress(handle, 'cuGreenCtxGetDevResource') {{endif}} {{if 'cuDevSmResourceSplitByCount' in found_functions}} - try: - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = win32api.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') - except: - pass + global __cuDevSmResourceSplitByCount + __cuDevSmResourceSplitByCount = windll.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') {{endif}} {{if 'cuDevResourceGenerateDesc' in found_functions}} - try: - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = win32api.GetProcAddress(handle, 'cuDevResourceGenerateDesc') - except: - pass + global __cuDevResourceGenerateDesc + __cuDevResourceGenerateDesc = windll.GetProcAddress(handle, 'cuDevResourceGenerateDesc') {{endif}} {{if 'cuGreenCtxRecordEvent' in found_functions}} - try: - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = win32api.GetProcAddress(handle, 'cuGreenCtxRecordEvent') - except: - pass + global __cuGreenCtxRecordEvent + __cuGreenCtxRecordEvent = windll.GetProcAddress(handle, 'cuGreenCtxRecordEvent') {{endif}} {{if 'cuGreenCtxWaitEvent' in found_functions}} - try: - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = win32api.GetProcAddress(handle, 'cuGreenCtxWaitEvent') - except: - pass + global __cuGreenCtxWaitEvent + __cuGreenCtxWaitEvent = windll.GetProcAddress(handle, 'cuGreenCtxWaitEvent') {{endif}} {{if 'cuStreamGetGreenCtx' in found_functions}} - try: - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = win32api.GetProcAddress(handle, 'cuStreamGetGreenCtx') - except: - pass + global __cuStreamGetGreenCtx + __cuStreamGetGreenCtx = windll.GetProcAddress(handle, 'cuStreamGetGreenCtx') {{endif}} {{if 'cuGreenCtxStreamCreate' in found_functions}} - try: - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = win32api.GetProcAddress(handle, 'cuGreenCtxStreamCreate') - except: - pass + global __cuGreenCtxStreamCreate + __cuGreenCtxStreamCreate = windll.GetProcAddress(handle, 'cuGreenCtxStreamCreate') {{endif}} {{if 'cuGreenCtxGetId' in found_functions}} - try: - global __cuGreenCtxGetId - __cuGreenCtxGetId = win32api.GetProcAddress(handle, 'cuGreenCtxGetId') - except: - pass + global __cuGreenCtxGetId + __cuGreenCtxGetId = windll.GetProcAddress(handle, 'cuGreenCtxGetId') {{endif}} {{if 'cuLogsRegisterCallback' in found_functions}} - try: - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = win32api.GetProcAddress(handle, 'cuLogsRegisterCallback') - except: - pass + global __cuLogsRegisterCallback + __cuLogsRegisterCallback = windll.GetProcAddress(handle, 'cuLogsRegisterCallback') {{endif}} {{if 'cuLogsUnregisterCallback' in found_functions}} - try: - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = win32api.GetProcAddress(handle, 'cuLogsUnregisterCallback') - except: - pass + global __cuLogsUnregisterCallback + __cuLogsUnregisterCallback = windll.GetProcAddress(handle, 'cuLogsUnregisterCallback') {{endif}} {{if 'cuLogsCurrent' in found_functions}} - try: - global __cuLogsCurrent - __cuLogsCurrent = win32api.GetProcAddress(handle, 'cuLogsCurrent') - except: - pass + global __cuLogsCurrent + __cuLogsCurrent = windll.GetProcAddress(handle, 'cuLogsCurrent') {{endif}} {{if 'cuLogsDumpToFile' in found_functions}} - try: - global __cuLogsDumpToFile - __cuLogsDumpToFile = win32api.GetProcAddress(handle, 'cuLogsDumpToFile') - except: - pass + global __cuLogsDumpToFile + __cuLogsDumpToFile = windll.GetProcAddress(handle, 'cuLogsDumpToFile') {{endif}} {{if 'cuLogsDumpToMemory' in found_functions}} - try: - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = win32api.GetProcAddress(handle, 'cuLogsDumpToMemory') - except: - pass + global __cuLogsDumpToMemory + __cuLogsDumpToMemory = windll.GetProcAddress(handle, 'cuLogsDumpToMemory') {{endif}} {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - try: - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') - except: - pass + global __cuCheckpointProcessGetRestoreThreadId + __cuCheckpointProcessGetRestoreThreadId = windll.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') {{endif}} {{if 'cuCheckpointProcessGetState' in found_functions}} - try: - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetState') - except: - pass + global __cuCheckpointProcessGetState + __cuCheckpointProcessGetState = windll.GetProcAddress(handle, 'cuCheckpointProcessGetState') {{endif}} {{if 'cuCheckpointProcessLock' in found_functions}} - try: - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = win32api.GetProcAddress(handle, 'cuCheckpointProcessLock') - except: - pass + global __cuCheckpointProcessLock + __cuCheckpointProcessLock = windll.GetProcAddress(handle, 'cuCheckpointProcessLock') {{endif}} {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - try: - global __cuCheckpointProcessCheckpoint - __cuCheckpointProcessCheckpoint = win32api.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') - except: - pass + global __cuCheckpointProcessCheckpoint + __cuCheckpointProcessCheckpoint = windll.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} - try: - global __cuCheckpointProcessUnlock - __cuCheckpointProcessUnlock = win32api.GetProcAddress(handle, 'cuCheckpointProcessUnlock') - except: - pass + global __cuCheckpointProcessUnlock + __cuCheckpointProcessUnlock = windll.GetProcAddress(handle, 'cuCheckpointProcessUnlock') {{endif}} {{if 'cuProfilerStart' in found_functions}} - try: - global __cuProfilerStart - __cuProfilerStart = win32api.GetProcAddress(handle, 'cuProfilerStart') - except: - pass + global __cuProfilerStart + __cuProfilerStart = windll.GetProcAddress(handle, 'cuProfilerStart') {{endif}} {{if 'cuProfilerStop' in found_functions}} - try: - global __cuProfilerStop - __cuProfilerStop = win32api.GetProcAddress(handle, 'cuProfilerStop') - except: - pass + global __cuProfilerStop + __cuProfilerStop = windll.GetProcAddress(handle, 'cuProfilerStop') {{endif}} {{if True}} - try: - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') - except: - pass + global __cuGraphicsEGLRegisterImage + __cuGraphicsEGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') {{endif}} {{if True}} - try: - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') - except: - pass + global __cuEGLStreamConsumerConnect + __cuEGLStreamConsumerConnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') {{endif}} {{if True}} - try: - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') - except: - pass + global __cuEGLStreamConsumerConnectWithFlags + __cuEGLStreamConsumerConnectWithFlags = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') {{endif}} {{if True}} - try: - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') - except: - pass + global __cuEGLStreamConsumerDisconnect + __cuEGLStreamConsumerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') {{endif}} {{if True}} - try: - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') - except: - pass + global __cuEGLStreamConsumerAcquireFrame + __cuEGLStreamConsumerAcquireFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') {{endif}} {{if True}} - try: - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') - except: - pass + global __cuEGLStreamConsumerReleaseFrame + __cuEGLStreamConsumerReleaseFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') {{endif}} {{if True}} - try: - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerConnect') - except: - pass + global __cuEGLStreamProducerConnect + __cuEGLStreamProducerConnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerConnect') {{endif}} {{if True}} - try: - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') - except: - pass + global __cuEGLStreamProducerDisconnect + __cuEGLStreamProducerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') {{endif}} {{if True}} - try: - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') - except: - pass + global __cuEGLStreamProducerPresentFrame + __cuEGLStreamProducerPresentFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') {{endif}} {{if True}} - try: - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') - except: - pass + global __cuEGLStreamProducerReturnFrame + __cuEGLStreamProducerReturnFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') {{endif}} {{if True}} - try: - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') - except: - pass + global __cuGraphicsResourceGetMappedEglFrame + __cuGraphicsResourceGetMappedEglFrame = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') {{endif}} {{if True}} - try: - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = win32api.GetProcAddress(handle, 'cuEventCreateFromEGLSync') - except: - pass + global __cuEventCreateFromEGLSync + __cuEventCreateFromEGLSync = windll.GetProcAddress(handle, 'cuEventCreateFromEGLSync') {{endif}} {{if True}} - try: - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') - except: - pass + global __cuGraphicsGLRegisterBuffer + __cuGraphicsGLRegisterBuffer = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') {{endif}} {{if True}} - try: - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') - except: - pass + global __cuGraphicsGLRegisterImage + __cuGraphicsGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') {{endif}} {{if True}} - try: - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = win32api.GetProcAddress(handle, 'cuGLGetDevices_v2') - except: - pass + global __cuGLGetDevices_v2 + __cuGLGetDevices_v2 = windll.GetProcAddress(handle, 'cuGLGetDevices_v2') {{endif}} {{if True}} - try: - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = win32api.GetProcAddress(handle, 'cuVDPAUGetDevice') - except: - pass + global __cuVDPAUGetDevice + __cuVDPAUGetDevice = windll.GetProcAddress(handle, 'cuVDPAUGetDevice') {{endif}} {{if True}} - try: - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') - except: - pass + global __cuVDPAUCtxCreate_v2 + __cuVDPAUCtxCreate_v2 = windll.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') {{endif}} {{if True}} - try: - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') - except: - pass + global __cuGraphicsVDPAURegisterVideoSurface + __cuGraphicsVDPAURegisterVideoSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') {{endif}} {{if True}} - try: - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') - except: - pass + global __cuGraphicsVDPAURegisterOutputSurface + __cuGraphicsVDPAURegisterOutputSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') {{endif}} {{else}} # Load using dlsym diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index 229687a85..840903285 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -4,13 +4,12 @@ # This code was automatically generated with version 13.0.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os -import win32api +cimport cuda.bindings._lib.windll as windll {{else}} cimport cuda.bindings._lib.dlfcn as dlfcn -from libc.stdint cimport uintptr_t {{endif}} from cuda.pathfinder import load_nvidia_dynamic_lib -from libc.stdint cimport intptr_t +from libc.stdint cimport intptr_t, uintptr_t import threading cdef object __symbol_lock = threading.Lock() @@ -50,172 +49,100 @@ cdef int _cuPythonInit() except -1 nogil: # Load function {{if 'nvrtcGetErrorString' in found_functions}} - try: - global __nvrtcGetErrorString - __nvrtcGetErrorString = win32api.GetProcAddress(handle, 'nvrtcGetErrorString') - except: - pass + global __nvrtcGetErrorString + __nvrtcGetErrorString = windll.GetProcAddress(handle, 'nvrtcGetErrorString') {{endif}} {{if 'nvrtcVersion' in found_functions}} - try: - global __nvrtcVersion - __nvrtcVersion = win32api.GetProcAddress(handle, 'nvrtcVersion') - except: - pass + global __nvrtcVersion + __nvrtcVersion = windll.GetProcAddress(handle, 'nvrtcVersion') {{endif}} {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - try: - global __nvrtcGetNumSupportedArchs - __nvrtcGetNumSupportedArchs = win32api.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') - except: - pass + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') {{endif}} {{if 'nvrtcGetSupportedArchs' in found_functions}} - try: - global __nvrtcGetSupportedArchs - __nvrtcGetSupportedArchs = win32api.GetProcAddress(handle, 'nvrtcGetSupportedArchs') - except: - pass + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetSupportedArchs') {{endif}} {{if 'nvrtcCreateProgram' in found_functions}} - try: - global __nvrtcCreateProgram - __nvrtcCreateProgram = win32api.GetProcAddress(handle, 'nvrtcCreateProgram') - except: - pass + global __nvrtcCreateProgram + __nvrtcCreateProgram = windll.GetProcAddress(handle, 'nvrtcCreateProgram') {{endif}} {{if 'nvrtcDestroyProgram' in found_functions}} - try: - global __nvrtcDestroyProgram - __nvrtcDestroyProgram = win32api.GetProcAddress(handle, 'nvrtcDestroyProgram') - except: - pass + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = windll.GetProcAddress(handle, 'nvrtcDestroyProgram') {{endif}} {{if 'nvrtcCompileProgram' in found_functions}} - try: - global __nvrtcCompileProgram - __nvrtcCompileProgram = win32api.GetProcAddress(handle, 'nvrtcCompileProgram') - except: - pass + global __nvrtcCompileProgram + __nvrtcCompileProgram = windll.GetProcAddress(handle, 'nvrtcCompileProgram') {{endif}} {{if 'nvrtcGetPTXSize' in found_functions}} - try: - global __nvrtcGetPTXSize - __nvrtcGetPTXSize = win32api.GetProcAddress(handle, 'nvrtcGetPTXSize') - except: - pass + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = windll.GetProcAddress(handle, 'nvrtcGetPTXSize') {{endif}} {{if 'nvrtcGetPTX' in found_functions}} - try: - global __nvrtcGetPTX - __nvrtcGetPTX = win32api.GetProcAddress(handle, 'nvrtcGetPTX') - except: - pass + global __nvrtcGetPTX + __nvrtcGetPTX = windll.GetProcAddress(handle, 'nvrtcGetPTX') {{endif}} {{if 'nvrtcGetCUBINSize' in found_functions}} - try: - global __nvrtcGetCUBINSize - __nvrtcGetCUBINSize = win32api.GetProcAddress(handle, 'nvrtcGetCUBINSize') - except: - pass + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = windll.GetProcAddress(handle, 'nvrtcGetCUBINSize') {{endif}} {{if 'nvrtcGetCUBIN' in found_functions}} - try: - global __nvrtcGetCUBIN - __nvrtcGetCUBIN = win32api.GetProcAddress(handle, 'nvrtcGetCUBIN') - except: - pass + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = windll.GetProcAddress(handle, 'nvrtcGetCUBIN') {{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}} - try: - global __nvrtcGetLTOIRSize - __nvrtcGetLTOIRSize = win32api.GetProcAddress(handle, 'nvrtcGetLTOIRSize') - except: - pass + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = windll.GetProcAddress(handle, 'nvrtcGetLTOIRSize') {{endif}} {{if 'nvrtcGetLTOIR' in found_functions}} - try: - global __nvrtcGetLTOIR - __nvrtcGetLTOIR = win32api.GetProcAddress(handle, 'nvrtcGetLTOIR') - except: - pass + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = windll.GetProcAddress(handle, 'nvrtcGetLTOIR') {{endif}} {{if 'nvrtcGetOptiXIRSize' in found_functions}} - try: - global __nvrtcGetOptiXIRSize - __nvrtcGetOptiXIRSize = win32api.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') - except: - pass + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = windll.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') {{endif}} {{if 'nvrtcGetOptiXIR' in found_functions}} - try: - global __nvrtcGetOptiXIR - __nvrtcGetOptiXIR = win32api.GetProcAddress(handle, 'nvrtcGetOptiXIR') - except: - pass + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = windll.GetProcAddress(handle, 'nvrtcGetOptiXIR') {{endif}} {{if 'nvrtcGetProgramLogSize' in found_functions}} - try: - global __nvrtcGetProgramLogSize - __nvrtcGetProgramLogSize = win32api.GetProcAddress(handle, 'nvrtcGetProgramLogSize') - except: - pass + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = windll.GetProcAddress(handle, 'nvrtcGetProgramLogSize') {{endif}} {{if 'nvrtcGetProgramLog' in found_functions}} - try: - global __nvrtcGetProgramLog - __nvrtcGetProgramLog = win32api.GetProcAddress(handle, 'nvrtcGetProgramLog') - except: - pass + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = windll.GetProcAddress(handle, 'nvrtcGetProgramLog') {{endif}} {{if 'nvrtcAddNameExpression' in found_functions}} - try: - global __nvrtcAddNameExpression - __nvrtcAddNameExpression = win32api.GetProcAddress(handle, 'nvrtcAddNameExpression') - except: - pass + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = windll.GetProcAddress(handle, 'nvrtcAddNameExpression') {{endif}} {{if 'nvrtcGetLoweredName' in found_functions}} - try: - global __nvrtcGetLoweredName - __nvrtcGetLoweredName = win32api.GetProcAddress(handle, 'nvrtcGetLoweredName') - except: - pass + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = windll.GetProcAddress(handle, 'nvrtcGetLoweredName') {{endif}} {{if 'nvrtcGetPCHHeapSize' in found_functions}} - try: - global __nvrtcGetPCHHeapSize - __nvrtcGetPCHHeapSize = win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') - except: - pass + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') {{endif}} {{if 'nvrtcSetPCHHeapSize' in found_functions}} - try: - global __nvrtcSetPCHHeapSize - __nvrtcSetPCHHeapSize = win32api.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') - except: - pass + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') {{endif}} {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - try: - global __nvrtcGetPCHCreateStatus - __nvrtcGetPCHCreateStatus = win32api.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') - except: - pass + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = windll.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') {{endif}} {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - try: - global __nvrtcGetPCHHeapSizeRequired - __nvrtcGetPCHHeapSizeRequired = win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') - except: - pass + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') {{endif}} {{if 'nvrtcSetFlowCallback' in found_functions}} - try: - global __nvrtcSetFlowCallback - __nvrtcSetFlowCallback = win32api.GetProcAddress(handle, 'nvrtcSetFlowCallback') - except: - pass + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = windll.GetProcAddress(handle, 'nvrtcSetFlowCallback') {{endif}} {{else}} diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 528628b35..931ca8c29 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -32,6 +32,24 @@ cdef extern from "" nogil: const void* RTLD_DEFAULT 'RTLD_DEFAULT' +cdef int get_cuda_version(): + cdef void* handle = NULL + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: + err_msg = dlerror() + raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') + cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver + ############################################################################### # Wrapper init @@ -39,7 +57,6 @@ cdef extern from "" nogil: cdef object __symbol_lock = threading.Lock() cdef bint __py_cufile_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __cuFileHandleRegister = NULL cdef void* __cuFileHandleDeregister = NULL @@ -97,24 +114,9 @@ cdef int _check_or_init_cufile() except -1 nogil: return 0 cdef void* handle = NULL - cdef int err, driver_ver = 0 with gil, __symbol_lock: - # Load driver to check version - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL + driver_ver = get_cuda_version() # Load function global __cuFileHandleRegister diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index f641ae706..ab6b50651 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -30,6 +30,24 @@ cdef extern from "" nogil: const void* RTLD_DEFAULT 'RTLD_DEFAULT' +cdef int get_cuda_version(): + cdef void* handle = NULL + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: + err_msg = dlerror() + raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') + cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver + ############################################################################### # Wrapper init @@ -37,7 +55,6 @@ cdef extern from "" nogil: cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvJitLinkCreate = NULL cdef void* __nvJitLinkDestroy = NULL @@ -66,24 +83,9 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: return 0 cdef void* handle = NULL - cdef int err, driver_ver = 0 with gil, __symbol_lock: - # Load driver to check version - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL + driver_ver = get_cuda_version() # Load function global __nvJitLinkCreate diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index b2c057616..67bebb5ef 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -11,19 +11,71 @@ from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib -import win32api +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +from .utils import NotSupportedError + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + cdef DWORD LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 + cdef DWORD LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline void *GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef int get_cuda_version(): + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = LoadLibraryExW("nvcuda.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: + raise NotSupportedError('CUDA driver is not found') + cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver + ############################################################################### # Wrapper init ############################################################################### -LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 -LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 -LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvJitLinkCreate = NULL cdef void* __nvJitLinkDestroy = NULL @@ -46,110 +98,54 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: if __py_nvjitlink_init: return 0 - cdef int err, driver_ver = 0 - with gil, __symbol_lock: - # Load driver to check version - try: - handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except Exception as e: - raise NotSupportedError(f'CUDA driver is not found ({e})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') + driver_ver = get_cuda_version() # Load library handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint # Load function global __nvJitLinkCreate - try: - __nvJitLinkCreate = win32api.GetProcAddress(handle, 'nvJitLinkCreate') - except: - pass + __nvJitLinkCreate = GetProcAddress(handle, 'nvJitLinkCreate') global __nvJitLinkDestroy - try: - __nvJitLinkDestroy = win32api.GetProcAddress(handle, 'nvJitLinkDestroy') - except: - pass + __nvJitLinkDestroy = GetProcAddress(handle, 'nvJitLinkDestroy') global __nvJitLinkAddData - try: - __nvJitLinkAddData = win32api.GetProcAddress(handle, 'nvJitLinkAddData') - except: - pass + __nvJitLinkAddData = GetProcAddress(handle, 'nvJitLinkAddData') global __nvJitLinkAddFile - try: - __nvJitLinkAddFile = win32api.GetProcAddress(handle, 'nvJitLinkAddFile') - except: - pass + __nvJitLinkAddFile = GetProcAddress(handle, 'nvJitLinkAddFile') global __nvJitLinkComplete - try: - __nvJitLinkComplete = win32api.GetProcAddress(handle, 'nvJitLinkComplete') - except: - pass + __nvJitLinkComplete = GetProcAddress(handle, 'nvJitLinkComplete') global __nvJitLinkGetLinkedCubinSize - try: - __nvJitLinkGetLinkedCubinSize = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedCubinSize') - except: - pass + __nvJitLinkGetLinkedCubinSize = GetProcAddress(handle, 'nvJitLinkGetLinkedCubinSize') global __nvJitLinkGetLinkedCubin - try: - __nvJitLinkGetLinkedCubin = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedCubin') - except: - pass + __nvJitLinkGetLinkedCubin = GetProcAddress(handle, 'nvJitLinkGetLinkedCubin') global __nvJitLinkGetLinkedPtxSize - try: - __nvJitLinkGetLinkedPtxSize = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedPtxSize') - except: - pass + __nvJitLinkGetLinkedPtxSize = GetProcAddress(handle, 'nvJitLinkGetLinkedPtxSize') global __nvJitLinkGetLinkedPtx - try: - __nvJitLinkGetLinkedPtx = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedPtx') - except: - pass + __nvJitLinkGetLinkedPtx = GetProcAddress(handle, 'nvJitLinkGetLinkedPtx') global __nvJitLinkGetErrorLogSize - try: - __nvJitLinkGetErrorLogSize = win32api.GetProcAddress(handle, 'nvJitLinkGetErrorLogSize') - except: - pass + __nvJitLinkGetErrorLogSize = GetProcAddress(handle, 'nvJitLinkGetErrorLogSize') global __nvJitLinkGetErrorLog - try: - __nvJitLinkGetErrorLog = win32api.GetProcAddress(handle, 'nvJitLinkGetErrorLog') - except: - pass + __nvJitLinkGetErrorLog = GetProcAddress(handle, 'nvJitLinkGetErrorLog') global __nvJitLinkGetInfoLogSize - try: - __nvJitLinkGetInfoLogSize = win32api.GetProcAddress(handle, 'nvJitLinkGetInfoLogSize') - except: - pass + __nvJitLinkGetInfoLogSize = GetProcAddress(handle, 'nvJitLinkGetInfoLogSize') global __nvJitLinkGetInfoLog - try: - __nvJitLinkGetInfoLog = win32api.GetProcAddress(handle, 'nvJitLinkGetInfoLog') - except: - pass + __nvJitLinkGetInfoLog = GetProcAddress(handle, 'nvJitLinkGetInfoLog') global __nvJitLinkVersion - try: - __nvJitLinkVersion = win32api.GetProcAddress(handle, 'nvJitLinkVersion') - except: - pass + __nvJitLinkVersion = GetProcAddress(handle, 'nvJitLinkVersion') __py_nvjitlink_init = True return 0 diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index c2c1dd2b0..350b55f30 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -30,6 +30,24 @@ cdef extern from "" nogil: const void* RTLD_DEFAULT 'RTLD_DEFAULT' +cdef int get_cuda_version(): + cdef void* handle = NULL + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: + err_msg = dlerror() + raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') + cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver + ############################################################################### # Wrapper init @@ -37,7 +55,6 @@ cdef extern from "" nogil: cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvvmGetErrorString = NULL cdef void* __nvvmVersion = NULL @@ -65,24 +82,9 @@ cdef int _check_or_init_nvvm() except -1 nogil: return 0 cdef void* handle = NULL - cdef int err, driver_ver = 0 with gil, __symbol_lock: - # Load driver to check version - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL + driver_ver = get_cuda_version() # Load function global __nvvmGetErrorString diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index 98870aa61..da22cebe1 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -11,19 +11,71 @@ from .utils import FunctionNotFoundError, NotSupportedError from cuda.pathfinder import load_nvidia_dynamic_lib -import win32api +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +from .utils import NotSupportedError + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + cdef DWORD LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 + cdef DWORD LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline void *GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef int get_cuda_version(): + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = LoadLibraryExW("nvcuda.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: + raise NotSupportedError('CUDA driver is not found') + cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver + ############################################################################### # Wrapper init ############################################################################### -LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 -LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 -LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvvmGetErrorString = NULL cdef void* __nvvmVersion = NULL @@ -45,104 +97,51 @@ cdef int _check_or_init_nvvm() except -1 nogil: if __py_nvvm_init: return 0 - cdef int err, driver_ver = 0 - with gil, __symbol_lock: - # Load driver to check version - try: - handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except Exception as e: - raise NotSupportedError(f'CUDA driver is not found ({e})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') + driver_ver = get_cuda_version() # Load library handle = load_nvidia_dynamic_lib("nvvm")._handle_uint # Load function global __nvvmGetErrorString - try: - __nvvmGetErrorString = win32api.GetProcAddress(handle, 'nvvmGetErrorString') - except: - pass + __nvvmGetErrorString = GetProcAddress(handle, 'nvvmGetErrorString') global __nvvmVersion - try: - __nvvmVersion = win32api.GetProcAddress(handle, 'nvvmVersion') - except: - pass + __nvvmVersion = GetProcAddress(handle, 'nvvmVersion') global __nvvmIRVersion - try: - __nvvmIRVersion = win32api.GetProcAddress(handle, 'nvvmIRVersion') - except: - pass + __nvvmIRVersion = GetProcAddress(handle, 'nvvmIRVersion') global __nvvmCreateProgram - try: - __nvvmCreateProgram = win32api.GetProcAddress(handle, 'nvvmCreateProgram') - except: - pass + __nvvmCreateProgram = GetProcAddress(handle, 'nvvmCreateProgram') global __nvvmDestroyProgram - try: - __nvvmDestroyProgram = win32api.GetProcAddress(handle, 'nvvmDestroyProgram') - except: - pass + __nvvmDestroyProgram = GetProcAddress(handle, 'nvvmDestroyProgram') global __nvvmAddModuleToProgram - try: - __nvvmAddModuleToProgram = win32api.GetProcAddress(handle, 'nvvmAddModuleToProgram') - except: - pass + __nvvmAddModuleToProgram = GetProcAddress(handle, 'nvvmAddModuleToProgram') global __nvvmLazyAddModuleToProgram - try: - __nvvmLazyAddModuleToProgram = win32api.GetProcAddress(handle, 'nvvmLazyAddModuleToProgram') - except: - pass + __nvvmLazyAddModuleToProgram = GetProcAddress(handle, 'nvvmLazyAddModuleToProgram') global __nvvmCompileProgram - try: - __nvvmCompileProgram = win32api.GetProcAddress(handle, 'nvvmCompileProgram') - except: - pass + __nvvmCompileProgram = GetProcAddress(handle, 'nvvmCompileProgram') global __nvvmVerifyProgram - try: - __nvvmVerifyProgram = win32api.GetProcAddress(handle, 'nvvmVerifyProgram') - except: - pass + __nvvmVerifyProgram = GetProcAddress(handle, 'nvvmVerifyProgram') global __nvvmGetCompiledResultSize - try: - __nvvmGetCompiledResultSize = win32api.GetProcAddress(handle, 'nvvmGetCompiledResultSize') - except: - pass + __nvvmGetCompiledResultSize = GetProcAddress(handle, 'nvvmGetCompiledResultSize') global __nvvmGetCompiledResult - try: - __nvvmGetCompiledResult = win32api.GetProcAddress(handle, 'nvvmGetCompiledResult') - except: - pass + __nvvmGetCompiledResult = GetProcAddress(handle, 'nvvmGetCompiledResult') global __nvvmGetProgramLogSize - try: - __nvvmGetProgramLogSize = win32api.GetProcAddress(handle, 'nvvmGetProgramLogSize') - except: - pass + __nvvmGetProgramLogSize = GetProcAddress(handle, 'nvvmGetProgramLogSize') global __nvvmGetProgramLog - try: - __nvvmGetProgramLog = win32api.GetProcAddress(handle, 'nvvmGetProgramLog') - except: - pass + __nvvmGetProgramLog = GetProcAddress(handle, 'nvvmGetProgramLog') __py_nvvm_init = True return 0 diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/cuda/bindings/_lib/windll.pxd new file mode 100644 index 000000000..e3f86285e --- /dev/null +++ b/cuda_bindings/cuda/bindings/_lib/windll.pxd @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline FARPROC GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 0e0e82bad..bf286bdc6 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -17,6 +17,7 @@ Highlights * The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. * The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. +* On Windows, the ``pywin32`` dependency has been removed. The necessary Windows API functions are now accessed directly. Known issues diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 6af49d1ef..36fa778d1 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -28,7 +28,6 @@ dynamic = [ ] dependencies = [ "cuda-pathfinder ~=1.1", - "pywin32; sys_platform == 'win32'", ] [project.optional-dependencies] From 90096d270d795b9295545e25dc84e1bcd0ca2765 Mon Sep 17 00:00:00 2001 From: Keith Kraus Date: Wed, 10 Sep 2025 21:06:28 -0400 Subject: [PATCH 095/113] Update ci and bindings to be generated based on CTK 13.0.1 (#960) * Update ci and bindings to be generated based on CTK 13.0.1 * Add 12.9.x release note as well --- ci/test-matrix.json | 96 +++++++++---------- ci/versions.json | 2 +- .../cuda/bindings/_internal/cufile.pxd | 2 +- .../cuda/bindings/_internal/cufile_linux.pyx | 2 +- .../cuda/bindings/_internal/nvjitlink.pxd | 2 +- .../bindings/_internal/nvjitlink_linux.pyx | 2 +- .../bindings/_internal/nvjitlink_windows.pyx | 2 +- .../cuda/bindings/_internal/nvvm.pxd | 2 +- .../cuda/bindings/_internal/nvvm_linux.pyx | 2 +- .../cuda/bindings/_internal/nvvm_windows.pyx | 2 +- cuda_bindings/cuda/bindings/cufile.pxd | 2 +- cuda_bindings/cuda/bindings/cufile.pyx | 4 +- cuda_bindings/cuda/bindings/cycufile.pxd | 2 +- cuda_bindings/cuda/bindings/cycufile.pyx | 2 +- cuda_bindings/cuda/bindings/cynvjitlink.pxd | 2 +- cuda_bindings/cuda/bindings/cynvjitlink.pyx | 2 +- cuda_bindings/cuda/bindings/cynvvm.pxd | 2 +- cuda_bindings/cuda/bindings/cynvvm.pyx | 2 +- cuda_bindings/cuda/bindings/nvjitlink.pxd | 2 +- cuda_bindings/cuda/bindings/nvjitlink.pyx | 2 +- cuda_bindings/cuda/bindings/nvvm.pxd | 2 +- cuda_bindings/cuda/bindings/nvvm.pyx | 2 +- .../docs/source/release/12.9.X-notes.rst | 4 +- .../docs/source/release/13.X.Y-notes.rst | 2 +- 24 files changed, 73 insertions(+), 73 deletions(-) diff --git a/ci/test-matrix.json b/ci/test-matrix.json index 96bde257d..9311df909 100644 --- a/ci/test-matrix.json +++ b/ci/test-matrix.json @@ -1,100 +1,100 @@ { "_description": "Test matrix configurations for CUDA Python CI workflows. This file consolidates the test matrices that were previously hardcoded in the workflow files. All GPU and ARCH values are hard-coded for each architecture: l4 GPU for amd64, a100 GPU for arm64.", "_sorted_by": "Please keep matrices sorted in ascending order by [ARCH, PY_VER, CUDA_VER, LOCAL_CTK, GPU, DRIVER]", - "_notes": "DRIVER: 'earliest' does not work with CUDA 12.9.0 and LOCAL_CTK: 0 does not work with CUDA 12.0.1", + "_notes": "DRIVER: 'earliest' does not work with CUDA 12.9.1 and LOCAL_CTK: 0 does not work with CUDA 12.0.1", "linux": { "pull-request": [ - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } ], "nightly": [ { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } ], "special_runners": { "amd64": [ - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "H100", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "H100", "DRIVER": "latest" } ] } }, "windows": { "pull-request": [ - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } ], "nightly": [ { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } ] } } diff --git a/ci/versions.json b/ci/versions.json index 5eb48beb8..271c69ac3 100644 --- a/ci/versions.json +++ b/ci/versions.json @@ -1,7 +1,7 @@ { "cuda": { "build": { - "version": "13.0.0" + "version": "13.0.1" } } } diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index 9150b394e..97b1b387f 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. from ..cycufile cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 931ca8c29..74079c2ef 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t import threading diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index c2ca56bde..a4fc84c98 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index ab6b50651..db68c647c 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 67bebb5ef..efc15834a 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index 8b50574f8..1f0c4d898 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 350b55f30..2eaff11c3 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index da22cebe1..d2f0e48c4 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index f79a7fdf8..a343caa21 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index 6a53d145d..66b3aca2d 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. cimport cython # NOQA from libc cimport errno @@ -1124,7 +1124,7 @@ cpdef driver_get_properties(intptr_t props): """Gets the Driver session properties. Args: - props (intptr_t): to set. + props (intptr_t): Properties to set. .. seealso:: `cuFileDriverGetProperties` """ diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index a55e43336..39142aa1f 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. from libc.stdint cimport uint32_t, uint64_t from libc.time cimport time_t diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index 96f0172d0..d6bbb2745 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.0 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly. from ._internal cimport cufile as _cufile diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index 60ea8b1d1..b65501af3 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index 8a65590e0..ddf1c88a6 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index 18b81d31c..a05b3d502 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. ############################################################################### diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index 29235ca9a..9133c9628 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 40f21351a..6d8ca7ed4 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index a05b63fea..0cd2ace8d 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. cimport cython # NOQA diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index ea79a3b01..54f914d1c 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 8daef79ce..d5cc27b7f 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 13.0.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.1. Do not modify it directly. cimport cython # NOQA diff --git a/cuda_bindings/docs/source/release/12.9.X-notes.rst b/cuda_bindings/docs/source/release/12.9.X-notes.rst index 967665b42..76de5d795 100644 --- a/cuda_bindings/docs/source/release/12.9.X-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.X-notes.rst @@ -13,9 +13,9 @@ Highlights ---------- * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. +* The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. +* Updated the ``cuda.bindings.runtime`` module to statically link against the CUDA Runtime library from CUDA Toolkit 12.9.1. -* The Python overhead of calling functions in CUDA bindings in ``driver``, - ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. Known issues ------------ diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index bf286bdc6..9e57410ff 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -15,9 +15,9 @@ Highlights * Migrated wheel dependencies from individual NVIDIA packages to the ``cuda-toolkit`` metapackage for improved dependency resolution and version constraints. * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. * The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. - * The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. * On Windows, the ``pywin32`` dependency has been removed. The necessary Windows API functions are now accessed directly. +* Updated the ``cuda.bindings.runtime`` module to statically link against the CUDA Runtime library from CUDA Toolkit 13.0.1. Known issues From f317f21860ef8cabb2084cc7f8fa7a4cba722ab9 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 11 Sep 2025 15:03:21 -0700 Subject: [PATCH 096/113] Add `test_` prefix in cuda_pathfinder/pyproject.toml, update toolshed/ and .github/workflows accordingly (#966) --- .github/workflows/test-wheel-linux.yml | 2 +- .github/workflows/test-wheel-windows.yml | 2 +- cuda_pathfinder/pyproject.toml | 6 +++--- toolshed/collect_site_packages_dll_files.ps1 | 4 ++-- toolshed/collect_site_packages_so_files.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index ce8f6d540..a6d9fc51c 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -283,7 +283,7 @@ jobs: run: | set -euo pipefail pushd cuda_pathfinder - pip install --only-binary=:all: -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_wheels_host]" + pip install --only-binary=:all: -v ".[test_nvidia_wheels_cu${TEST_CUDA_MAJOR},test_nvidia_wheels_host]" pip list popd diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 6fe2270c6..573ec6d9a 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -256,7 +256,7 @@ jobs: shell: bash --noprofile --norc -xeuo pipefail {0} run: | pushd cuda_pathfinder - pip install --only-binary=:all: -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_wheels_host]" + pip install --only-binary=:all: -v ".[test_nvidia_wheels_cu${TEST_CUDA_MAJOR},test_nvidia_wheels_host]" pip list popd diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index bffb42a82..96ad7fb6a 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [] test = [ "pytest>=6.2.4", ] -nvidia_wheels_cu12 = [ +test_nvidia_wheels_cu12 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", "nvidia-cudss-cu12", @@ -23,13 +23,13 @@ nvidia_wheels_cu12 = [ "nvidia-nccl-cu12; sys_platform != 'win32'", "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] -nvidia_wheels_cu13 = [ +test_nvidia_wheels_cu13 = [ "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,nvvm]==13.*", "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", "nvidia-nccl-cu13; sys_platform != 'win32'", "nvidia-nvshmem-cu13; sys_platform != 'win32'", ] -nvidia_wheels_host = [ +test_nvidia_wheels_host = [ "nvpl-fft; platform_system == 'Linux' and platform_machine == 'aarch64'", ] diff --git a/toolshed/collect_site_packages_dll_files.ps1 b/toolshed/collect_site_packages_dll_files.ps1 index 9f1ccce93..3a9954ba8 100644 --- a/toolshed/collect_site_packages_dll_files.ps1 +++ b/toolshed/collect_site_packages_dll_files.ps1 @@ -23,11 +23,11 @@ function Fresh-Venv { Set-Location -Path 'cuda_pathfinder' Fresh-Venv -Path '..\TmpCp12Venv' -pip install --only-binary=:all: -e '.[test,nvidia_wheels_cu12,nvidia_wheels_host]' +pip install --only-binary=:all: -e '.[test,test_nvidia_wheels_cu12,test_nvidia_wheels_host]' deactivate Fresh-Venv -Path '..\TmpCp13Venv' -pip install --only-binary=:all: -e '.[test,nvidia_wheels_cu13,nvidia_wheels_host]' +pip install --only-binary=:all: -e '.[test,test_nvidia_wheels_cu13,test_nvidia_wheels_host]' deactivate Set-Location -Path '..' diff --git a/toolshed/collect_site_packages_so_files.sh b/toolshed/collect_site_packages_so_files.sh index 000bdb64c..48a6e7c77 100755 --- a/toolshed/collect_site_packages_so_files.sh +++ b/toolshed/collect_site_packages_so_files.sh @@ -17,12 +17,12 @@ fresh_venv() { cd cuda_pathfinder/ fresh_venv ../TmpCp12Venv set -x -pip install --only-binary=:all: -e .[test,nvidia_wheels_cu12,nvidia_wheels_host] +pip install --only-binary=:all: -e .[test,test_nvidia_wheels_cu12,test_nvidia_wheels_host] set +x deactivate fresh_venv ../TmpCp13Venv set -x -pip install --only-binary=:all: -e .[test,nvidia_wheels_cu13,nvidia_wheels_host] +pip install --only-binary=:all: -e .[test,test_nvidia_wheels_cu13,test_nvidia_wheels_host] set +x deactivate cd .. From e06b2993dc446a695197ead58033c658bf6b5eeb Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:06:54 -0400 Subject: [PATCH 097/113] Regen bindings to use `is`/`is not` `None` instead of equality checks (#961) --- cuda_bindings/cuda/bindings/driver.pyx.in | 140 ++++++++++----------- cuda_bindings/cuda/bindings/runtime.pyx.in | 100 +++++++-------- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 37de76cad..2fdcf8038 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -24688,7 +24688,7 @@ def cuCtxCreate(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flag pdev = int(CUdevice(dev)) cydev = pdev cdef CUcontext pctx = CUcontext() - cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams != None else NULL + cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams is not None else NULL with nogil: err = cydriver.cuCtxCreate(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) if err != cydriver.CUDA_SUCCESS: @@ -29705,7 +29705,7 @@ def cuMemcpy2D(pCopy : Optional[CUDA_MEMCPY2D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray` """ - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2D(cypCopy_ptr) return (_dict_CUresult[err],) @@ -29832,7 +29832,7 @@ def cuMemcpy2DUnaligned(pCopy : Optional[CUDA_MEMCPY2D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray` """ - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DUnaligned(cypCopy_ptr) return (_dict_CUresult[err],) @@ -29962,7 +29962,7 @@ def cuMemcpy3D(pCopy : Optional[CUDA_MEMCPY3D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy3D` """ - cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3D(cypCopy_ptr) return (_dict_CUresult[err],) @@ -29992,7 +29992,7 @@ def cuMemcpy3DPeer(pCopy : Optional[CUDA_MEMCPY3D_PEER]): -------- :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyPeerAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cudaMemcpy3DPeer` """ - cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeer(cypCopy_ptr) return (_dict_CUresult[err],) @@ -30556,7 +30556,7 @@ def cuMemcpy2DAsync(pCopy : Optional[CUDA_MEMCPY2D], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -30696,7 +30696,7 @@ def cuMemcpy3DAsync(pCopy : Optional[CUDA_MEMCPY3D], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -30736,7 +30736,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeerAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -31692,7 +31692,7 @@ def cuArrayCreate(pAllocateArray : Optional[CUDA_ARRAY_DESCRIPTOR]): :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMallocArray` """ cdef CUarray pHandle = CUarray() - cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray != None else NULL + cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray is not None else NULL with nogil: err = cydriver.cuArrayCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: @@ -32192,7 +32192,7 @@ def cuArray3DCreate(pAllocateArray : Optional[CUDA_ARRAY3D_DESCRIPTOR]): :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMalloc3DArray` """ cdef CUarray pHandle = CUarray() - cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray != None else NULL + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray is not None else NULL with nogil: err = cydriver.cuArray3DCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: @@ -32362,7 +32362,7 @@ def cuMipmappedArrayCreate(pMipmappedArrayDesc : Optional[CUDA_ARRAY3D_DESCRIPTO :py:obj:`~.cuMipmappedArrayDestroy`, :py:obj:`~.cuMipmappedArrayGetLevel`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cudaMallocMipmappedArray` """ cdef CUmipmappedArray pHandle = CUmipmappedArray() - cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypMipmappedArrayDesc_ptr = pMipmappedArrayDesc._pvt_ptr if pMipmappedArrayDesc != None else NULL + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypMipmappedArrayDesc_ptr = pMipmappedArrayDesc._pvt_ptr if pMipmappedArrayDesc is not None else NULL with nogil: err = cydriver.cuMipmappedArrayCreate(pHandle._pvt_ptr, cypMipmappedArrayDesc_ptr, numMipmapLevels) if err != cydriver.CUDA_SUCCESS: @@ -32609,7 +32609,7 @@ def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], siz else: pstream = int(CUstream(stream)) cystream = pstream - cdef cydriver.CUmemDecompressParams* cyparamsArray_ptr = paramsArray._pvt_ptr if paramsArray != None else NULL + cdef cydriver.CUmemDecompressParams* cyparamsArray_ptr = paramsArray._pvt_ptr if paramsArray is not None else NULL cdef size_t errorIndex = 0 with nogil: err = cydriver.cuMemBatchDecompressAsync(cyparamsArray_ptr, count, flags, &errorIndex, cystream) @@ -32795,7 +32795,7 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cydriver.cuMemCreate(handle._pvt_ptr, size, cyprop_ptr, flags) if err != cydriver.CUDA_SUCCESS: @@ -33258,7 +33258,7 @@ def cuMemGetAccess(location : Optional[CUmemLocation], ptr): pptr = int(CUdeviceptr(ptr)) cyptr = pptr cdef unsigned long long flags = 0 - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cydriver.cuMemGetAccess(&flags, cylocation_ptr, cyptr) if err != cydriver.CUDA_SUCCESS: @@ -33406,7 +33406,7 @@ def cuMemGetAllocationGranularity(prop : Optional[CUmemAllocationProp], option n :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` """ cdef size_t granularity = 0 - cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmemAllocationGranularity_flags cyoption = option.value with nogil: err = cydriver.cuMemGetAllocationGranularity(&granularity, cyprop_ptr, cyoption) @@ -33895,7 +33895,7 @@ def cuMemPoolGetAccess(memPool, location : Optional[CUmemLocation]): pmemPool = int(CUmemoryPool(memPool)) cymemPool = pmemPool cdef cydriver.CUmemAccess_flags flags - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cydriver.cuMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cydriver.CUDA_SUCCESS: @@ -33979,7 +33979,7 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): Specifying CU_MEM_HANDLE_TYPE_NONE creates a memory pool that will not support IPC. """ cdef CUmemoryPool pool = CUmemoryPool() - cdef cydriver.CUmemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps != None else NULL + cdef cydriver.CUmemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL with nogil: err = cydriver.cuMemPoolCreate(pool._pvt_ptr, cypoolProps_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34069,7 +34069,7 @@ def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cuMemPoolSetAttribute`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate` """ cdef CUmemoryPool pool_out = CUmemoryPool() - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = typename.value with nogil: err = cydriver.cuMemGetDefaultMemPool(pool_out._pvt_ptr, cylocation_ptr, cytypename) @@ -34122,7 +34122,7 @@ def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUme :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuMemSetMemPool` """ cdef CUmemoryPool pool = CUmemoryPool() - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = typename.value with nogil: err = cydriver.cuMemGetMemPool(pool._pvt_ptr, cylocation_ptr, cytypename) @@ -34190,7 +34190,7 @@ def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUme else: ppool = int(CUmemoryPool(pool)) cypool = ppool - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = typename.value with nogil: err = cydriver.cuMemSetMemPool(cylocation_ptr, cytypename, cypool) @@ -34450,7 +34450,7 @@ def cuMemPoolImportPointer(pool, shareData : Optional[CUmemPoolPtrExportData]): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef CUdeviceptr ptr_out = CUdeviceptr() - cdef cydriver.CUmemPoolPtrExportData* cyshareData_ptr = shareData._pvt_ptr if shareData != None else NULL + cdef cydriver.CUmemPoolPtrExportData* cyshareData_ptr = shareData._pvt_ptr if shareData is not None else NULL with nogil: err = cydriver.cuMemPoolImportPointer(ptr_out._pvt_ptr, cypool, cyshareData_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34511,7 +34511,7 @@ def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` """ cdef CUmemGenericAllocationHandle mcHandle = CUmemGenericAllocationHandle() - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cydriver.cuMulticastCreate(mcHandle._pvt_ptr, cyprop_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34820,7 +34820,7 @@ def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not :py:obj:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr`, :py:obj:`~.cuMulticastUnbind` """ cdef size_t granularity = 0 - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmulticastGranularity_flags cyoption = option.value with nogil: err = cydriver.cuMulticastGetGranularity(&granularity, cyprop_ptr, cyoption) @@ -37600,7 +37600,7 @@ def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Option phStream = int(CUstream(hStream)) cyhStream = phStream cdef cydriver.CUstreamAttrID cyattr = attr.value - cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) return (_dict_CUresult[err],) @@ -38148,7 +38148,7 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ and Cache Control" chapter from Vulkan specification. """ cdef CUexternalMemory extMem_out = CUexternalMemory() - cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL with nogil: err = cydriver.cuImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38218,7 +38218,7 @@ def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_ pextMem = int(CUexternalMemory(extMem)) cyextMem = pextMem cdef CUdeviceptr devPtr = CUdeviceptr() - cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL with nogil: err = cydriver.cuExternalMemoryGetMappedBuffer(devPtr._pvt_ptr, cyextMem, cybufferDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38294,7 +38294,7 @@ def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_E pextMem = int(CUexternalMemory(extMem)) cyextMem = pextMem cdef CUmipmappedArray mipmap = CUmipmappedArray() - cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL with nogil: err = cydriver.cuExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38483,7 +38483,7 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` """ cdef CUexternalSemaphore extSem_out = CUexternalSemaphore() - cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL with nogil: err = cydriver.cuImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -40035,7 +40035,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt else: pf = int(CUfunction(f)) cyf = pf - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: @@ -41142,7 +41142,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddKernelNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41233,7 +41233,7 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41320,7 +41320,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemcpyNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cycopyParams_ptr, cyctx) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41402,7 +41402,7 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_MEMCPY3D* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemcpyNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41479,7 +41479,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemsetNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cymemsetParams_ptr, cyctx) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41561,7 +41561,7 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemsetNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41628,7 +41628,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddHostNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41710,7 +41710,7 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphHostNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42303,7 +42303,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddExternalSemaphoresSignalNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42392,7 +42392,7 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42460,7 +42460,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[C elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddExternalSemaphoresWaitNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42549,7 +42549,7 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42620,7 +42620,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddBatchMemOpNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42710,7 +42710,7 @@ def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_O else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphBatchMemOpNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42781,7 +42781,7 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecBatchMemOpNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42889,7 +42889,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemAllocNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -44207,7 +44207,7 @@ def cuGraphInstantiateWithParams(hGraph, instantiateParams : Optional[CUDA_GRAPH phGraph = int(CUgraph(hGraph)) cyhGraph = phGraph cdef CUgraphExec phGraphExec = CUgraphExec() - cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams != None else NULL + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL with nogil: err = cydriver.cuGraphInstantiateWithParams(phGraphExec._pvt_ptr, cyhGraph, cyinstantiateParams_ptr) if err != cydriver.CUDA_SUCCESS: @@ -44333,7 +44333,7 @@ def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecKernelNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -44408,7 +44408,7 @@ def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemcpyNodeSetParams(cyhGraphExec, cyhNode, cycopyParams_ptr, cyctx) return (_dict_CUresult[err],) @@ -44488,7 +44488,7 @@ def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CU else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemsetNodeSetParams(cyhGraphExec, cyhNode, cymemsetParams_ptr, cyctx) return (_dict_CUresult[err],) @@ -44543,7 +44543,7 @@ def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_H else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecHostNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -44799,7 +44799,7 @@ def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -44859,7 +44859,7 @@ def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -45477,7 +45477,7 @@ def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, val phNode = int(CUgraphNode(hNode)) cyhNode = phNode cdef cydriver.CUkernelNodeAttrID cyattr = attr.value - cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) return (_dict_CUresult[err],) @@ -45863,7 +45863,7 @@ def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUg string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -45913,7 +45913,7 @@ def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -45973,7 +45973,7 @@ def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNod else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -46436,7 +46436,7 @@ def cuOccupancyMaxPotentialClusterSize(func, config : Optional[CUlaunchConfig]): pfunc = int(CUfunction(func)) cyfunc = pfunc cdef int clusterSize = 0 - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL with nogil: err = cydriver.cuOccupancyMaxPotentialClusterSize(&clusterSize, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: @@ -46496,7 +46496,7 @@ def cuOccupancyMaxActiveClusters(func, config : Optional[CUlaunchConfig]): pfunc = int(CUfunction(func)) cyfunc = pfunc cdef int numClusters = 0 - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL with nogil: err = cydriver.cuOccupancyMaxActiveClusters(&numClusters, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: @@ -46760,7 +46760,7 @@ def cuTexRefSetAddress2D(hTexRef, desc : Optional[CUDA_ARRAY_DESCRIPTOR], dptr, else: phTexRef = int(CUtexref(hTexRef)) cyhTexRef = phTexRef - cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cydriver.cuTexRefSetAddress2D(cyhTexRef, cydesc_ptr, cydptr, Pitch) return (_dict_CUresult[err],) @@ -48131,9 +48131,9 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option :py:obj:`~.cuTexObjectDestroy`, :py:obj:`~.cudaCreateTextureObject` """ cdef CUtexObject pTexObject = CUtexObject() - cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL - cdef cydriver.CUDA_TEXTURE_DESC* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc != None else NULL - cdef cydriver.CUDA_RESOURCE_VIEW_DESC* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc != None else NULL + cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cydriver.CUDA_TEXTURE_DESC* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL + cdef cydriver.CUDA_RESOURCE_VIEW_DESC* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL with nogil: err = cydriver.cuTexObjectCreate(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -48335,7 +48335,7 @@ def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): :py:obj:`~.cuSurfObjectDestroy`, :py:obj:`~.cudaCreateSurfaceObject` """ cdef CUsurfObject pSurfObject = CUsurfObject() - cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL + cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL with nogil: err = cydriver.cuSurfObjectCreate(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -49434,7 +49434,7 @@ def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): -------- :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` """ - cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap != None else NULL + cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap is not None else NULL cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr with nogil: @@ -50752,7 +50752,7 @@ def cuGetExportTable(pExportTableId : Optional[CUuuid]): None """ cdef void_ptr ppExportTable = 0 - cdef cydriver.CUuuid* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId != None else NULL + cdef cydriver.CUuuid* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL with nogil: err = cydriver.cuGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cydriver.CUDA_SUCCESS: @@ -51175,7 +51175,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe if cyresult is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(nbGroups) + 'x' + str(sizeof(cydriver.CUdevResource))) cdef unsigned int cynbGroups = nbGroups - cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ != None else NULL + cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef CUdevResource remaining = CUdevResource() with nogil: err = cydriver.cuDevSmResourceSplitByCount(cyresult, &cynbGroups, cyinput__ptr, remaining._pvt_ptr, useFlags, minCount) @@ -51853,7 +51853,7 @@ def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` :py:obj:`~.CUDA_ERROR_NOT_READY` """ - cdef cydriver.CUcheckpointLockArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointLockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessLock(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -51884,7 +51884,7 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` """ - cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessCheckpoint(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -51913,7 +51913,7 @@ def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` """ - cdef cydriver.CUcheckpointUnlockArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointUnlockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessUnlock(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -52532,7 +52532,7 @@ def cuEGLStreamProducerReturnFrame(conn, eglframe : Optional[CUeglFrame], pStrea cyconn = conn else: raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) - cdef cydriver.CUeglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe != None else NULL + cdef cydriver.CUeglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cydriver.cuEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) return (_dict_CUresult[err],) diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index dc7d4d1b1..fa9eea7e5 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -18718,7 +18718,7 @@ def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDes :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth` """ cdef size_t maxWidthInElements = 0 - cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc is not None else NULL with nogil: err = cyruntime.cudaDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cyfmtDesc_ptr, device) if err != cyruntime.cudaSuccess: @@ -20143,7 +20143,7 @@ def cudaChooseDevice(prop : Optional[cudaDeviceProp]): :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaInitDevice` """ cdef int device = 0 - cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cyruntime.cudaChooseDevice(&device, cyprop_ptr) if err != cyruntime.cudaSuccess: @@ -20884,7 +20884,7 @@ def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Op phStream = int(cudaStream_t(hStream)) cyhStream = phStream cdef cyruntime.cudaStreamAttrID cyattr = attr.value - cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) return (_dict_cudaError_t[err],) @@ -22383,7 +22383,7 @@ def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDe and Cache Control" chapter from Vulkan specification. """ cdef cudaExternalMemory_t extMem_out = cudaExternalMemory_t() - cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc != None else NULL + cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22451,7 +22451,7 @@ def cudaExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[cudaExternal pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef void_ptr devPtr = 0 - cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc != None else NULL + cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedBuffer(&devPtr, cyextMem, cybufferDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22523,7 +22523,7 @@ def cudaExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[cuda pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef cudaMipmappedArray_t mipmap = cudaMipmappedArray_t() - cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc != None else NULL + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22710,7 +22710,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` """ cdef cudaExternalSemaphore_t extSem_out = cudaExternalSemaphore_t() - cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc != None else NULL + cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -23895,7 +23895,7 @@ def cudaMallocArray(desc : Optional[cudaChannelFormatDesc], size_t width, size_t :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuArrayCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocArray(array._pvt_ptr, cydesc_ptr, width, height, flags) if err != cyruntime.cudaSuccess: @@ -24554,7 +24554,7 @@ def cudaMalloc3DArray(desc : Optional[cudaChannelFormatDesc], extent not None : :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuArray3DCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMalloc3DArray(array._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], flags) if err != cyruntime.cudaSuccess: @@ -24680,7 +24680,7 @@ def cudaMallocMipmappedArray(desc : Optional[cudaChannelFormatDesc], extent not :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuMipmappedArrayCreate` """ cdef cudaMipmappedArray_t mipmappedArray = cudaMipmappedArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocMipmappedArray(mipmappedArray._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], numLevels, flags) if err != cyruntime.cudaSuccess: @@ -24815,7 +24815,7 @@ def cudaMemcpy3D(p : Optional[cudaMemcpy3DParms]): -------- :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemcpy3DAsync`, :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.make_cudaPos`, :py:obj:`~.cuMemcpy3D` """ - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3D(cyp_ptr) return (_dict_cudaError_t[err],) @@ -24852,7 +24852,7 @@ def cudaMemcpy3DPeer(p : Optional[cudaMemcpy3DPeerParms]): -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpy3DPeer` """ - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeer(cyp_ptr) return (_dict_cudaError_t[err],) @@ -24957,7 +24957,7 @@ def cudaMemcpy3DAsync(p : Optional[cudaMemcpy3DParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DAsync(cyp_ptr, cystream) return (_dict_cudaError_t[err],) @@ -24997,7 +24997,7 @@ def cudaMemcpy3DPeerAsync(p : Optional[cudaMemcpy3DPeerParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeerAsync(cyp_ptr, cystream) return (_dict_cudaError_t[err],) @@ -28295,7 +28295,7 @@ def cudaMemPoolGetAccess(memPool, location : Optional[cudaMemLocation]): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemAccessFlags flags - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cyruntime.cudaMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cyruntime.cudaSuccess: @@ -28379,7 +28379,7 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC. """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps != None else NULL + cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL with nogil: err = cyruntime.cudaMemPoolCreate(memPool._pvt_ptr, cypoolProps_ptr) if err != cyruntime.cudaSuccess: @@ -28469,7 +28469,7 @@ def cudaMemGetDefaultMemPool(location : Optional[cudaMemLocation], typename not :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cuMemPoolSetAttribute`, cuMemPoolSetAccess, :py:obj:`~.cuMemGetMemPool`, :py:obj:`~.cuMemPoolCreate` """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = typename.value with nogil: err = cyruntime.cudaMemGetDefaultMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) @@ -28523,7 +28523,7 @@ def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuMemSetMemPool` """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = typename.value with nogil: err = cyruntime.cudaMemGetMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) @@ -28592,7 +28592,7 @@ def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : else: pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = typename.value with nogil: err = cyruntime.cudaMemSetMemPool(cylocation_ptr, cytypename, cymemPool) @@ -28841,7 +28841,7 @@ def cudaMemPoolImportPointer(memPool, exportData : Optional[cudaMemPoolPtrExport pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef void_ptr ptr = 0 - cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData != None else NULL + cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData is not None else NULL with nogil: err = cyruntime.cudaMemPoolImportPointer(&ptr, cymemPool, cyexportData_ptr) if err != cyruntime.cudaSuccess: @@ -29732,9 +29732,9 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op :py:obj:`~.cudaDestroyTextureObject`, :py:obj:`~.cuTexObjectCreate` """ cdef cudaTextureObject_t pTexObject = cudaTextureObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL - cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc != None else NULL - cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc != None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL + cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL with nogil: err = cyruntime.cudaCreateTextureObject(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cyruntime.cudaSuccess: @@ -29935,7 +29935,7 @@ def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): :py:obj:`~.cudaDestroySurfaceObject`, :py:obj:`~.cuSurfObjectCreate` """ cdef cudaSurfaceObject_t pSurfObject = cudaSurfaceObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL with nogil: err = cyruntime.cudaCreateSurfaceObject(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cyruntime.cudaSuccess: @@ -30426,7 +30426,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddKernelNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -30517,7 +30517,7 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -30650,7 +30650,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode cdef cyruntime.cudaKernelNodeAttrID cyattr = attr.value - cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) return (_dict_cudaError_t[err],) @@ -30722,7 +30722,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemcpyNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypCopyParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -30899,7 +30899,7 @@ def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms] else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemcpyNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31027,7 +31027,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemsetNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypMemsetParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31109,7 +31109,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemsetNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31176,7 +31176,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddHostNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31258,7 +31258,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphHostNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31856,7 +31856,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tup elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresSignalNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31945,7 +31945,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -32013,7 +32013,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresWaitNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -32102,7 +32102,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -32209,7 +32209,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemAllocNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -33601,7 +33601,7 @@ def cudaGraphInstantiateWithParams(graph, instantiateParams : Optional[cudaGraph pgraph = int(cudaGraph_t(graph)) cygraph = pgraph cdef cudaGraphExec_t pGraphExec = cudaGraphExec_t() - cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams != None else NULL + cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL with nogil: err = cyruntime.cudaGraphInstantiateWithParams(pGraphExec._pvt_ptr, cygraph, cyinstantiateParams_ptr) if err != cyruntime.cudaSuccess: @@ -33728,7 +33728,7 @@ def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecKernelNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -33793,7 +33793,7 @@ def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemcpyNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -33936,7 +33936,7 @@ def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemsetNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -33991,7 +33991,7 @@ def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cuda else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecHostNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34247,7 +34247,7 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34307,7 +34307,7 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -35164,7 +35164,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | li string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) elif len(dependencyData) == 1: cydependencyData = (dependencyData[0])._pvt_ptr - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -35214,7 +35214,7 @@ def cudaGraphNodeSetParams(node, nodeParams : Optional[cudaGraphNodeParams]): else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphNodeSetParams(cynode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -35274,7 +35274,7 @@ def cudaGraphExecNodeSetParams(graphExec, node, nodeParams : Optional[cudaGraphN else: pgraphExec = int(cudaGraphExec_t(graphExec)) cygraphExec = pgraphExec - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecNodeSetParams(cygraphExec, cynode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -36176,7 +36176,7 @@ def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, i def cudaGetExportTable(pExportTableId : Optional[cudaUUID_t]): """""" cdef void_ptr ppExportTable = 0 - cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId != None else NULL + cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL with nogil: err = cyruntime.cudaGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cyruntime.cudaSuccess: @@ -36879,7 +36879,7 @@ def cudaEGLStreamProducerReturnFrame(conn, eglframe : Optional[cudaEglFrame], pS cyconn = conn else: raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) - cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe != None else NULL + cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cyruntime.cudaEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) return (_dict_cudaError_t[err],) From 992203466adeefbc45d155b8a011011e0d54cd3f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 16 Sep 2025 13:29:26 -0400 Subject: [PATCH 098/113] Fix #962: Don't perform unnecessary version checks (#969) * Fix #962: Don't perform unnecessary version checks * Fix code having no version checks on Linux * Restore things removed from cybind --- .../cuda/bindings/_internal/cufile_linux.pyx | 94 +++++++++---------- .../bindings/_internal/nvjitlink_linux.pyx | 36 ++++--- .../bindings/_internal/nvjitlink_windows.pyx | 2 - .../cuda/bindings/_internal/nvvm_linux.pyx | 34 ++++--- .../cuda/bindings/_internal/nvvm_windows.pyx | 2 - 5 files changed, 79 insertions(+), 89 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 74079c2ef..ffc92f228 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -43,10 +43,10 @@ cdef int get_cuda_version(): raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") if cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') + raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1') err = (cuDriverGetVersion)(&driver_ver) if err != 0: - raise RuntimeError('something went wrong') + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') return driver_ver @@ -103,7 +103,7 @@ cdef void* __cuFileSetParameterPosixPoolSlabArray = NULL cdef void* __cuFileGetParameterPosixPoolSlabArray = NULL -cdef void* load_library(const int driver_ver) except* with gil: +cdef void* load_library() except* with gil: cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint return handle @@ -116,308 +116,306 @@ cdef int _check_or_init_cufile() except -1 nogil: cdef void* handle = NULL with gil, __symbol_lock: - driver_ver = get_cuda_version() - # Load function global __cuFileHandleRegister __cuFileHandleRegister = dlsym(RTLD_DEFAULT, 'cuFileHandleRegister') if __cuFileHandleRegister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileHandleRegister = dlsym(handle, 'cuFileHandleRegister') global __cuFileHandleDeregister __cuFileHandleDeregister = dlsym(RTLD_DEFAULT, 'cuFileHandleDeregister') if __cuFileHandleDeregister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileHandleDeregister = dlsym(handle, 'cuFileHandleDeregister') global __cuFileBufRegister __cuFileBufRegister = dlsym(RTLD_DEFAULT, 'cuFileBufRegister') if __cuFileBufRegister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBufRegister = dlsym(handle, 'cuFileBufRegister') global __cuFileBufDeregister __cuFileBufDeregister = dlsym(RTLD_DEFAULT, 'cuFileBufDeregister') if __cuFileBufDeregister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBufDeregister = dlsym(handle, 'cuFileBufDeregister') global __cuFileRead __cuFileRead = dlsym(RTLD_DEFAULT, 'cuFileRead') if __cuFileRead == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileRead = dlsym(handle, 'cuFileRead') global __cuFileWrite __cuFileWrite = dlsym(RTLD_DEFAULT, 'cuFileWrite') if __cuFileWrite == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileWrite = dlsym(handle, 'cuFileWrite') global __cuFileDriverOpen __cuFileDriverOpen = dlsym(RTLD_DEFAULT, 'cuFileDriverOpen') if __cuFileDriverOpen == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverOpen = dlsym(handle, 'cuFileDriverOpen') global __cuFileDriverClose_v2 __cuFileDriverClose_v2 = dlsym(RTLD_DEFAULT, 'cuFileDriverClose_v2') if __cuFileDriverClose_v2 == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverClose_v2 = dlsym(handle, 'cuFileDriverClose_v2') global __cuFileUseCount __cuFileUseCount = dlsym(RTLD_DEFAULT, 'cuFileUseCount') if __cuFileUseCount == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileUseCount = dlsym(handle, 'cuFileUseCount') global __cuFileDriverGetProperties __cuFileDriverGetProperties = dlsym(RTLD_DEFAULT, 'cuFileDriverGetProperties') if __cuFileDriverGetProperties == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverGetProperties = dlsym(handle, 'cuFileDriverGetProperties') global __cuFileDriverSetPollMode __cuFileDriverSetPollMode = dlsym(RTLD_DEFAULT, 'cuFileDriverSetPollMode') if __cuFileDriverSetPollMode == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverSetPollMode = dlsym(handle, 'cuFileDriverSetPollMode') global __cuFileDriverSetMaxDirectIOSize __cuFileDriverSetMaxDirectIOSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') if __cuFileDriverSetMaxDirectIOSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverSetMaxDirectIOSize = dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') global __cuFileDriverSetMaxCacheSize __cuFileDriverSetMaxCacheSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') if __cuFileDriverSetMaxCacheSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverSetMaxCacheSize = dlsym(handle, 'cuFileDriverSetMaxCacheSize') global __cuFileDriverSetMaxPinnedMemSize __cuFileDriverSetMaxPinnedMemSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') if __cuFileDriverSetMaxPinnedMemSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverSetMaxPinnedMemSize = dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') global __cuFileBatchIOSetUp __cuFileBatchIOSetUp = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSetUp') if __cuFileBatchIOSetUp == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBatchIOSetUp = dlsym(handle, 'cuFileBatchIOSetUp') global __cuFileBatchIOSubmit __cuFileBatchIOSubmit = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSubmit') if __cuFileBatchIOSubmit == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBatchIOSubmit = dlsym(handle, 'cuFileBatchIOSubmit') global __cuFileBatchIOGetStatus __cuFileBatchIOGetStatus = dlsym(RTLD_DEFAULT, 'cuFileBatchIOGetStatus') if __cuFileBatchIOGetStatus == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBatchIOGetStatus = dlsym(handle, 'cuFileBatchIOGetStatus') global __cuFileBatchIOCancel __cuFileBatchIOCancel = dlsym(RTLD_DEFAULT, 'cuFileBatchIOCancel') if __cuFileBatchIOCancel == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBatchIOCancel = dlsym(handle, 'cuFileBatchIOCancel') global __cuFileBatchIODestroy __cuFileBatchIODestroy = dlsym(RTLD_DEFAULT, 'cuFileBatchIODestroy') if __cuFileBatchIODestroy == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileBatchIODestroy = dlsym(handle, 'cuFileBatchIODestroy') global __cuFileReadAsync __cuFileReadAsync = dlsym(RTLD_DEFAULT, 'cuFileReadAsync') if __cuFileReadAsync == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileReadAsync = dlsym(handle, 'cuFileReadAsync') global __cuFileWriteAsync __cuFileWriteAsync = dlsym(RTLD_DEFAULT, 'cuFileWriteAsync') if __cuFileWriteAsync == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileWriteAsync = dlsym(handle, 'cuFileWriteAsync') global __cuFileStreamRegister __cuFileStreamRegister = dlsym(RTLD_DEFAULT, 'cuFileStreamRegister') if __cuFileStreamRegister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileStreamRegister = dlsym(handle, 'cuFileStreamRegister') global __cuFileStreamDeregister __cuFileStreamDeregister = dlsym(RTLD_DEFAULT, 'cuFileStreamDeregister') if __cuFileStreamDeregister == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileStreamDeregister = dlsym(handle, 'cuFileStreamDeregister') global __cuFileGetVersion __cuFileGetVersion = dlsym(RTLD_DEFAULT, 'cuFileGetVersion') if __cuFileGetVersion == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetVersion = dlsym(handle, 'cuFileGetVersion') global __cuFileGetParameterSizeT __cuFileGetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileGetParameterSizeT') if __cuFileGetParameterSizeT == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetParameterSizeT = dlsym(handle, 'cuFileGetParameterSizeT') global __cuFileGetParameterBool __cuFileGetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileGetParameterBool') if __cuFileGetParameterBool == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetParameterBool = dlsym(handle, 'cuFileGetParameterBool') global __cuFileGetParameterString __cuFileGetParameterString = dlsym(RTLD_DEFAULT, 'cuFileGetParameterString') if __cuFileGetParameterString == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetParameterString = dlsym(handle, 'cuFileGetParameterString') global __cuFileSetParameterSizeT __cuFileSetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileSetParameterSizeT') if __cuFileSetParameterSizeT == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileSetParameterSizeT = dlsym(handle, 'cuFileSetParameterSizeT') global __cuFileSetParameterBool __cuFileSetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileSetParameterBool') if __cuFileSetParameterBool == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileSetParameterBool = dlsym(handle, 'cuFileSetParameterBool') global __cuFileSetParameterString __cuFileSetParameterString = dlsym(RTLD_DEFAULT, 'cuFileSetParameterString') if __cuFileSetParameterString == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') global __cuFileDriverClose __cuFileDriverClose = dlsym(RTLD_DEFAULT, 'cuFileDriverClose') if __cuFileDriverClose == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileDriverClose = dlsym(handle, 'cuFileDriverClose') global __cuFileGetParameterMinMaxValue __cuFileGetParameterMinMaxValue = dlsym(RTLD_DEFAULT, 'cuFileGetParameterMinMaxValue') if __cuFileGetParameterMinMaxValue == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetParameterMinMaxValue = dlsym(handle, 'cuFileGetParameterMinMaxValue') global __cuFileSetStatsLevel __cuFileSetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileSetStatsLevel') if __cuFileSetStatsLevel == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileSetStatsLevel = dlsym(handle, 'cuFileSetStatsLevel') global __cuFileGetStatsLevel __cuFileGetStatsLevel = dlsym(RTLD_DEFAULT, 'cuFileGetStatsLevel') if __cuFileGetStatsLevel == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetStatsLevel = dlsym(handle, 'cuFileGetStatsLevel') global __cuFileStatsStart __cuFileStatsStart = dlsym(RTLD_DEFAULT, 'cuFileStatsStart') if __cuFileStatsStart == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileStatsStart = dlsym(handle, 'cuFileStatsStart') global __cuFileStatsStop __cuFileStatsStop = dlsym(RTLD_DEFAULT, 'cuFileStatsStop') if __cuFileStatsStop == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileStatsStop = dlsym(handle, 'cuFileStatsStop') global __cuFileStatsReset __cuFileStatsReset = dlsym(RTLD_DEFAULT, 'cuFileStatsReset') if __cuFileStatsReset == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileStatsReset = dlsym(handle, 'cuFileStatsReset') global __cuFileGetStatsL1 __cuFileGetStatsL1 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL1') if __cuFileGetStatsL1 == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetStatsL1 = dlsym(handle, 'cuFileGetStatsL1') global __cuFileGetStatsL2 __cuFileGetStatsL2 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL2') if __cuFileGetStatsL2 == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetStatsL2 = dlsym(handle, 'cuFileGetStatsL2') global __cuFileGetStatsL3 __cuFileGetStatsL3 = dlsym(RTLD_DEFAULT, 'cuFileGetStatsL3') if __cuFileGetStatsL3 == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetStatsL3 = dlsym(handle, 'cuFileGetStatsL3') global __cuFileGetBARSizeInKB __cuFileGetBARSizeInKB = dlsym(RTLD_DEFAULT, 'cuFileGetBARSizeInKB') if __cuFileGetBARSizeInKB == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetBARSizeInKB = dlsym(handle, 'cuFileGetBARSizeInKB') global __cuFileSetParameterPosixPoolSlabArray __cuFileSetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileSetParameterPosixPoolSlabArray') if __cuFileSetParameterPosixPoolSlabArray == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileSetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileSetParameterPosixPoolSlabArray') global __cuFileGetParameterPosixPoolSlabArray __cuFileGetParameterPosixPoolSlabArray = dlsym(RTLD_DEFAULT, 'cuFileGetParameterPosixPoolSlabArray') if __cuFileGetParameterPosixPoolSlabArray == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __cuFileGetParameterPosixPoolSlabArray = dlsym(handle, 'cuFileGetParameterPosixPoolSlabArray') __py_cufile_init = True diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index db68c647c..af060f318 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -41,10 +41,10 @@ cdef int get_cuda_version(): raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") if cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') + raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1') err = (cuDriverGetVersion)(&driver_ver) if err != 0: - raise RuntimeError('something went wrong') + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') return driver_ver @@ -72,7 +72,7 @@ cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL -cdef void* load_library(int driver_ver) except* with gil: +cdef void* load_library() except* with gil: cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint return handle @@ -85,105 +85,103 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: cdef void* handle = NULL with gil, __symbol_lock: - driver_ver = get_cuda_version() - # Load function global __nvJitLinkCreate __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') if __nvJitLinkCreate == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkCreate = dlsym(handle, 'nvJitLinkCreate') global __nvJitLinkDestroy __nvJitLinkDestroy = dlsym(RTLD_DEFAULT, 'nvJitLinkDestroy') if __nvJitLinkDestroy == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkDestroy = dlsym(handle, 'nvJitLinkDestroy') global __nvJitLinkAddData __nvJitLinkAddData = dlsym(RTLD_DEFAULT, 'nvJitLinkAddData') if __nvJitLinkAddData == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkAddData = dlsym(handle, 'nvJitLinkAddData') global __nvJitLinkAddFile __nvJitLinkAddFile = dlsym(RTLD_DEFAULT, 'nvJitLinkAddFile') if __nvJitLinkAddFile == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkAddFile = dlsym(handle, 'nvJitLinkAddFile') global __nvJitLinkComplete __nvJitLinkComplete = dlsym(RTLD_DEFAULT, 'nvJitLinkComplete') if __nvJitLinkComplete == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkComplete = dlsym(handle, 'nvJitLinkComplete') global __nvJitLinkGetLinkedCubinSize __nvJitLinkGetLinkedCubinSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') if __nvJitLinkGetLinkedCubinSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetLinkedCubinSize = dlsym(handle, 'nvJitLinkGetLinkedCubinSize') global __nvJitLinkGetLinkedCubin __nvJitLinkGetLinkedCubin = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') if __nvJitLinkGetLinkedCubin == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetLinkedCubin = dlsym(handle, 'nvJitLinkGetLinkedCubin') global __nvJitLinkGetLinkedPtxSize __nvJitLinkGetLinkedPtxSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') if __nvJitLinkGetLinkedPtxSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetLinkedPtxSize = dlsym(handle, 'nvJitLinkGetLinkedPtxSize') global __nvJitLinkGetLinkedPtx __nvJitLinkGetLinkedPtx = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') if __nvJitLinkGetLinkedPtx == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetLinkedPtx = dlsym(handle, 'nvJitLinkGetLinkedPtx') global __nvJitLinkGetErrorLogSize __nvJitLinkGetErrorLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') if __nvJitLinkGetErrorLogSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetErrorLogSize = dlsym(handle, 'nvJitLinkGetErrorLogSize') global __nvJitLinkGetErrorLog __nvJitLinkGetErrorLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLog') if __nvJitLinkGetErrorLog == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetErrorLog = dlsym(handle, 'nvJitLinkGetErrorLog') global __nvJitLinkGetInfoLogSize __nvJitLinkGetInfoLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') if __nvJitLinkGetInfoLogSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetInfoLogSize = dlsym(handle, 'nvJitLinkGetInfoLogSize') global __nvJitLinkGetInfoLog __nvJitLinkGetInfoLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLog') if __nvJitLinkGetInfoLog == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkGetInfoLog = dlsym(handle, 'nvJitLinkGetInfoLog') global __nvJitLinkVersion __nvJitLinkVersion = dlsym(RTLD_DEFAULT, 'nvJitLinkVersion') if __nvJitLinkVersion == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') __py_nvjitlink_init = True diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index efc15834a..730a41556 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -99,8 +99,6 @@ cdef int _check_or_init_nvjitlink() except -1 nogil: return 0 with gil, __symbol_lock: - driver_ver = get_cuda_version() - # Load library handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 2eaff11c3..add0ccfb7 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -41,10 +41,10 @@ cdef int get_cuda_version(): raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") if cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') + raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1') err = (cuDriverGetVersion)(&driver_ver) if err != 0: - raise RuntimeError('something went wrong') + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') return driver_ver @@ -71,7 +71,7 @@ cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL -cdef void* load_library(const int driver_ver) except* with gil: +cdef void* load_library() except* with gil: cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint return handle @@ -84,98 +84,96 @@ cdef int _check_or_init_nvvm() except -1 nogil: cdef void* handle = NULL with gil, __symbol_lock: - driver_ver = get_cuda_version() - # Load function global __nvvmGetErrorString __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') if __nvvmGetErrorString == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmGetErrorString = dlsym(handle, 'nvvmGetErrorString') global __nvvmVersion __nvvmVersion = dlsym(RTLD_DEFAULT, 'nvvmVersion') if __nvvmVersion == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmVersion = dlsym(handle, 'nvvmVersion') global __nvvmIRVersion __nvvmIRVersion = dlsym(RTLD_DEFAULT, 'nvvmIRVersion') if __nvvmIRVersion == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmIRVersion = dlsym(handle, 'nvvmIRVersion') global __nvvmCreateProgram __nvvmCreateProgram = dlsym(RTLD_DEFAULT, 'nvvmCreateProgram') if __nvvmCreateProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmCreateProgram = dlsym(handle, 'nvvmCreateProgram') global __nvvmDestroyProgram __nvvmDestroyProgram = dlsym(RTLD_DEFAULT, 'nvvmDestroyProgram') if __nvvmDestroyProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmDestroyProgram = dlsym(handle, 'nvvmDestroyProgram') global __nvvmAddModuleToProgram __nvvmAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmAddModuleToProgram') if __nvvmAddModuleToProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmAddModuleToProgram = dlsym(handle, 'nvvmAddModuleToProgram') global __nvvmLazyAddModuleToProgram __nvvmLazyAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') if __nvvmLazyAddModuleToProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmLazyAddModuleToProgram = dlsym(handle, 'nvvmLazyAddModuleToProgram') global __nvvmCompileProgram __nvvmCompileProgram = dlsym(RTLD_DEFAULT, 'nvvmCompileProgram') if __nvvmCompileProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmCompileProgram = dlsym(handle, 'nvvmCompileProgram') global __nvvmVerifyProgram __nvvmVerifyProgram = dlsym(RTLD_DEFAULT, 'nvvmVerifyProgram') if __nvvmVerifyProgram == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmVerifyProgram = dlsym(handle, 'nvvmVerifyProgram') global __nvvmGetCompiledResultSize __nvvmGetCompiledResultSize = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResultSize') if __nvvmGetCompiledResultSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmGetCompiledResultSize = dlsym(handle, 'nvvmGetCompiledResultSize') global __nvvmGetCompiledResult __nvvmGetCompiledResult = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResult') if __nvvmGetCompiledResult == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmGetCompiledResult = dlsym(handle, 'nvvmGetCompiledResult') global __nvvmGetProgramLogSize __nvvmGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLogSize') if __nvvmGetProgramLogSize == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmGetProgramLogSize = dlsym(handle, 'nvvmGetProgramLogSize') global __nvvmGetProgramLog __nvvmGetProgramLog = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLog') if __nvvmGetProgramLog == NULL: if handle == NULL: - handle = load_library(driver_ver) + handle = load_library() __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') __py_nvvm_init = True diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index d2f0e48c4..3eb0daa9d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -98,8 +98,6 @@ cdef int _check_or_init_nvvm() except -1 nogil: return 0 with gil, __symbol_lock: - driver_ver = get_cuda_version() - # Load library handle = load_nvidia_dynamic_lib("nvvm")._handle_uint From 4bc9941d55e80f65d83cb8a00b1b3ee685549d30 Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Tue, 16 Sep 2025 13:13:39 -0700 Subject: [PATCH 099/113] [scripts] Adding `run_tests.sh` script (#953) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding script that runs all nested modules unit tests. * updating legal * renaming run_all_tests.sh to run_tests.sh * removing unnecessary file print * Removing unnecessary prints * Using pytest.mark * :Using pytest.mark # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Tue Sep 9 15:07:24 2025 -0700 # # On branch rparolin/run_test_all # Your branch is up to date with 'origin/rparolin/run_test_all'. # # Changes to be committed: # new file: conftest.py # new file: pytest.ini # modified: scripts/run_tests.sh # modified: tests/integration/test_smoke.py # * Fixing filepath in comments. * Removing empty function * Removing integration test placeholder * docs: changing to * Running examples and also running cuda_bindings tests both enabled/disabled flag: CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM * run_all_tests.sh → run_tests.sh (3x) --- conftest.py | 45 +++++ cuda_core/README.md | 6 + cuda_pathfinder/tests/conftest.py | 7 - pytest.ini | 16 ++ scripts/run_tests.sh | 310 ++++++++++++++++++++++++++++++ 5 files changed, 377 insertions(+), 7 deletions(-) create mode 100644 conftest.py create mode 100644 pytest.ini create mode 100755 scripts/run_tests.sh diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..1c4f9d279 --- /dev/null +++ b/conftest.py @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os +import pytest + + +def pytest_collection_modifyitems(config, items): + cuda_home = os.environ.get("CUDA_HOME") + for item in items: + nodeid = item.nodeid.replace("\\", "/") + + # Package markers by path + if ( + nodeid.startswith("cuda_pathfinder/tests/") + or "/cuda_pathfinder/tests/" in nodeid + ): + item.add_marker(pytest.mark.pathfinder) + if ( + nodeid.startswith("cuda_bindings/tests/") + or "/cuda_bindings/tests/" in nodeid + ): + item.add_marker(pytest.mark.bindings) + if nodeid.startswith("cuda_core/tests/") or "/cuda_core/tests/" in nodeid: + item.add_marker(pytest.mark.core) + + # Smoke tests + if nodeid.startswith("tests/integration/") or "/tests/integration/" in nodeid: + item.add_marker(pytest.mark.smoke) + + # Cython tests (any tests/cython subtree) + if ( + "/tests/cython/" in nodeid + or nodeid.endswith("/tests/cython") + or ("/cython/" in nodeid and "/tests/" in nodeid) + ): + item.add_marker(pytest.mark.cython) + + # Gate core cython tests on CUDA_HOME + if "core" in item.keywords and not cuda_home: + item.add_marker( + pytest.mark.skip( + reason="CUDA_HOME not set; skipping core cython tests" + ) + ) diff --git a/cuda_core/README.md b/cuda_core/README.md index 8a863c732..9925511ef 100644 --- a/cuda_core/README.md +++ b/cuda_core/README.md @@ -16,6 +16,12 @@ To run these tests: * `python -m pytest tests/` with editable installations * `pytest tests/` with installed packages +Alternatively, from the repository root you can use a simple script: + +* `./scripts/run_tests.sh core` to run only `cuda_core` tests +* `./scripts/run_tests.sh` to run all package tests (pathfinder → bindings → core) +* `./scripts/run_tests.sh smoke` to run meta-level smoke tests under `tests/integration` + ### Cython Unit Tests Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [those of cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them: diff --git a/cuda_pathfinder/tests/conftest.py b/cuda_pathfinder/tests/conftest.py index cfef9a954..f13c9c6ca 100644 --- a/cuda_pathfinder/tests/conftest.py +++ b/cuda_pathfinder/tests/conftest.py @@ -9,13 +9,6 @@ def pytest_configure(config): config.custom_info = [] -def pytest_terminal_summary(terminalreporter, exitstatus, config): # noqa: ARG001 - if config.custom_info: - terminalreporter.write_sep("=", "INFO summary") - for msg in config.custom_info: - terminalreporter.line(f"INFO {msg}") - - @pytest.fixture def info_summary_append(request): def _append(message): diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..f293d27f7 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[pytest] +testpaths = + cuda_pathfinder/tests + cuda_bindings/tests + cuda_core/tests + tests/integration + +markers = + pathfinder: tests for cuda_pathfinder + bindings: tests for cuda_bindings + core: tests for cuda_core + cython: cython tests + smoke: meta-level smoke tests diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh new file mode 100755 index 000000000..3d63a77f3 --- /dev/null +++ b/scripts/run_tests.sh @@ -0,0 +1,310 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail + +# Simple, dependency-free orchestrator to run tests for all packages. +# Usage: +# scripts/run_tests.sh [ -v|--verbose ] [ --install | --no-install ] [ --with-cython | --skip-cython ] [ --with-examples | --skip-examples ] [ --with-ptds ] +# scripts/run_tests.sh [ flags ] # pathfinder -> bindings -> core +# scripts/run_tests.sh [ flags ] core # only core +# scripts/run_tests.sh [ flags ] bindings # only bindings +# scripts/run_tests.sh [ flags ] pathfinder # only pathfinder +# scripts/run_tests.sh [ flags ] smoke # meta-level import smoke tests + +repo_root=$(cd "$(dirname "$0")/.." && pwd) +cd "${repo_root}" + + +print_help() { + cat <<'USAGE' +Usage: scripts/run_tests.sh [options] [target] + +Targets: + all (default) Run pathfinder → bindings → core + core Run cuda_core tests + bindings Run cuda_bindings tests + pathfinder Run cuda_pathfinder tests + smoke Run meta-level smoke tests (tests/integration) + +Options: + -v, --verbose Verbose pytest output (-ra -s -v) + --install Force editable install with [test] extras + --no-install Skip install checks (assume environment is ready) + --with-cython Build and run cython tests (needs CUDA_HOME for core) + --skip-cython Skip cython tests (default) + --with-examples Run examples where applicable (e.g., cuda_bindings/examples) + --skip-examples Skip running examples (default) + --with-ptds Re-run cuda_bindings tests with PTDS (CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1) + -h, --help Show this help and exit + +Examples: + scripts/run_tests.sh --install + scripts/run_tests.sh --no-install core + scripts/run_tests.sh -v --with-cython bindings + scripts/run_tests.sh smoke +USAGE +} + +# Parse optional flags +VERBOSE=0 +RUN_CYTHON=0 +RUN_EXAMPLES=1 +RUN_PTDS=1 +INSTALL_MODE=auto # auto|force|skip +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + print_help + exit 0 + ;; + -v|--verbose) + VERBOSE=1 + shift + ;; + --install) + INSTALL_MODE=force + shift + ;; + --no-install) + INSTALL_MODE=skip + shift + ;; + --with-cython) + RUN_CYTHON=1 + shift + ;; + --skip-cython) + RUN_CYTHON=0 + shift + ;; + --with-examples) + RUN_EXAMPLES=1 + shift + ;; + --skip-examples) + RUN_EXAMPLES=0 + shift + ;; + --with-ptds) + RUN_PTDS=1 + shift + ;; + *) + break + ;; + esac +done + +target=${1:-all} + +if [[ ${VERBOSE} -eq 1 ]]; then + PYTEST_FLAGS=( -ra -s -v ) +else + # Very quiet: show failures/errors summary only + PYTEST_FLAGS=( -qq ) +fi + +declare -A RESULTS +ORDERED_RESULTS=() + +add_result() { + local name="$1"; shift + local rc="$1"; shift + RESULTS["${name}"]="${rc}" + ORDERED_RESULTS+=("${name}") +} + +status_from_rc() { + local rc="$1" + case "${rc}" in + 0) echo "PASS" ;; + 5) echo "SKIP(no-tests)" ;; + 1) echo "FAIL" ;; + 2) echo "INTERRUPTED" ;; + 3) echo "ERROR" ;; + 4) echo "USAGE" ;; + *) echo "RC=${rc}" ;; + esac +} + +run_pytest() { + # Run pytest safely under set -e and return its exit code + set +e + python -m pytest "${PYTEST_FLAGS[@]}" "$@" + local rc=$? + set -e + return ${rc} +} + +run_pytest_ptds() { + # Run pytest with PTDS env set; safely return its exit code + set +e + CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1 python -m pytest "${PYTEST_FLAGS[@]}" "$@" + local rc=$? + set -e + return ${rc} +} + +ensure_installed() { + # Args: module.import.name repo_subdir + local mod_name="$1"; shift + local subdir_name="$1"; shift + + if [[ "${INSTALL_MODE}" == "skip" ]]; then + return 0 + fi + + if [[ "${INSTALL_MODE}" == "force" ]]; then + pip install -e .[test] + return 0 + fi + + # auto-detect: if module imports from this repo, assume installed; otherwise install + python - </dev/null +import importlib, sys, pathlib +mod = "${mod_name}" +try: + m = importlib.import_module(mod) +except Exception: + sys.exit(2) +p = pathlib.Path(getattr(m, "__file__", "")).resolve() +root = pathlib.Path(r"${repo_root}").resolve() +sub = pathlib.Path(r"${repo_root}/${subdir_name}").resolve() +sys.exit(0 if str(p).startswith(str(sub)) else 3) +PY + rc=$? + if [[ $rc -ne 0 ]]; then + pip install -e .[test] + fi +} + +run_pathfinder() { + echo "[tests] cuda_pathfinder" + cd "${repo_root}/cuda_pathfinder" + ensure_installed "cuda.pathfinder" "cuda_pathfinder" + run_pytest tests/ + local rc=$? + add_result "pathfinder" "${rc}" +} + +run_bindings() { + echo "[tests] cuda_bindings" + cd "${repo_root}/cuda_bindings" + ensure_installed "cuda.bindings" "cuda_bindings" + run_pytest tests/ + local rc=$? + add_result "bindings" "${rc}" + if [ ${RUN_PTDS} -eq 1 ]; then + echo "[tests] cuda_bindings (PTDS)" + run_pytest_ptds tests/ + local rc_ptds=$? + add_result "bindings-ptds" "${rc_ptds}" + fi + if [ ${RUN_EXAMPLES} -eq 1 ] && [ -d examples ]; then + # Bindings examples are pytest-based (contain their own pytest.ini) + echo "[examples] cuda_bindings/examples" + run_pytest examples/ + local rc_ex=$? + add_result "bindings-examples" "${rc_ex}" + fi + if [ ${RUN_CYTHON} -eq 1 ] && [ -d tests/cython ]; then + if [ -x tests/cython/build_tests.sh ]; then + echo "[build] cuda_bindings cython tests" + ( cd tests/cython && ./build_tests.sh ) || true + fi + run_pytest tests/cython + local rc_cy=$? + add_result "bindings-cython" "${rc_cy}" + fi +} + +run_core() { + echo "[tests] cuda_core" + cd "${repo_root}/cuda_core" + ensure_installed "cuda.core" "cuda_core" + run_pytest tests/ + local rc=$? + add_result "core" "${rc}" + if [ ${RUN_EXAMPLES} -eq 1 ] && [ -d examples ] && [ -f examples/pytest.ini ]; then + # Only run examples under pytest if they are configured as tests + echo "[examples] cuda_core/examples" + run_pytest examples/ + local rc_ex=$? + add_result "core-examples" "${rc_ex}" + fi + if [ ${RUN_CYTHON} -eq 1 ] && [ -d tests/cython ]; then + if [ -x tests/cython/build_tests.sh ]; then + echo "[build] cuda_core cython tests" + if [ -z "${CUDA_HOME-}" ]; then + echo "[skip] CUDA_HOME not set; skipping cython tests" + else + ( cd tests/cython && ./build_tests.sh ) || true + fi + fi + run_pytest tests/cython + local rc_cy=$? + add_result "core-cython" "${rc_cy}" + fi +} + +run_smoke() { + echo "[tests] meta-level smoke" + cd "${repo_root}" + python - </dev/null || pip install pytest>=6.2.4 +import pytest +PY + run_pytest tests/integration + local rc=$? + add_result "smoke" "${rc}" +} + +case "${target}" in + all) + run_pathfinder + run_bindings + run_core + ;; + core) + run_core ;; + bindings) + run_bindings ;; + pathfinder) + run_pathfinder ;; + smoke) + run_smoke ;; + *) + echo "Unknown target: ${target}" >&2 + exit 1 + ;; +esac + +# Print summary +echo +echo "==================== Test Summary ====================" +overall_rc=0 +if [ -t 1 ]; then + GREEN=$(printf '\033[32m') + RED=$(printf '\033[31m') + RESET=$(printf '\033[0m') +else + GREEN=""; RED=""; RESET="" +fi +for name in "${ORDERED_RESULTS[@]}"; do + rc="${RESULTS[$name]}" + status=$(status_from_rc "${rc}") + color="" + case "${status}" in + PASS) color="${GREEN}" ;; + FAIL|ERROR|INTERRUPTED|USAGE|RC=*) color="${RED}" ;; + *) color="" ;; + esac + printf "%-18s : %s%s%s\n" "${name}" "${color}" "${status}" "${RESET}" + if [[ "${rc}" -ne 0 && "${rc}" -ne 5 ]]; then + overall_rc=1 + fi +done +echo "======================================================" +exit ${overall_rc} From 3749929ffacd876c7d1e82c3aca00f81d4959c7e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 16 Sep 2025 19:58:25 -0400 Subject: [PATCH 100/113] Fix #702: Update cyruntime.getLocalRuntimeVersion to use pathfinder (#929) * Fix #702: Update cyruntime.getLocalRuntimeVersion to use pathfinder * Try to fix Windows build * Fix Windows * More realistic minimum version * Simplify gil handling * Unload module when done with it * Don't need try/except on Windows * Don't need gil * Fix message * Fix test * DynamicLibrary -> DynamicLib * Update to not use pywin32 * Add cast * Try to fix cast again * Try to fix cast again * Address comments in PR * Fix lib -> loaded_dl * Add changelog --- cuda_bindings/cuda/bindings/_lib/windll.pxd | 6 ++++ cuda_bindings/cuda/bindings/cyruntime.pyx.in | 33 ++++++++++++------- .../docs/source/release/12.9.X-notes.rst | 1 + .../docs/source/release/13.X.Y-notes.rst | 1 + cuda_bindings/tests/test_cudart.py | 11 +++++++ 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/cuda/bindings/_lib/windll.pxd index e3f86285e..7b190f359 100644 --- a/cuda_bindings/cuda/bindings/_lib/windll.pxd +++ b/cuda_bindings/cuda/bindings/_lib/windll.pxd @@ -12,6 +12,7 @@ cdef extern from "windows.h" nogil: ctypedef unsigned long DWORD ctypedef const wchar_t *LPCWSTR ctypedef const char *LPCSTR + ctypedef int BOOL cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 @@ -23,6 +24,8 @@ cdef extern from "windows.h" nogil: FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + BOOL _FreeLibrary "FreeLibrary"(HMODULE hLibModule) + cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): cdef uintptr_t result cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) @@ -37,3 +40,6 @@ cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): cdef inline FARPROC GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: return _GetProcAddress(hModule, lpProcName) + +cdef inline BOOL FreeLibrary(uintptr_t hLibModule) nogil: + return _FreeLibrary(hLibModule) diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in index 7f5c96e05..950e106c5 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -1885,35 +1885,46 @@ cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** r {{if True}} -{{if 'Windows' != platform.system()}} +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +{{if 'Windows' == platform.system()}} +cimport cuda.bindings._lib.windll as windll +{{else}} cimport cuda.bindings._lib.dlfcn as dlfcn {{endif}} cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: - {{if 'Windows' == platform.system()}} - with gil: - raise NotImplementedError('"getLocalRuntimeVersion" is unsupported on Windows') - {{else}} + # Load - handle = dlfcn.dlopen('libcudart.so.13', dlfcn.RTLD_NOW) - if handle == NULL: - with gil: - raise RuntimeError(f'Failed to dlopen libcudart.so.13') + with gil: + loaded_dl = load_nvidia_dynamic_lib("cudart") + {{if 'Windows' == platform.system()}} + handle = loaded_dl._handle_uint + {{else}} + handle = loaded_dl._handle_uint + {{endif}} + {{if 'Windows' == platform.system()}} + __cudaRuntimeGetVersion = windll.GetProcAddress(handle, b'cudaRuntimeGetVersion') + {{else}} __cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion') + {{endif}} if __cudaRuntimeGetVersion == NULL: with gil: - raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in libcudart.so.13') + raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in {loaded_dl.abs_path}') # Call cdef cudaError_t err = cudaSuccess err = ( __cudaRuntimeGetVersion)(runtimeVersion) # Unload + {{if 'Windows' == platform.system()}} + windll.FreeLibrary(handle) + {{else}} dlfcn.dlclose(handle) + {{endif}} # Return return err - {{endif}} {{endif}} diff --git a/cuda_bindings/docs/source/release/12.9.X-notes.rst b/cuda_bindings/docs/source/release/12.9.X-notes.rst index 76de5d795..7a4713a89 100644 --- a/cuda_bindings/docs/source/release/12.9.X-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.X-notes.rst @@ -15,6 +15,7 @@ Highlights * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. * The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. * Updated the ``cuda.bindings.runtime`` module to statically link against the CUDA Runtime library from CUDA Toolkit 12.9.1. +* ``cyruntime.getLocalRuntimeVersion`` now uses pathfinder to find the CUDA runtime. Known issues diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 9e57410ff..2f29a9dc0 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -18,6 +18,7 @@ Highlights * The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. * On Windows, the ``pywin32`` dependency has been removed. The necessary Windows API functions are now accessed directly. * Updated the ``cuda.bindings.runtime`` module to statically link against the CUDA Runtime library from CUDA Toolkit 13.0.1. +* ``cyruntime.getLocalRuntimeVersion`` now uses pathfinder to find the CUDA runtime. Known issues diff --git a/cuda_bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py index 21e902733..6f8fc009e 100644 --- a/cuda_bindings/tests/test_cudart.py +++ b/cuda_bindings/tests/test_cudart.py @@ -9,6 +9,7 @@ import cuda.bindings.driver as cuda import cuda.bindings.runtime as cudart +from cuda import pathfinder from cuda.bindings import runtime @@ -1400,3 +1401,13 @@ def test_struct_pointer_comparison(target): c = target(456) assert a != c assert hash(a) != hash(c) + + +def test_getLocalRuntimeVersion(): + try: + err, version = cudart.getLocalRuntimeVersion() + except pathfinder.DynamicLibNotFoundError: + pytest.skip("cudart dynamic lib not available") + else: + assertSuccess(err) + assert version >= 12000 # CUDA 12.0 From 365bf079f54d10993c1e036e280c6217a20969cf Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 16 Sep 2025 20:05:35 -0400 Subject: [PATCH 101/113] feat: add support for CUcheckpointRestoreArgs (#975) * feat: add support for CUcheckpointRestoreArgs * feat: generate APIs that use the newly allowed struct * chore: replace to avoid failure to parse * chore: fmt * Update release notes for CUDA bindings 13.X.Y --------- Co-authored-by: Leo Fang --- .../cuda/bindings/_bindings/cydriver.pxd.in | 5 + .../cuda/bindings/_bindings/cydriver.pyx.in | 32 +++ cuda_bindings/cuda/bindings/cydriver.pxd.in | 13 ++ cuda_bindings/cuda/bindings/cydriver.pyx.in | 6 + cuda_bindings/cuda/bindings/driver.pxd.in | 74 +++++++ cuda_bindings/cuda/bindings/driver.pyx.in | 195 ++++++++++++++++++ cuda_bindings/docs/source/module/driver.rst | 3 + .../docs/source/release/13.X.Y-notes.rst | 6 + cuda_bindings/setup.py | 3 + 9 files changed, 337 insertions(+) diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in index 50701f70d..8038f8d95 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in @@ -2239,6 +2239,11 @@ cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) exce cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCheckpointProcessRestore' in found_functions}} + +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 6eba78880..664d322b8 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -463,6 +463,7 @@ cdef bint __cuPythonInit = False {{if 'cuCheckpointProcessGetState' in found_functions}}cdef void *__cuCheckpointProcessGetState = NULL{{endif}} {{if 'cuCheckpointProcessLock' in found_functions}}cdef void *__cuCheckpointProcessLock = NULL{{endif}} {{if 'cuCheckpointProcessCheckpoint' in found_functions}}cdef void *__cuCheckpointProcessCheckpoint = NULL{{endif}} +{{if 'cuCheckpointProcessRestore' in found_functions}}cdef void *__cuCheckpointProcessRestore = NULL{{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}}cdef void *__cuCheckpointProcessUnlock = NULL{{endif}} {{if 'cuProfilerStart' in found_functions}}cdef void *__cuProfilerStart = NULL{{endif}} {{if 'cuProfilerStop' in found_functions}}cdef void *__cuProfilerStop = NULL{{endif}} @@ -2667,6 +2668,10 @@ cdef int _cuPythonInit() except -1 nogil: global __cuCheckpointProcessCheckpoint _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + _F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) @@ -4895,6 +4900,10 @@ cdef int _cuPythonInit() except -1 nogil: global __cuCheckpointProcessCheckpoint __cuCheckpointProcessCheckpoint = windll.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + __cuCheckpointProcessRestore = windll.GetProcAddress(handle, 'cuCheckpointProcessRestore') + {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock __cuCheckpointProcessUnlock = windll.GetProcAddress(handle, 'cuCheckpointProcessUnlock') @@ -7120,6 +7129,10 @@ cdef int _cuPythonInit() except -1 nogil: global __cuCheckpointProcessCheckpoint __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore') + {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') @@ -12583,6 +12596,18 @@ cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs return err {{endif}} +{{if 'cuCheckpointProcessRestore' in found_functions}} + +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessRestore + cuPythonInit() + if __cuCheckpointProcessRestore == NULL: + with gil: + raise RuntimeError('Function "cuCheckpointProcessRestore" not found') + err = ( __cuCheckpointProcessRestore)(pid, args) + return err +{{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -15986,6 +16011,13 @@ cpdef dict _inspect_function_pointers(): data["__cuCheckpointProcessCheckpoint"] = 0 {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + data["__cuCheckpointProcessRestore"] = __cuCheckpointProcessRestore + {{else}} + data["__cuCheckpointProcessRestore"] = 0 + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} global __cuCheckpointProcessUnlock data["__cuCheckpointProcessUnlock"] = __cuCheckpointProcessUnlock diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/cydriver.pxd.in index e3fe2f881..e3c22aba6 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/cydriver.pxd.in @@ -2357,6 +2357,14 @@ cdef extern from "cuda.h": ctypedef CUcheckpointGpuPair_st CUcheckpointGpuPair + cdef struct CUcheckpointRestoreArgs_st: + CUcheckpointGpuPair* gpuPairs + unsigned int gpuPairsCount + char reserved[44] + cuuint64_t reserved1 + + ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + cdef struct CUcheckpointUnlockArgs_st: cuuint64_t reserved[8] @@ -4907,6 +4915,11 @@ cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) excep cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil {{endif}} +{{if 'cuCheckpointProcessRestore' in found_functions}} + +cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +{{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings/cuda/bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/cydriver.pyx.in index 5bd49954d..757e977ea 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/cydriver.pyx.in @@ -2686,6 +2686,12 @@ cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* 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: diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in index ef68053b5..0a0131f5b 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd.in @@ -5058,6 +5058,47 @@ cdef class CUcheckpointGpuPair_st: cdef CUuuid _newUuid {{endif}} {{endif}} +{{if 'CUcheckpointRestoreArgs_st' in found_struct}} + +cdef class CUcheckpointRestoreArgs_st: + """ + CUDA checkpoint optional restore arguments + + Attributes + ---------- + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + gpuPairs : CUcheckpointGpuPair + Pointer to array of gpu pairs that indicate how to remap GPUs + during restore + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} + gpuPairsCount : unsigned int + Number of gpu pairs to remap + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + reserved : bytes + Reserved for future use, must be zeroed + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + reserved1 : cuuint64_t + Reserved for future use, must be zeroed + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointRestoreArgs_st _pvt_val + cdef cydriver.CUcheckpointRestoreArgs_st* _pvt_ptr + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + cdef size_t _gpuPairs_length + cdef cydriver.CUcheckpointGpuPair* _gpuPairs + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + cdef cuuint64_t _reserved1 + {{endif}} +{{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} cdef class CUcheckpointUnlockArgs_st: @@ -10563,6 +10604,39 @@ cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): """ pass {{endif}} +{{if 'CUcheckpointRestoreArgs' in found_types}} + +cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): + """ + CUDA checkpoint optional restore arguments + + Attributes + ---------- + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + gpuPairs : CUcheckpointGpuPair + Pointer to array of gpu pairs that indicate how to remap GPUs + during restore + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} + gpuPairsCount : unsigned int + Number of gpu pairs to remap + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + reserved : bytes + Reserved for future use, must be zeroed + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + reserved1 : cuuint64_t + Reserved for future use, must be zeroed + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} {{if 'CUcheckpointUnlockArgs' in found_types}} cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 2fdcf8038..4850d1a4a 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -22059,6 +22059,154 @@ cdef class CUcheckpointGpuPair_st: string.memcpy(&self._pvt_ptr[0].newUuid, newUuid.getPtr(), sizeof(self._pvt_ptr[0].newUuid)) {{endif}} {{endif}} +{{if 'CUcheckpointRestoreArgs_st' in found_struct}} + +cdef class CUcheckpointRestoreArgs_st: + """ + CUDA checkpoint optional restore arguments + + Attributes + ---------- + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + gpuPairs : CUcheckpointGpuPair + Pointer to array of gpu pairs that indicate how to remap GPUs + during restore + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} + gpuPairsCount : unsigned int + Number of gpu pairs to remap + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + reserved : bytes + Reserved for future use, must be zeroed + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + reserved1 : cuuint64_t + Reserved for future use, must be zeroed + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + self._reserved1 = cuuint64_t(_ptr=&self._pvt_ptr[0].reserved1) + {{endif}} + def __dealloc__(self): + pass + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + if self._gpuPairs is not NULL: + free(self._gpuPairs) + {{endif}} + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + try: + str_list += ['gpuPairs : ' + str(self.gpuPairs)] + except ValueError: + str_list += ['gpuPairs : '] + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} + try: + str_list += ['gpuPairsCount : ' + str(self.gpuPairsCount)] + except ValueError: + str_list += ['gpuPairsCount : '] + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + try: + str_list += ['reserved1 : ' + str(self.reserved1)] + except ValueError: + str_list += ['reserved1 : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} + @property + def gpuPairs(self): + arrs = [self._pvt_ptr[0].gpuPairs + x*sizeof(cydriver.CUcheckpointGpuPair) for x in range(self._gpuPairs_length)] + return [CUcheckpointGpuPair(_ptr=arr) for arr in arrs] + @gpuPairs.setter + def gpuPairs(self, val): + if len(val) == 0: + free(self._gpuPairs) + self._gpuPairs_length = 0 + self._pvt_ptr[0].gpuPairs = NULL + else: + if self._gpuPairs_length != len(val): + free(self._gpuPairs) + self._gpuPairs = calloc(len(val), sizeof(cydriver.CUcheckpointGpuPair)) + if self._gpuPairs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUcheckpointGpuPair))) + self._gpuPairs_length = len(val) + self._pvt_ptr[0].gpuPairs = self._gpuPairs + for idx in range(len(val)): + string.memcpy(&self._gpuPairs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointGpuPair)) + + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} + @property + def gpuPairsCount(self): + return self._pvt_ptr[0].gpuPairsCount + @gpuPairsCount.setter + def gpuPairsCount(self, unsigned int gpuPairsCount): + self._pvt_ptr[0].gpuPairsCount = gpuPairsCount + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 44) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 44: + raise ValueError("reserved length must be 44, is " + str(len(reserved))) + if CHAR_MIN == 0: + for i, b in enumerate(reserved): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].reserved[i] = b + else: + for i, b in enumerate(reserved): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].reserved[i] = b + {{endif}} + {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} + @property + def reserved1(self): + return self._reserved1 + @reserved1.setter + def reserved1(self, reserved1): + cdef cydriver.cuuint64_t cyreserved1 + if reserved1 is None: + cyreserved1 = 0 + elif isinstance(reserved1, (cuuint64_t)): + preserved1 = int(reserved1) + cyreserved1 = preserved1 + else: + preserved1 = int(cuuint64_t(reserved1)) + cyreserved1 = preserved1 + self._reserved1._pvt_ptr[0] = cyreserved1 + + {{endif}} +{{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} cdef class CUcheckpointUnlockArgs_st: @@ -51890,6 +52038,47 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin return (_dict_CUresult[err],) {{endif}} +{{if 'cuCheckpointProcessRestore' in found_functions}} + +@cython.embedsignature(True) +def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs]): + """ Restore a CUDA process's GPU memory contents from its last checkpoint. + + Restores a CUDA process specified by `pid` from its last checkpoint. + Process must be in the CHECKPOINTED state to restore. + + GPU UUID pairs can be specified in `args` to remap the process old GPUs + onto new GPUs. The GPU to restore onto needs to have enough memory and + be of the same chip type as the old GPU. If an array of GPU UUID pairs + is specified, it must contain every checkpointed GPU. + + Upon successful return the process will be in the LOCKED state. + + CUDA process restore requires persistence mode to be enabled or + :py:obj:`~.cuInit` to have been called before execution. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + args : :py:obj:`~.CUcheckpointRestoreArgs` + Optional restore operation arguments + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuInit` + """ + cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL + with nogil: + err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) + return (_dict_CUresult[err],) +{{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} @cython.embedsignature(True) @@ -53868,6 +54057,12 @@ def sizeof(objType): {{if 'CUcheckpointGpuPair' in found_types}} if objType == CUcheckpointGpuPair: return sizeof(cydriver.CUcheckpointGpuPair){{endif}} + {{if 'CUcheckpointRestoreArgs_st' in found_struct}} + if objType == CUcheckpointRestoreArgs_st: + return sizeof(cydriver.CUcheckpointRestoreArgs_st){{endif}} + {{if 'CUcheckpointRestoreArgs' in found_types}} + if objType == CUcheckpointRestoreArgs: + return sizeof(cydriver.CUcheckpointRestoreArgs){{endif}} {{if 'CUcheckpointUnlockArgs_st' in found_struct}} if objType == CUcheckpointUnlockArgs_st: return sizeof(cydriver.CUcheckpointUnlockArgs_st){{endif}} diff --git a/cuda_bindings/docs/source/module/driver.rst b/cuda_bindings/docs/source/module/driver.rst index 04e0390d1..bcdd1cace 100644 --- a/cuda_bindings/docs/source/module/driver.rst +++ b/cuda_bindings/docs/source/module/driver.rst @@ -86,6 +86,7 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair_st +.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs_st .. autoclass:: cuda.bindings.driver.CUeglFrame_st .. autoclass:: cuda.bindings.driver.CUipcMem_flags @@ -6102,6 +6103,7 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs .. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair +.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs .. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs .. autoclass:: cuda.bindings.driver.CUeglFrame_v1 .. autoclass:: cuda.bindings.driver.CUeglFrame @@ -7345,6 +7347,7 @@ Checkpoint and restore capabilities are currently restricted to Linux. .. autofunction:: cuda.bindings.driver.cuCheckpointProcessGetState .. autofunction:: cuda.bindings.driver.cuCheckpointProcessLock .. autofunction:: cuda.bindings.driver.cuCheckpointProcessCheckpoint +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessRestore .. autofunction:: cuda.bindings.driver.cuCheckpointProcessUnlock EGL Interoperability diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 2f29a9dc0..35e40c4be 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -21,6 +21,12 @@ Highlights * ``cyruntime.getLocalRuntimeVersion`` now uses pathfinder to find the CUDA runtime. +Bug fixes +--------- + +* Restoring the :func:`~driver.cuCheckpointProcessRestore` API removed by mistake. + + Known issues ------------ diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index dabed2a13..0bddead97 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -148,6 +148,9 @@ def parse_headers(header_dict): " enum ": " ", ", enum ": ", ", "\\(enum ": "(", + # Since we only support 64 bit architectures, we can inline the sizeof(T*) to 8 and then compute the + # result in Python. The arithmetic expression is preserved to help with clarity and understanding + r"char reserved\[52 - sizeof\(CUcheckpointGpuPair \*\)\];": rf"char reserved[{52 - 8}];", } print(f'Parsing headers in "{include_path_list}" (Caching = {PARSER_CACHING})') From d97a2cc15123910605f119bf682289a8cdc184d6 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 16 Sep 2025 23:48:52 -0700 Subject: [PATCH 102/113] `cuda.pathfinder._find_nvidia_header_directory()`: add support for CTK libs (#956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New supported_nvidia_headers.py, starting with just SUPPORTED_HEADERS_CTK, SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK dicts. * Add _find_ctk_header_directory(), currently for site-packages only. * Factor out get_cuda_home_or_path() into new cuda/pathfinder/_utils/env_vars.py * Add CUDA_HOME code in find_nvidia_headers.py * Formalize supported_nvidia_headers.CCCL_LIBNAMES * Add CONDA_PREFIX code in find_nvidia_headers.py * Add `shutil.which("nvcc")` code in find_nvidia_headers.py * Cleanup: add _joined_isfile() helper * find_nvidia_header_directory(): return _abs_norm() * Bump pathfinder version to 1.2.3a0 * Replace libcudacxx,cub,thrust with cccl. Add cuda-toolkit[cccl] to nvidia_wheels_cu12, nvidia_wheels_cu13 * SUPPORTED_HEADERS_CTK_LINUX_ONLY etc. (for cufile) * Insert _find_based_on_conda_layout() * Remove `shutil.which("nvcc")` code (it finds all includes on Windows with conda) * Remove cccl code * conda windows support * Replace cusolver_common.h → cusolverDn.h * UserWarning: Both CUDA_HOME and CUDA_PATH are set but differ * Remove `cccl` again in pyproject.toml * Revert "Remove `cccl` again in pyproject.toml" This reverts commit 826398db17305486fa6668163fe4a3860f82995e. * Revert "Remove cccl code" This reverts commit 4d4ff77d2dff93e3534692e4a4cf8bd2490f630b. * Remove `cuda-cccl` include path in SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK * Apply reviewer suggestion: https://github.com/NVIDIA/cuda-python/pull/956#discussion_r2350273284 * Add find_nvidia_header_directory docstring. * Add _SUPPORTED_HEADERS_CTK to public API * Add cuda_pathfinder 1.2.3 Release notes * Remove leading underscores: _SUPPORTED_HEADERS_CTK, _find_nvidia_header_directory * docstring in __init__.py, using `#: ` Sphinx-specific markup A triple-quoted docstring worked for Sphinx but tripped up the check-docstring-first pre-commit check. * Bump pathfinder version to 1.2.3 (for release) and change release date to Sep 17 * Make comment less ambiguous. * Remove subtitle as suggested by reviewer. --- cuda_pathfinder/cuda/pathfinder/__init__.py | 18 +- .../_dynamic_libs/find_nvidia_dynamic_lib.py | 10 +- .../_headers/find_nvidia_headers.py | 132 +++++++++++-- .../_headers/supported_nvidia_headers.py | 60 ++++++ .../cuda/pathfinder/_utils/env_vars.py | 52 +++++ cuda_pathfinder/cuda/pathfinder/_version.py | 2 +- cuda_pathfinder/docs/nv-versions.json | 4 + cuda_pathfinder/docs/source/api.rst | 9 +- cuda_pathfinder/docs/source/release.rst | 1 + .../docs/source/release/1.2.3-notes.rst | 17 ++ cuda_pathfinder/pyproject.toml | 4 +- .../tests/test_find_nvidia_headers.py | 25 ++- cuda_pathfinder/tests/test_utils_env_vars.py | 181 ++++++++++++++++++ toolshed/setup-docs-env.sh | 2 +- 14 files changed, 484 insertions(+), 33 deletions(-) create mode 100644 cuda_pathfinder/cuda/pathfinder/_headers/supported_nvidia_headers.py create mode 100644 cuda_pathfinder/cuda/pathfinder/_utils/env_vars.py create mode 100644 cuda_pathfinder/docs/source/release/1.2.3-notes.rst create mode 100644 cuda_pathfinder/tests/test_utils_env_vars.py diff --git a/cuda_pathfinder/cuda/pathfinder/__init__.py b/cuda_pathfinder/cuda/pathfinder/__init__.py index 53f2527c7..d931a264c 100644 --- a/cuda_pathfinder/cuda/pathfinder/__init__.py +++ b/cuda_pathfinder/cuda/pathfinder/__init__.py @@ -1,13 +1,25 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +"""cuda.pathfinder public APIs""" + from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError as DynamicLibNotFoundError from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL as LoadedDL from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import load_nvidia_dynamic_lib as load_nvidia_dynamic_lib from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( SUPPORTED_LIBNAMES as SUPPORTED_NVIDIA_LIBNAMES, # noqa: F401 ) -from cuda.pathfinder._headers.find_nvidia_headers import ( - find_nvidia_header_directory as _find_nvidia_header_directory, # noqa: F401 -) +from cuda.pathfinder._headers.find_nvidia_headers import find_nvidia_header_directory as find_nvidia_header_directory +from cuda.pathfinder._headers.supported_nvidia_headers import SUPPORTED_HEADERS_CTK as _SUPPORTED_HEADERS_CTK from cuda.pathfinder._version import __version__ as __version__ + +# Indirection to help Sphinx find the docstring. +#: Mapping from short CUDA Toolkit (CTK) library names to their canonical +#: header basenames (used to validate a discovered include directory). +#: Example: ``"cublas" → "cublas.h"``. The key set is platform-aware +#: (e.g., ``"cufile"`` may be Linux-only). +SUPPORTED_HEADERS_CTK = _SUPPORTED_HEADERS_CTK + +# Backward compatibility: _find_nvidia_header_directory was added in release 1.2.2. +# It will be removed in release 1.2.4. +_find_nvidia_header_directory = find_nvidia_header_directory diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py index 18708a2b3..d9567207e 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py @@ -14,6 +14,7 @@ SITE_PACKAGES_LIBDIRS_WINDOWS, is_suppressed_dll_file, ) +from cuda.pathfinder._utils.env_vars import get_cuda_home_or_path from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs, find_sub_dirs_all_sitepackages @@ -79,15 +80,8 @@ def _find_dll_using_nvidia_bin_dirs( return None -def _get_cuda_home() -> Optional[str]: - cuda_home = os.environ.get("CUDA_HOME") - if cuda_home is None: - cuda_home = os.environ.get("CUDA_PATH") - return cuda_home - - def _find_lib_dir_using_cuda_home(libname: str) -> Optional[str]: - cuda_home = _get_cuda_home() + cuda_home = get_cuda_home_or_path() if cuda_home is None: return None subdirs_list: tuple[tuple[str, ...], ...] diff --git a/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py b/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py index cc2c8654c..f97f12c06 100644 --- a/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py +++ b/cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py @@ -6,16 +6,24 @@ import os from typing import Optional -from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import IS_WINDOWS +from cuda.pathfinder._headers import supported_nvidia_headers +from cuda.pathfinder._headers.supported_nvidia_headers import IS_WINDOWS +from cuda.pathfinder._utils.env_vars import get_cuda_home_or_path from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages -@functools.cache -def find_nvidia_header_directory(libname: str) -> Optional[str]: - if libname != "nvshmem": - raise RuntimeError(f"UNKNOWN {libname=}") +def _abs_norm(path: Optional[str]) -> Optional[str]: + if path: + return os.path.normpath(os.path.abspath(path)) + return None + + +def _joined_isfile(dirpath: str, basename: str) -> bool: + return os.path.isfile(os.path.join(dirpath, basename)) - if libname == "nvshmem" and IS_WINDOWS: + +def _find_nvshmem_header_directory() -> Optional[str]: + if IS_WINDOWS: # nvshmem has no Windows support. return None @@ -23,20 +31,120 @@ def find_nvidia_header_directory(libname: str) -> Optional[str]: nvidia_sub_dirs = ("nvidia", "nvshmem", "include") hdr_dir: str # help mypy for hdr_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") - if os.path.isfile(nvshmem_h_path): + if _joined_isfile(hdr_dir, "nvshmem.h"): return hdr_dir conda_prefix = os.environ.get("CONDA_PREFIX") if conda_prefix and os.path.isdir(conda_prefix): hdr_dir = os.path.join(conda_prefix, "include") - nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") - if os.path.isfile(nvshmem_h_path): + if _joined_isfile(hdr_dir, "nvshmem.h"): return hdr_dir for hdr_dir in sorted(glob.glob("/usr/include/nvshmem_*"), reverse=True): - nvshmem_h_path = os.path.join(hdr_dir, "nvshmem.h") - if os.path.isfile(nvshmem_h_path): + if _joined_isfile(hdr_dir, "nvshmem.h"): return hdr_dir return None + + +def _find_based_on_ctk_layout(libname: str, h_basename: str, anchor_point: str) -> Optional[str]: + parts = [anchor_point] + if libname == "nvvm": + parts.append(libname) + parts.append("include") + idir = os.path.join(*parts) + if libname == "cccl": + cdir = os.path.join(idir, "cccl") # CTK 13 + if _joined_isfile(cdir, h_basename): + return cdir + if _joined_isfile(idir, h_basename): + return idir + return None + + +def _find_based_on_conda_layout(libname: str, h_basename: str, conda_prefix: str) -> Optional[str]: + if IS_WINDOWS: + anchor_point = os.path.join(conda_prefix, "Library") + if not os.path.isdir(anchor_point): + return None + else: + targets_include_path = glob.glob(os.path.join(conda_prefix, "targets", "*", "include")) + if not targets_include_path: + return None + if len(targets_include_path) != 1: + # Conda does not support multiple architectures. + # QUESTION(PR#956): Do we want to issue a warning? + return None + anchor_point = os.path.dirname(targets_include_path[0]) + return _find_based_on_ctk_layout(libname, h_basename, anchor_point) + + +def _find_ctk_header_directory(libname: str) -> Optional[str]: + h_basename = supported_nvidia_headers.SUPPORTED_HEADERS_CTK[libname] + candidate_dirs = supported_nvidia_headers.SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK[libname] + + # Installed from a wheel + for cdir in candidate_dirs: + hdr_dir: str # help mypy + for hdr_dir in find_sub_dirs_all_sitepackages(tuple(cdir.split("/"))): + if _joined_isfile(hdr_dir, h_basename): + return hdr_dir + + conda_prefix = os.getenv("CONDA_PREFIX") + if conda_prefix: # noqa: SIM102 + if result := _find_based_on_conda_layout(libname, h_basename, conda_prefix): + return result + + cuda_home = get_cuda_home_or_path() + if cuda_home: # noqa: SIM102 + if result := _find_based_on_ctk_layout(libname, h_basename, cuda_home): + return result + + return None + + +@functools.cache +def find_nvidia_header_directory(libname: str) -> Optional[str]: + """Locate the header directory for a supported NVIDIA library. + + Args: + libname (str): The short name of the library whose headers are needed + (e.g., ``"nvrtc"``, ``"cusolver"``, ``"nvshmem"``). + + Returns: + str or None: Absolute path to the discovered header directory, or ``None`` + if the headers cannot be found. + + Raises: + RuntimeError: If ``libname`` is not in the supported set. + + Search order: + 1. **NVIDIA Python wheels** + + - Scan installed distributions (``site-packages``) for header layouts + shipped in NVIDIA wheels (e.g., ``cuda-toolkit[nvrtc]``). + + 2. **Conda environments** + + - Check Conda-style installation prefixes, which use platform-specific + include directory layouts. + + 3. **CUDA Toolkit environment variables** + + - Use ``CUDA_HOME`` or ``CUDA_PATH`` (in that order). + + Notes: + - The ``SUPPORTED_HEADERS_CTK`` dictionary maps each supported CUDA Toolkit + (CTK) library to the name of its canonical header (e.g., ``"cublas" → + "cublas.h"``). This is used to verify that the located directory is valid. + + - The only supported non-CTK library at present is ``nvshmem``. + """ + + if libname == "nvshmem": + return _abs_norm(_find_nvshmem_header_directory()) + + if libname in supported_nvidia_headers.SUPPORTED_HEADERS_CTK: + return _abs_norm(_find_ctk_header_directory(libname)) + + raise RuntimeError(f"UNKNOWN {libname=}") diff --git a/cuda_pathfinder/cuda/pathfinder/_headers/supported_nvidia_headers.py b/cuda_pathfinder/cuda/pathfinder/_headers/supported_nvidia_headers.py new file mode 100644 index 000000000..afd9067de --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_headers/supported_nvidia_headers.py @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys +from typing import Final + +IS_WINDOWS = sys.platform == "win32" + +SUPPORTED_HEADERS_CTK_COMMON = { + "cccl": "cuda/std/version", + "cublas": "cublas.h", + "cudart": "cuda_runtime.h", + "cufft": "cufft.h", + "curand": "curand.h", + "cusolver": "cusolverDn.h", + "cusparse": "cusparse.h", + "npp": "npp.h", + "nvcc": "fatbinary_section.h", + "nvfatbin": "nvFatbin.h", + "nvjitlink": "nvJitLink.h", + "nvjpeg": "nvjpeg.h", + "nvrtc": "nvrtc.h", + "nvvm": "nvvm.h", +} + +SUPPORTED_HEADERS_CTK_LINUX_ONLY = { + "cufile": "cufile.h", +} +SUPPORTED_HEADERS_CTK_LINUX = SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_LINUX_ONLY + +SUPPORTED_HEADERS_CTK_WINDOWS_ONLY: dict[str, str] = {} +SUPPORTED_HEADERS_CTK_WINDOWS = SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_WINDOWS_ONLY + +SUPPORTED_HEADERS_CTK_ALL = ( + SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_LINUX_ONLY | SUPPORTED_HEADERS_CTK_WINDOWS_ONLY +) +SUPPORTED_HEADERS_CTK: Final[dict[str, str]] = ( + SUPPORTED_HEADERS_CTK_WINDOWS if IS_WINDOWS else SUPPORTED_HEADERS_CTK_LINUX +) + +SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK = { + "cccl": ( + "nvidia/cu13/include/cccl", # cuda-toolkit[cccl]==13.* + "nvidia/cuda_cccl/include", # cuda-toolkit[cccl]==12.* + ), + "cublas": ("nvidia/cu13/include", "nvidia/cublas/include"), + "cudart": ("nvidia/cu13/include", "nvidia/cuda_runtime/include"), + "cufft": ("nvidia/cu13/include", "nvidia/cufft/include"), + "cufile": ("nvidia/cu13/include", "nvidia/cufile/include"), + "curand": ("nvidia/cu13/include", "nvidia/curand/include"), + "cusolver": ("nvidia/cu13/include", "nvidia/cusolver/include"), + "cusparse": ("nvidia/cu13/include", "nvidia/cusparse/include"), + "npp": ("nvidia/cu13/include", "nvidia/npp/include"), + "nvcc": ("nvidia/cu13/include", "nvidia/cuda_nvcc/include"), + "nvfatbin": ("nvidia/cu13/include", "nvidia/nvfatbin/include"), + "nvjitlink": ("nvidia/cu13/include", "nvidia/nvjitlink/include"), + "nvjpeg": ("nvidia/cu13/include", "nvidia/nvjpeg/include"), + "nvrtc": ("nvidia/cu13/include", "nvidia/cuda_nvrtc/include"), + "nvvm": ("nvidia/cu13/include", "nvidia/cuda_nvcc/nvvm/include"), +} diff --git a/cuda_pathfinder/cuda/pathfinder/_utils/env_vars.py b/cuda_pathfinder/cuda/pathfinder/_utils/env_vars.py new file mode 100644 index 000000000..3a7de992c --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_utils/env_vars.py @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os +import warnings +from typing import Optional + + +def _paths_differ(a: str, b: str) -> bool: + """ + Return True if paths are observably different. + + Strategy: + 1) Compare os.path.normcase(os.path.normpath(...)) for quick, robust textual equality. + - Handles trailing slashes and case-insensitivity on Windows. + 2) If still different AND both exist, use os.path.samefile to resolve symlinks/junctions. + 3) Otherwise (nonexistent paths or samefile unavailable), treat as different. + """ + norm_a = os.path.normcase(os.path.normpath(a)) + norm_b = os.path.normcase(os.path.normpath(b)) + if norm_a == norm_b: + return False + + try: + if os.path.exists(a) and os.path.exists(b): + # samefile raises on non-existent paths; only call when both exist. + return not os.path.samefile(a, b) + except OSError: + # Fall through to "different" if samefile isn't applicable/available. + pass + + # If normalized strings differ and we couldn't prove they're the same entry, treat as different. + return True + + +def get_cuda_home_or_path() -> Optional[str]: + cuda_home = os.environ.get("CUDA_HOME") + cuda_path = os.environ.get("CUDA_PATH") + + if cuda_home and cuda_path and _paths_differ(cuda_home, cuda_path): + warnings.warn( + "Both CUDA_HOME and CUDA_PATH are set but differ:\n" + f" CUDA_HOME={cuda_home}\n" + f" CUDA_PATH={cuda_path}\n" + "Using CUDA_HOME (higher priority).", + UserWarning, + stacklevel=2, + ) + + if cuda_home is not None: + return cuda_home + return cuda_path diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 70aa6255c..001da9389 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.2.2" +__version__ = "1.2.3" diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json index eb5b96a0a..9fcc3f0ab 100644 --- a/cuda_pathfinder/docs/nv-versions.json +++ b/cuda_pathfinder/docs/nv-versions.json @@ -3,6 +3,10 @@ "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" }, + { + "version": "1.2.3", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.3/" + }, { "version": "1.2.2", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.2.2/" diff --git a/cuda_pathfinder/docs/source/api.rst b/cuda_pathfinder/docs/source/api.rst index 1870711a1..3cae4b6f7 100644 --- a/cuda_pathfinder/docs/source/api.rst +++ b/cuda_pathfinder/docs/source/api.rst @@ -6,10 +6,8 @@ ``cuda.pathfinder`` API Reference ================================= -The ``cuda.pathfinder`` module provides utilities for loading NVIDIA dynamic libraries. - -Public API ------------ +The ``cuda.pathfinder`` module provides utilities for loading NVIDIA dynamic libraries, +and experimental APIs for locating NVIDIA C/C++ header directories. .. autosummary:: :toctree: generated/ @@ -18,3 +16,6 @@ Public API load_nvidia_dynamic_lib LoadedDL DynamicLibNotFoundError + + SUPPORTED_HEADERS_CTK + find_nvidia_header_directory diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst index b7c0ff6e1..62dbf7ad6 100644 --- a/cuda_pathfinder/docs/source/release.rst +++ b/cuda_pathfinder/docs/source/release.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 3 + 1.2.3 1.2.2 1.2.1 1.2.0 diff --git a/cuda_pathfinder/docs/source/release/1.2.3-notes.rst b/cuda_pathfinder/docs/source/release/1.2.3-notes.rst new file mode 100644 index 000000000..93128b234 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.2.3-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.2.3 Release notes +======================================= + +Released on Sep 17, 2025 + + +Highlights +---------- + +* Extend experimental ``cuda.pathfinder._find_nvidia_headers`` API + to support CTK library headers + (`PR #956 `_) diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 96ad7fb6a..adfff29bb 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -15,7 +15,7 @@ test = [ "pytest>=6.2.4", ] test_nvidia_wheels_cu12 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg]==12.*", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl]==12.*", "cuda-toolkit[cufile]==12.*; sys_platform != 'win32'", "nvidia-cudss-cu12", "nvidia-cufftmp-cu12; sys_platform != 'win32'", @@ -24,7 +24,7 @@ test_nvidia_wheels_cu12 = [ "nvidia-nvshmem-cu12; sys_platform != 'win32'", ] test_nvidia_wheels_cu13 = [ - "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,nvvm]==13.*", + "cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,nvvm]==13.*", "cuda-toolkit[cufile]==13.*; sys_platform != 'win32'", "nvidia-nccl-cu13; sys_platform != 'win32'", "nvidia-nvshmem-cu13; sys_platform != 'win32'", diff --git a/cuda_pathfinder/tests/test_find_nvidia_headers.py b/cuda_pathfinder/tests/test_find_nvidia_headers.py index 2d432b0f2..da0f0e01e 100644 --- a/cuda_pathfinder/tests/test_find_nvidia_headers.py +++ b/cuda_pathfinder/tests/test_find_nvidia_headers.py @@ -20,8 +20,13 @@ import pytest -from cuda.pathfinder import _find_nvidia_header_directory as find_nvidia_header_directory -from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import IS_WINDOWS +from cuda.pathfinder import find_nvidia_header_directory +from cuda.pathfinder._headers.supported_nvidia_headers import ( + IS_WINDOWS, + SUPPORTED_HEADERS_CTK, + SUPPORTED_HEADERS_CTK_ALL, + SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK, +) STRICTNESS = os.environ.get("CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS", "see_what_works") assert STRICTNESS in ("see_what_works", "all_must_work") @@ -58,3 +63,19 @@ def test_find_libname_nvshmem(info_summary_append): assert hdr_dir.startswith(conda_prefix) else: assert hdr_dir.startswith("/usr/include/nvshmem_") + + +def test_supported_headers_site_packages_ctk_consistency(): + assert tuple(sorted(SUPPORTED_HEADERS_CTK_ALL)) == tuple(sorted(SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK.keys())) + + +@pytest.mark.parametrize("libname", SUPPORTED_HEADERS_CTK.keys()) +def test_find_ctk_headers(info_summary_append, libname): + hdr_dir = find_nvidia_header_directory(libname) + info_summary_append(f"{hdr_dir=!r}") + if hdr_dir: + assert os.path.isdir(hdr_dir) + h_filename = SUPPORTED_HEADERS_CTK[libname] + assert os.path.isfile(os.path.join(hdr_dir, h_filename)) + if STRICTNESS == "all_must_work": + assert hdr_dir is not None diff --git a/cuda_pathfinder/tests/test_utils_env_vars.py b/cuda_pathfinder/tests/test_utils_env_vars.py new file mode 100644 index 000000000..40c7d4930 --- /dev/null +++ b/cuda_pathfinder/tests/test_utils_env_vars.py @@ -0,0 +1,181 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os +import pathlib +import sys +import warnings + +import pytest + +from cuda.pathfinder._utils.env_vars import _paths_differ, get_cuda_home_or_path + +skip_symlink_tests = pytest.mark.skipif( + sys.platform == "win32", + reason="Exercising symlinks intentionally omitted for simplicity", +) + + +def unset_env(monkeypatch): + """Helper to clear both env vars for each test.""" + monkeypatch.delenv("CUDA_HOME", raising=False) + monkeypatch.delenv("CUDA_PATH", raising=False) + + +def test_returns_none_when_unset(monkeypatch): + unset_env(monkeypatch) + assert get_cuda_home_or_path() is None + + +def test_empty_cuda_home_preserved(monkeypatch): + # empty string is returned as-is if set. + monkeypatch.setenv("CUDA_HOME", "") + monkeypatch.setenv("CUDA_PATH", "/does/not/matter") + assert get_cuda_home_or_path() == "" + + +def test_prefers_cuda_home_over_cuda_path(monkeypatch, tmp_path): + unset_env(monkeypatch) + home = tmp_path / "home" + path = tmp_path / "path" + home.mkdir() + path.mkdir() + + monkeypatch.setenv("CUDA_HOME", str(home)) + monkeypatch.setenv("CUDA_PATH", str(path)) + + # Different directories -> warning + prefer CUDA_HOME + with pytest.warns(UserWarning, match="Both CUDA_HOME and CUDA_PATH are set but differ"): + result = get_cuda_home_or_path() + assert pathlib.Path(result) == home + + +def test_uses_cuda_path_if_home_missing(monkeypatch, tmp_path): + unset_env(monkeypatch) + only_path = tmp_path / "path" + only_path.mkdir() + monkeypatch.setenv("CUDA_PATH", str(only_path)) + assert pathlib.Path(get_cuda_home_or_path()) == only_path + + +def test_no_warning_when_textually_equal_after_normalization(monkeypatch, tmp_path): + """ + Trailing slashes should not trigger a warning, thanks to normpath. + This works cross-platform. + """ + unset_env(monkeypatch) + d = tmp_path / "cuda" + d.mkdir() + + with_slash = str(d) + ("/" if os.sep == "/" else "\\") + monkeypatch.setenv("CUDA_HOME", str(d)) + monkeypatch.setenv("CUDA_PATH", with_slash) + + # No warning; same logical directory + with warnings.catch_warnings(record=True) as record: + result = get_cuda_home_or_path() + assert pathlib.Path(result) == d + assert len(record) == 0 + + +@pytest.mark.skipif(sys.platform != "win32", reason="Windows-specific case-folding check") +def test_no_warning_on_windows_case_only_difference(monkeypatch, tmp_path): + """ + On Windows, paths differing only by case should not warn because normcase collapses case. + """ + unset_env(monkeypatch) + d = tmp_path / "Cuda" + d.mkdir() + + upper = str(d).upper() + lower = str(d).lower() + monkeypatch.setenv("CUDA_HOME", upper) + monkeypatch.setenv("CUDA_PATH", lower) + + with warnings.catch_warnings(record=True) as record: + warnings.simplefilter("always") + result = get_cuda_home_or_path() + assert pathlib.Path(result).samefile(d) + assert len(record) == 0 + + +def test_warning_when_both_exist_and_are_different(monkeypatch, tmp_path): + unset_env(monkeypatch) + a = tmp_path / "a" + b = tmp_path / "b" + a.mkdir() + b.mkdir() + + monkeypatch.setenv("CUDA_HOME", str(a)) + monkeypatch.setenv("CUDA_PATH", str(b)) + + # Different actual dirs -> warning + with pytest.warns(UserWarning, match="Both CUDA_HOME and CUDA_PATH are set but differ"): + result = get_cuda_home_or_path() + assert pathlib.Path(result) == a + + +def test_nonexistent_paths_fall_back_to_text_comparison(monkeypatch, tmp_path): + """ + If one or both paths don't exist, we compare normalized strings. + Different strings should warn. + """ + unset_env(monkeypatch) + a = tmp_path / "does_not_exist_a" + b = tmp_path / "does_not_exist_b" + + monkeypatch.setenv("CUDA_HOME", str(a)) + monkeypatch.setenv("CUDA_PATH", str(b)) + + with pytest.warns(UserWarning, match="Both CUDA_HOME and CUDA_PATH are set but differ"): + result = get_cuda_home_or_path() + assert pathlib.Path(result) == a + + +@skip_symlink_tests +def test_samefile_equivalence_via_symlink_when_possible(monkeypatch, tmp_path): + """ + If both paths exist and one is a symlink/junction to the other, we should NOT warn. + """ + unset_env(monkeypatch) + real_dir = tmp_path / "real" + real_dir.mkdir() + + link_dir = tmp_path / "alias" + + os.symlink(str(real_dir), str(link_dir), target_is_directory=True) + + # Set env vars to real and alias + monkeypatch.setenv("CUDA_HOME", str(real_dir)) + monkeypatch.setenv("CUDA_PATH", str(link_dir)) + + # Because they resolve to the same entry, no warning should be raised + with warnings.catch_warnings(record=True) as record: + warnings.simplefilter("always") + result = get_cuda_home_or_path() + assert pathlib.Path(result) == real_dir + assert len(record) == 0 + + +# --- unit tests for the helper itself (optional but nice to have) --- + + +def test_paths_differ_text_only(tmp_path): + a = tmp_path / "x" + b = tmp_path / "x" / ".." / "x" # normalizes to same + assert _paths_differ(str(a), str(b)) is False + + a = tmp_path / "x" + b = tmp_path / "y" + assert _paths_differ(str(a), str(b)) is True + + +@skip_symlink_tests +def test_paths_differ_samefile(tmp_path): + real_dir = tmp_path / "r" + real_dir.mkdir() + alias = tmp_path / "alias" + os.symlink(str(real_dir), str(alias), target_is_directory=True) + + # Should detect equivalence via samefile + assert _paths_differ(str(real_dir), str(alias)) is False diff --git a/toolshed/setup-docs-env.sh b/toolshed/setup-docs-env.sh index 9d4768156..16378725e 100755 --- a/toolshed/setup-docs-env.sh +++ b/toolshed/setup-docs-env.sh @@ -65,4 +65,4 @@ echo "Build docs with e.g.:" echo " conda activate ${ENV_NAME}" echo " cd cuda_pathfinder/" echo " pip install -e ." -echo " (cd docs/ && rm -rf build && ./build_docs.sh)" +echo " (cd docs/ && rm -rf build source/generated && ./build_docs.sh)" From d09d4ee36e48646a2dc65ec2ee1489b97e91659a Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:01:54 -0400 Subject: [PATCH 103/113] dev: ignore generated cufile.pyx (#977) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 64c77d166..d2bb3b35c 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ 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/cufile.pyx cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx cuda_bindings/cuda/bindings/_internal/nvvm.pyx cuda_bindings/cuda/bindings/_lib/utils.pxd From de5c843c7bccf96aa940267317fa4eaec732d310 Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Wed, 17 Sep 2025 08:19:00 -0700 Subject: [PATCH 104/113] Reverting removing function --- cuda_pathfinder/tests/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cuda_pathfinder/tests/conftest.py b/cuda_pathfinder/tests/conftest.py index f13c9c6ca..cfef9a954 100644 --- a/cuda_pathfinder/tests/conftest.py +++ b/cuda_pathfinder/tests/conftest.py @@ -9,6 +9,13 @@ def pytest_configure(config): config.custom_info = [] +def pytest_terminal_summary(terminalreporter, exitstatus, config): # noqa: ARG001 + if config.custom_info: + terminalreporter.write_sep("=", "INFO summary") + for msg in config.custom_info: + terminalreporter.line(f"INFO {msg}") + + @pytest.fixture def info_summary_append(request): def _append(message): From 7a24bd80b908e42f45ba610445998af383b2bbd3 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Wed, 17 Sep 2025 08:30:34 -0700 Subject: [PATCH 105/113] Implements IPC-enabled memory pools for Linux in DeviceMemoryResource (#930) * Updates DeviceMemoryResource to accept Device objects for the device_id argument. * Adds IPC support to DeviceMemoryResource. Creates a staticmethod `current` to access the default memory pool. * Added a missing import statement. * Restores DeviceMemoryResource default behavior to return the current memory pool. Removes the `current` staticmethod. Adds an option dataclass for constructor options. * Adjusts docstrings for consistency. * Adjusts dataclass member defs in *Options classes for Cython. * Adds __bool__ to the MemoryResource interface. * Minor docstring update. * Changes verbiage from "shared" or "shareable" handle to "allocation handle" to better align with the driver API. * Significantly reworks the tests for IPC-enabled memory pools. Introduces `IPCAllocationHandle` to manage pool-sharing resources. Introduces `IPCChannel` to for sharing allocation handles in a platform-independent way (though currently only Linux is supported). * Various fixes including: groups cimport statements; removes __bool__ method from MemoryResource; Cythonizes helper classes; disables __init__ for non-API classes; removes abstract factory constructor from IPCChannel; removes the _requires_ipc decorator (checks are now inlined) * Formatting changes. * Creates an attributes suite to bundle the DeviceMemoryResource attributes. * Format changes. * Test updates. Parameterizes tests (rather than use internal loops). Adds stream synchronization. Eliminates unnecessary clean-up. Removes unnecessary check for CUDA 12 or later. * Reworks mempool attribute implementation. * Adds testing for errors when allocating from an imported memory pool. * Move IPC import/export methods into the Buffer class. * Updated release notes. * Reworks DeviceMemoryResourceAttributes to use a descriptor. * Remove use of deprecated abstractproperty. Co-authored-by: Keenan Simpson --- cuda_core/cuda/core/experimental/__init__.py | 8 +- cuda_core/cuda/core/experimental/_memory.pyx | 466 ++++++++++++++++-- cuda_core/cuda/core/experimental/_stream.pyx | 3 +- cuda_core/docs/source/api_private.rst | 1 + cuda_core/docs/source/release/0.X.Y-notes.rst | 2 + cuda_core/tests/conftest.py | 8 +- cuda_core/tests/test_ipc_mempool.py | 179 +++++++ cuda_core/tests/test_memory.py | 175 ++++++- 8 files changed, 792 insertions(+), 50 deletions(-) create mode 100644 cuda_core/tests/test_ipc_mempool.py diff --git a/cuda_core/cuda/core/experimental/__init__.py b/cuda_core/cuda/core/experimental/__init__.py index fffb80a5c..a06119321 100644 --- a/cuda_core/cuda/core/experimental/__init__.py +++ b/cuda_core/cuda/core/experimental/__init__.py @@ -14,7 +14,13 @@ from cuda.core.experimental._launch_config import LaunchConfig from cuda.core.experimental._launcher import launch from cuda.core.experimental._linker import Linker, LinkerOptions -from cuda.core.experimental._memory import Buffer, DeviceMemoryResource, LegacyPinnedMemoryResource, MemoryResource +from cuda.core.experimental._memory import ( + Buffer, + DeviceMemoryResource, + IPCChannel, + LegacyPinnedMemoryResource, + MemoryResource, +) from cuda.core.experimental._module import Kernel, ObjectCode from cuda.core.experimental._program import Program, ProgramOptions from cuda.core.experimental._stream import Stream, StreamOptions diff --git a/cuda_core/cuda/core/experimental/_memory.pyx b/cuda_core/cuda/core/experimental/_memory.pyx index 44e7a77c7..41a506a58 100644 --- a/cuda_core/cuda/core/experimental/_memory.pyx +++ b/cuda_core/cuda/core/experimental/_memory.pyx @@ -5,18 +5,30 @@ from __future__ import annotations from libc.stdint cimport uintptr_t - from cuda.core.experimental._utils.cuda_utils cimport ( _check_driver_error as raise_if_driver_error, + check_or_create_options, ) +from dataclasses import dataclass +from typing import TypeVar, Union, TYPE_CHECKING import abc -from typing import TypeVar, Union - +import array +import cython +import os +import platform +import weakref from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule from cuda.core.experimental._stream import Stream, default_stream from cuda.core.experimental._utils.cuda_utils import driver +if platform.system() == "Linux": + import socket + +if TYPE_CHECKING: + import cuda.bindings.driver + from cuda.core.experimental._device import Device + # TODO: define a memory property mixin class and make Buffer and # MemoryResource both inherit from it @@ -119,6 +131,25 @@ cdef class Buffer: return self._mr.device_id raise NotImplementedError("WIP: Currently this property only supports buffers with associated MemoryResource") + def export(self) -> IPCBufferDescriptor: + """Export a buffer allocated for sharing between processes.""" + if not self._mr.is_ipc_enabled: + raise RuntimeError("Memory resource is not IPC-enabled") + err, ptr = driver.cuMemPoolExportPointer(self.handle) + raise_if_driver_error(err) + return IPCBufferDescriptor._init(ptr.reserved, self.size) + + @classmethod + def import_(cls, mr: MemoryResource, ipc_buffer: IPCBufferDescriptor) -> Buffer: + """Import a buffer that was exported from another process.""" + if not mr.is_ipc_enabled: + raise RuntimeError("Memory resource is not IPC-enabled") + share_data = driver.CUmemPoolPtrExportData() + share_data.reserved = ipc_buffer._reserved + err, ptr = driver.cuMemPoolImportPointer(mr._mempool_handle, share_data) + raise_if_driver_error(err) + return Buffer.from_handle(ptr, ipc_buffer.size, mr) + def copy_to(self, dst: Buffer = None, *, stream: Stream) -> Buffer: """Copy from this buffer to the dst buffer asynchronously on the given stream. @@ -251,8 +282,6 @@ class MemoryResource(abc.ABC): memory resource's respective property.) """ - __slots__ = ("_handle",) - @abc.abstractmethod def __init__(self, *args, **kwargs): """Initialize the memory resource. @@ -324,40 +353,374 @@ class MemoryResource(abc.ABC): ... +# IPC is currently only supported on Linux. On other platforms, the IPC handle +# type is set equal to the no-IPC handle type. + +_NOIPC_HANDLE_TYPE = driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_NONE +_IPC_HANDLE_TYPE = driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR \ + if platform.system() == "Linux" else _NOIPC_HANDLE_TYPE + +cdef class IPCBufferDescriptor: + """Serializable object describing a buffer that can be shared between processes.""" + + cdef: + bytes _reserved + size_t _size + + def __init__(self, *arg, **kwargs): + raise RuntimeError("IPCBufferDescriptor objects cannot be instantiated directly. Please use MemoryResource APIs.") + + @classmethod + def _init(cls, reserved: bytes, size: int): + cdef IPCBufferDescriptor self = IPCBufferDescriptor.__new__(cls) + self._reserved = reserved + self._size = size + return self + + def __reduce__(self): + # This is subject to change if the CUmemPoolPtrExportData struct/object changes. + return (self._reconstruct, (self._reserved, self._size)) + + @property + def size(self): + return self._size + + @classmethod + def _reconstruct(cls, reserved, size): + instance = cls._init(reserved, size) + return instance + + +cdef class IPCAllocationHandle: + """Shareable handle to an IPC-enabled device memory pool.""" + + cdef: + int _handle + + def __init__(self, *arg, **kwargs): + raise RuntimeError("IPCAllocationHandle objects cannot be instantiated directly. Please use MemoryResource APIs.") + + @classmethod + def _init(cls, handle: int): + cdef IPCAllocationHandle self = IPCAllocationHandle.__new__(cls) + assert handle >= 0 + self._handle = handle + return self + + cpdef close(self): + """Close the handle.""" + if self._handle >= 0: + try: + os.close(self._handle) + finally: + self._handle = -1 + + def __del__(self): + """Close the handle.""" + self.close() + + def __int__(self) -> int: + if self._handle < 0: + raise ValueError( + f"Cannot convert IPCAllocationHandle to int: the handle (id={id(self)}) is closed." + ) + return self._handle + + @property + def handle(self) -> int: + return self._handle + + +cdef class IPCChannel: + """Communication channel for sharing IPC-enabled memory pools.""" + + cdef: + object _proxy + + def __init__(self): + if platform.system() == "Linux": + self._proxy = IPCChannelUnixSocket._init() + else: + raise RuntimeError("IPC is not available on {platform.system()}") + + +cdef class IPCChannelUnixSocket: + """Unix-specific channel for sharing memory pools over sockets.""" + + cdef: + object _sock_out + object _sock_in + + def __init__(self, *arg, **kwargs): + raise RuntimeError("IPCChannelUnixSocket objects cannot be instantiated directly. Please use MemoryResource APIs.") + + @classmethod + def _init(cls): + cdef IPCChannelUnixSocket self = IPCChannelUnixSocket.__new__(cls) + self._sock_out, self._sock_in = socket.socketpair(socket.AF_UNIX, socket.SOCK_SEQPACKET) + return self + + cpdef _send_allocation_handle(self, alloc_handle: IPCAllocationHandle): + """Sends over this channel an allocation handle for exporting a + shared memory pool.""" + self._sock_out.sendmsg( + [], + [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", [int(alloc_handle)]))] + ) + + cpdef IPCAllocationHandle _receive_allocation_handle(self): + """Receives over this channel an allocation handle for importing a + shared memory pool.""" + fds = array.array("i") + _, ancillary_data, _, _ = self._sock_in.recvmsg(0, socket.CMSG_LEN(fds.itemsize)) + assert len(ancillary_data) == 1 + cmsg_level, cmsg_type, cmsg_data = ancillary_data[0] + assert cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS + fds.frombytes(cmsg_data[: len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) + return IPCAllocationHandle._init(int(fds[0])) + + +@dataclass +cdef class DeviceMemoryResourceOptions: + """Customizable :obj:`~_memory.DeviceMemoryResource` options. + + Attributes + ---------- + ipc_enabled : bool, optional + Specifies whether to create an IPC-enabled memory pool. When set to + True, the memory pool and its allocations can be shared with other + processes. (Default to False) + + max_size : int, optional + Maximum pool size. When set to 0, defaults to a system-dependent value. + (Default to 0) + """ + ipc_enabled : cython.bint = False + max_size : cython.int = 0 + + +class DeviceMemoryResourceAttributes: + def __init__(self, *args, **kwargs): + raise RuntimeError("DeviceMemoryResourceAttributes cannot be instantiated directly. Please use MemoryResource APIs.") + + @classmethod + def _init(cls, mr : DeviceMemoryReference): + self = DeviceMemoryResourceAttributes.__new__(cls) + self._mr = mr + return self + + def mempool_property(property_type: type): + def decorator(stub): + attr_enum = getattr(driver.CUmemPool_attribute, f"CU_MEMPOOL_ATTR_{stub.__name__.upper()}") + + def fget(self) -> property_type: + mr = self._mr() + if mr is None: + raise RuntimeError("DeviceMemoryResource is expired") + err, value = driver.cuMemPoolGetAttribute(mr._mempool_handle, attr_enum) + raise_if_driver_error(err) + return property_type(value) + return property(fget=fget, doc=stub.__doc__) + return decorator + + @mempool_property(bool) + def reuse_follow_event_dependencies(self): + """Allow memory to be reused when there are event dependencies between streams.""" + + @mempool_property(bool) + def reuse_allow_opportunistic(self): + """Allow reuse of completed frees without dependencies.""" + + @mempool_property(bool) + def reuse_allow_internal_dependencies(self): + """Allow insertion of new stream dependencies for memory reuse.""" + + @mempool_property(int) + def release_threshold(self): + """Amount of reserved memory to hold before OS release.""" + + @mempool_property(int) + def reserved_mem_current(self): + """Current amount of backing memory allocated.""" + + @mempool_property(int) + def reserved_mem_high(self): + """High watermark of backing memory allocated.""" + + @mempool_property(int) + def used_mem_current(self): + """Current amount of memory in use.""" + + @mempool_property(int) + def used_mem_high(self): + """High watermark of memory in use.""" + + del mempool_property + + class DeviceMemoryResource(MemoryResource): - """Create a device memory resource that uses the driver's stream-ordered memory pool. + """Create a device memory resource managing a stream-ordered memory pool. Parameters ---------- - device_id : int - Device ordinal for which a memory resource is constructed. The mempool that is - set to *current* on ``device_id`` is used. If no mempool is set to current yet, - the driver would use the *default* mempool on the device. - """ + device_id : int | Device + Device or Device ordinal for which a memory resource is constructed. - __slots__ = ("_dev_id",) + options : DeviceMemoryResourceOptions + Memory resource creation options. - def __init__(self, device_id: int): - err, self._handle = driver.cuDeviceGetMemPool(device_id) - raise_if_driver_error(err) - self._dev_id = device_id + If set to `None`, the memory resource uses the driver's current + stream-ordered memory pool for the specified `device_id`. If no memory + pool is set as current, the driver's default memory pool for the device + is used. - # Set a higher release threshold to improve performance when there are no active allocations. - # By default, the release threshold is 0, which means memory is immediately released back - # to the OS when there are no active suballocations, causing performance issues. - # Check current release threshold - err, current_threshold = driver.cuMemPoolGetAttribute( - self._handle, driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD + If not set to `None`, a new memory pool is created, which is owned by + the memory resource. + + When using an existing (current or default) memory pool, the returned + device memory resource does not own the pool (`is_handle_owned` is + `False`), and closing the resource has no effect. + """ + __slots__ = "_dev_id", "_mempool_handle", "_attributes", "_ipc_handle_type", "_mempool_owned", "_is_imported" + + def __init__(self, device_id: int | Device, options=None): + device_id = getattr(device_id, 'device_id', device_id) + opts = check_or_create_options( + DeviceMemoryResourceOptions, options, "DeviceMemoryResource options", keep_none=True ) - raise_if_driver_error(err) - # If threshold is 0 (default), set it to maximum to retain memory in the pool - if int(current_threshold) == 0: - err, = driver.cuMemPoolSetAttribute( - self._handle, - driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, - driver.cuuint64_t(0xFFFFFFFFFFFFFFFF), + + if opts is None: + # Get the current memory pool. + self._dev_id = device_id + self._mempool_handle = None + self._attributes = None + self._ipc_handle_type = _NOIPC_HANDLE_TYPE + self._mempool_owned = False + self._is_imported = False + + err, self._mempool_handle = driver.cuDeviceGetMemPool(self.device_id) + raise_if_driver_error(err) + + # Set a higher release threshold to improve performance when there are no active allocations. + # By default, the release threshold is 0, which means memory is immediately released back + # to the OS when there are no active suballocations, causing performance issues. + # Check current release threshold + err, current_threshold = driver.cuMemPoolGetAttribute( + self._mempool_handle, driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD ) raise_if_driver_error(err) + # If threshold is 0 (default), set it to maximum to retain memory in the pool + if int(current_threshold) == 0: + err, = driver.cuMemPoolSetAttribute( + self._mempool_handle, + driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + driver.cuuint64_t(0xFFFFFFFFFFFFFFFF), + ) + raise_if_driver_error(err) + else: + # Create a new memory pool. + if opts.ipc_enabled and _IPC_HANDLE_TYPE == _NOIPC_HANDLE_TYPE: + raise RuntimeError("IPC is not available on {platform.system()}") + + properties = driver.CUmemPoolProps() + properties.allocType = driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + properties.handleTypes = _IPC_HANDLE_TYPE if opts.ipc_enabled else _NOIPC_HANDLE_TYPE + properties.location = driver.CUmemLocation() + properties.location.id = device_id + properties.location.type = driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + properties.maxSize = opts.max_size + properties.win32SecurityAttributes = 0 + properties.usage = 0 + + self._dev_id = device_id + self._mempool_handle = None + self._attributes = None + self._ipc_handle_type = properties.handleTypes + self._mempool_owned = True + self._is_imported = False + + err, self._mempool_handle = driver.cuMemPoolCreate(properties) + raise_if_driver_error(err) + + def __del__(self): + self.close() + + def close(self): + """Close the device memory resource and destroy the associated memory pool if owned.""" + if self._mempool_handle is not None and self._mempool_owned: + err, = driver.cuMemPoolDestroy(self._mempool_handle) + raise_if_driver_error(err) + + self._dev_id = None + self._mempool_handle = None + self._attributes = None + self._ipc_handle_type = _NOIPC_HANDLE_TYPE + self._mempool_owned = False + self._is_imported = False + + @classmethod + def from_shared_channel(cls, device_id: int | Device, channel: IPCChannel) -> DeviceMemoryResource: + """Create a device memory resource from a memory pool shared over an IPC channel.""" + device_id = getattr(device_id, 'device_id', device_id) + alloc_handle = channel._proxy._receive_allocation_handle() + return cls._from_allocation_handle(device_id, alloc_handle) + + @classmethod + def _from_allocation_handle(cls, device_id: int | Device, alloc_handle: IPCAllocationHandle) -> DeviceMemoryResource: + """Create a device memory resource from an allocation handle. + + Construct a new `DeviceMemoryResource` instance that imports a memory + pool from a shareable handle. The memory pool is marked as owned, and + the resource is associated with the specified `device_id`. + + Parameters + ---------- + device_id : int | Device + The ID of the device or a Device object for which the memory + resource is created. + + alloc_handle : int + The shareable handle of the device memory resource to import. + + Returns + ------- + A new device memory resource instance with the imported handle. + """ + device_id = getattr(device_id, 'device_id', device_id) + + self = cls.__new__(cls) + self._dev_id = device_id + self._mempool_handle = None + self._attributes = None + self._ipc_handle_type = _IPC_HANDLE_TYPE + self._mempool_owned = True + self._is_imported = True + + err, self._mempool_handle = driver.cuMemPoolImportFromShareableHandle(int(alloc_handle), _IPC_HANDLE_TYPE, 0) + raise_if_driver_error(err) + + return self + + def share_to_channel(self, channel : IPCChannel): + if not self.is_ipc_enabled: + raise RuntimeError("Memory resource is not IPC-enabled") + channel._proxy._send_allocation_handle(self._get_allocation_handle()) + + def _get_allocation_handle(self) -> IPCAllocationHandle: + """Export the memory pool handle to be shared (requires IPC). + + The handle can be used to share the memory pool with other processes. + The handle is cached in this `MemoryResource` and owned by it. + + Returns + ------- + The shareable handle for the memory pool. + """ + if not self.is_ipc_enabled: + raise RuntimeError("Memory resource is not IPC-enabled") + err, alloc_handle = driver.cuMemPoolExportToShareableHandle(self._mempool_handle, _IPC_HANDLE_TYPE, 0) + raise_if_driver_error(err) + return IPCAllocationHandle._init(alloc_handle) def allocate(self, size_t size, stream: Stream = None) -> Buffer: """Allocate a buffer of the requested size. @@ -376,9 +739,11 @@ class DeviceMemoryResource(MemoryResource): The allocated buffer object, which is accessible on the device that this memory resource was created for. """ + if self._is_imported: + raise TypeError("Cannot allocate from shared memory pool imported via IPC") if stream is None: stream = default_stream() - err, ptr = driver.cuMemAllocFromPoolAsync(size, self._handle, stream.handle) + err, ptr = driver.cuMemAllocFromPoolAsync(size, self._mempool_handle, stream.handle) raise_if_driver_error(err) return Buffer._init(ptr, size, self) @@ -400,20 +765,47 @@ class DeviceMemoryResource(MemoryResource): err, = driver.cuMemFreeAsync(ptr, stream.handle) raise_if_driver_error(err) + @property + def attributes(self) -> DeviceMemoryResourceAttributes: + if self._attributes is None: + ref = weakref.ref(self) + self._attributes = DeviceMemoryResourceAttributes._init(ref) + return self._attributes + + @property + def device_id(self) -> int: + """The associated device ordinal.""" + return self._dev_id + + @property + def handle(self) -> cuda.bindings.driver.CUmemoryPool: + """Handle to the underlying memory pool.""" + return self._mempool_handle + + @property + def is_handle_owned(self) -> bool: + """Whether the memory resource handle is owned. If False, ``close`` has no effect.""" + return self._mempool_owned + + @property + def is_imported(self) -> bool: + """Whether the memory resource was imported from another process. If True, allocation is not permitted.""" + return self._is_imported + @property def is_device_accessible(self) -> bool: - """bool: this memory resource provides device-accessible buffers.""" + """Return True. This memory resource provides device-accessible buffers.""" return True @property def is_host_accessible(self) -> bool: - """bool: this memory resource does not provides host-accessible buffers.""" + """Return False. This memory resource does not provide host-accessible buffers.""" return False @property - def device_id(self) -> int: - """int: the associated device ordinal.""" - return self._dev_id + def is_ipc_enabled(self) -> bool: + """Whether this memory resource has IPC enabled.""" + return self._ipc_handle_type != _NOIPC_HANDLE_TYPE class LegacyPinnedMemoryResource(MemoryResource): @@ -481,9 +873,9 @@ class LegacyPinnedMemoryResource(MemoryResource): class _SynchronousMemoryResource(MemoryResource): __slots__ = ("_dev_id",) - def __init__(self, device_id): + def __init__(self, device_id : int | Device): self._handle = None - self._dev_id = device_id + self._dev_id = getattr(device_id, 'device_id', device_id) def allocate(self, size, stream=None) -> Buffer: err, ptr = driver.cuMemAlloc(size) diff --git a/cuda_core/cuda/core/experimental/_stream.pyx b/cuda_core/cuda/core/experimental/_stream.pyx index 64ae09529..9d9271f65 100644 --- a/cuda_core/cuda/core/experimental/_stream.pyx +++ b/cuda_core/cuda/core/experimental/_stream.pyx @@ -9,6 +9,7 @@ from cuda.core.experimental._utils.cuda_utils cimport ( check_or_create_options, ) +import cython import os import warnings from dataclasses import dataclass @@ -42,7 +43,7 @@ cdef class StreamOptions: """ - nonblocking: bool = True + nonblocking : cython.bint = True priority: Optional[int] = None diff --git a/cuda_core/docs/source/api_private.rst b/cuda_core/docs/source/api_private.rst index afbbb7ce3..fb36e0a30 100644 --- a/cuda_core/docs/source/api_private.rst +++ b/cuda_core/docs/source/api_private.rst @@ -18,6 +18,7 @@ CUDA runtime _memory.PyCapsule _memory.DevicePointerT + _memory.IPCBufferDescriptor _device.DeviceProperties _module.KernelAttributes _module.KernelOccupancy diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 8024a14f6..8d639c177 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -28,6 +28,7 @@ New features - Added :attr:`Device.arch` property that returns the compute capability as a string (e.g., '75' for CC 7.5), providing a convenient alternative to manually concatenating the compute capability tuple. - CUDA 13.x testing support through new ``test-cu13`` dependency group. +- Stream-ordered memory allocation can now be shared on Linux via :class:`DeviceMemoryResource`. New examples @@ -44,3 +45,4 @@ Fixes and enhancements - Fix :class:`LaunchConfig` grid unit conversion when cluster is set (addresses issue #867). - Fixed a bug in :class:`GraphBuilder.add_child` where dependencies extracted from capturing stream were passed inconsistently with num_dependencies parameter (addresses issue #843). - Make :class:`Buffer` creation more performant. +- Enabled :class:`MemoryResource` subclasses to accept :class:`Device` objects, in addition to previously supported device ordinals. diff --git a/cuda_core/tests/conftest.py b/cuda_core/tests/conftest.py index 57fed9838..c800aae3e 100644 --- a/cuda_core/tests/conftest.py +++ b/cuda_core/tests/conftest.py @@ -7,6 +7,8 @@ from cuda.bindings import driver except ImportError: from cuda import cuda as driver +import multiprocessing + import pytest from cuda.core.experimental import Device, _device @@ -14,9 +16,13 @@ @pytest.fixture(scope="session", autouse=True) -def always_init_cuda(): +def session_setup(): + # Always init CUDA. handle_return(driver.cuInit(0)) + # Never fork processes. + multiprocessing.set_start_method("spawn", force=True) + @pytest.fixture(scope="function") def init_cuda(): diff --git a/cuda_core/tests/test_ipc_mempool.py b/cuda_core/tests/test_ipc_mempool.py new file mode 100644 index 000000000..5c4c38275 --- /dev/null +++ b/cuda_core/tests/test_ipc_mempool.py @@ -0,0 +1,179 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +try: + from cuda.bindings import driver +except ImportError: + from cuda import cuda as driver + +import ctypes +import multiprocessing + +import pytest + +from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, IPCChannel, MemoryResource +from cuda.core.experimental._utils.cuda_utils import handle_return + +CHILD_TIMEOUT_SEC = 10 +NBYTES = 64 +POOL_SIZE = 2097152 + + +@pytest.fixture(scope="function") +def ipc_device(): + """Obtains a device suitable for IPC-enabled mempool tests, or skips.""" + # Check if IPC is supported on this platform/device + device = Device() + device.set_current() + + if not device.properties.memory_pools_supported: + pytest.skip("Device does not support mempool operations") + + # Note: Linux specific. Once Windows support for IPC is implemented, this + # test should be updated. + if not device.properties.handle_type_posix_file_descriptor_supported: + pytest.skip("Device does not support IPC") + + return device + + +def test_ipc_mempool(ipc_device): + """Test IPC with memory pools.""" + # Set up the IPC-enabled memory pool and share it. + stream = ipc_device.create_stream() + mr = DeviceMemoryResource(ipc_device, dict(max_size=POOL_SIZE, ipc_enabled=True)) + assert mr.is_ipc_enabled + channel = IPCChannel() + mr.share_to_channel(channel) + + # Start the child process. + queue = multiprocessing.Queue() + process = multiprocessing.Process(target=child_main1, args=(channel, queue)) + process.start() + + # Allocate and fill memory. + buffer = mr.allocate(NBYTES, stream=stream) + protocol = IPCBufferTestProtocol(ipc_device, buffer, stream=stream) + protocol.fill_buffer(flipped=False) + stream.sync() + + # Export the buffer via IPC. + handle = buffer.export() + queue.put(handle) + + # Wait for the child process. + process.join(timeout=CHILD_TIMEOUT_SEC) + assert process.exitcode == 0 + + # Verify that the buffer was modified. + protocol.verify_buffer(flipped=True) + + +def child_main1(channel, queue): + device = Device() + device.set_current() + stream = device.create_stream() + + mr = DeviceMemoryResource.from_shared_channel(device, channel) + handle = queue.get() # Get exported buffer data + buffer = Buffer.import_(mr, handle) + + protocol = IPCBufferTestProtocol(device, buffer, stream=stream) + protocol.verify_buffer(flipped=False) + protocol.fill_buffer(flipped=True) + stream.sync() + + +def test_shared_pool_errors(ipc_device): + """Test expected errors with allocating from a shared IPC memory pool.""" + # Set up the IPC-enabled memory pool and share it. + mr = DeviceMemoryResource(ipc_device, dict(max_size=POOL_SIZE, ipc_enabled=True)) + channel = IPCChannel() + mr.share_to_channel(channel) + + # Start a child process to generate error info. + queue = multiprocessing.Queue() + process = multiprocessing.Process(target=child_main2, args=(channel, queue)) + process.start() + + # Check the errors. + exc_type, exc_msg = queue.get(timeout=CHILD_TIMEOUT_SEC) + assert exc_type is TypeError + assert exc_msg == "Cannot allocate from shared memory pool imported via IPC" + + # Wait for the child process. + process.join(timeout=CHILD_TIMEOUT_SEC) + assert process.exitcode == 0 + + +def child_main2(channel, queue): + """Child process that pushes IPC errors to a shared queue for testing.""" + device = Device() + device.set_current() + + mr = DeviceMemoryResource.from_shared_channel(device, channel) + + # Allocating from an imported pool. + try: + mr.allocate(NBYTES) + except Exception as e: + exc_info = type(e), str(e) + queue.put(exc_info) + + +class DummyUnifiedMemoryResource(MemoryResource): + def __init__(self, device): + self.device = device + + def allocate(self, size, stream=None) -> Buffer: + ptr = handle_return(driver.cuMemAllocManaged(size, driver.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL.value)) + return Buffer.from_handle(ptr=ptr, size=size, mr=self) + + def deallocate(self, ptr, size, stream=None): + handle_return(driver.cuMemFree(ptr)) + + @property + def is_device_accessible(self) -> bool: + return True + + @property + def is_host_accessible(self) -> bool: + return True + + @property + def device_id(self) -> int: + return self.device + + +class IPCBufferTestProtocol: + """The protocol for verifying IPC. + + Provides methods to fill a buffer with one of two test patterns and verify + the expected values. + """ + + def __init__(self, device, buffer, nbytes=NBYTES, stream=None): + self.device = device + self.buffer = buffer + self.nbytes = nbytes + self.stream = stream if stream is not None else device.create_stream() + self.scratch_buffer = DummyUnifiedMemoryResource(self.device).allocate(self.nbytes, stream=self.stream) + + def fill_buffer(self, flipped=False): + """Fill a device buffer with test pattern using unified memory.""" + ptr = ctypes.cast(int(self.scratch_buffer.handle), ctypes.POINTER(ctypes.c_byte)) + op = (lambda i: 255 - i) if flipped else (lambda i: i) + for i in range(self.nbytes): + ptr[i] = ctypes.c_byte(op(i)) + self.buffer.copy_from(self.scratch_buffer, stream=self.stream) + + def verify_buffer(self, flipped=False): + """Verify the buffer contents.""" + self.scratch_buffer.copy_from(self.buffer, stream=self.stream) + self.stream.sync() + ptr = ctypes.cast(int(self.scratch_buffer.handle), ctypes.POINTER(ctypes.c_byte)) + op = (lambda i: 255 - i) if flipped else (lambda i: i) + for i in range(self.nbytes): + assert ctypes.c_byte(ptr[i]).value == ctypes.c_byte(op(i)).value, ( + f"Buffer contains incorrect data at index {i}" + ) diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index 491521ff9..c14de8585 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -7,13 +7,28 @@ from cuda import cuda as driver import ctypes +import platform import pytest from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, MemoryResource -from cuda.core.experimental._memory import DLDeviceType +from cuda.core.experimental._memory import DLDeviceType, IPCBufferDescriptor from cuda.core.experimental._utils.cuda_utils import handle_return +POOL_SIZE = 2097152 # 2MB size + + +@pytest.fixture(scope="function") +def mempool_device(): + """Obtains a device suitable for mempool tests, or skips.""" + device = Device() + device.set_current() + + if not device.properties.memory_pools_supported: + pytest.skip("Device does not support mempool operations") + + return device + class DummyDeviceMemoryResource(MemoryResource): def __init__(self, device): @@ -259,27 +274,167 @@ def test_buffer_dunder_dlpack_device_failure(): buffer.__dlpack_device__() -def test_device_memory_resource_initialization(): +@pytest.mark.parametrize("use_device_object", [True, False]) +def test_device_memory_resource_initialization(mempool_device, use_device_object): """Test that DeviceMemoryResource can be initialized successfully. This test verifies that the DeviceMemoryResource initializes properly, including the release threshold configuration for performance optimization. """ - device = Device() - if not device.properties.memory_pools_supported: - pytest.skip("memory pools not supported") - device.set_current() + device = mempool_device - # This should succeed and configure the memory pool release threshold - mr = DeviceMemoryResource(device.device_id) + # This should succeed and configure the memory pool release threshold. + # The resource can be constructed from either a device or device ordinal. + device_arg = device if use_device_object else device.device_id + mr = DeviceMemoryResource(device_arg) # Verify basic properties assert mr.device_id == device.device_id - assert mr.is_device_accessible is True - assert mr.is_host_accessible is False + assert mr.is_device_accessible + assert not mr.is_host_accessible + assert not mr.is_ipc_enabled # Test allocation/deallocation works buffer = mr.allocate(1024) assert buffer.size == 1024 assert buffer.device_id == device.device_id buffer.close() + + +def test_mempool(mempool_device): + device = mempool_device + + # Test basic pool creation + mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE, ipc_enabled=False)) + assert mr.device_id == device.device_id + assert mr.is_device_accessible + assert not mr.is_host_accessible + assert not mr.is_ipc_enabled + + # Test allocation and deallocation + buffer1 = mr.allocate(1024) + assert buffer1.handle != 0 + assert buffer1.size == 1024 + assert buffer1.memory_resource == mr + buffer1.close() + + # Test multiple allocations + buffer1 = mr.allocate(1024) + buffer2 = mr.allocate(2048) + assert buffer1.handle != buffer2.handle + assert buffer1.size == 1024 + assert buffer2.size == 2048 + buffer1.close() + buffer2.close() + + # Test stream-based allocation + stream = device.create_stream() + buffer = mr.allocate(1024, stream=stream) + assert buffer.handle != 0 + buffer.close() + + # Test memory copying between buffers from same pool + src_buffer = mr.allocate(64) + dst_buffer = mr.allocate(64) + stream = device.create_stream() + src_buffer.copy_to(dst_buffer, stream=stream) + device.sync() + dst_buffer.close() + src_buffer.close() + + # Test error cases + # Test IPC operations are disabled + buffer = mr.allocate(64) + ipc_error_msg = "Memory resource is not IPC-enabled" + + with pytest.raises(RuntimeError, match=ipc_error_msg): + mr._get_allocation_handle() + + with pytest.raises(RuntimeError, match=ipc_error_msg): + buffer.export() + + with pytest.raises(RuntimeError, match=ipc_error_msg): + handle = IPCBufferDescriptor._init(b"", 0) + Buffer.import_(mr, handle) + + buffer.close() + + +@pytest.mark.parametrize("ipc_enabled", [True, False]) +@pytest.mark.parametrize( + "property_name,expected_type", + [ + ("reuse_follow_event_dependencies", bool), + ("reuse_allow_opportunistic", bool), + ("reuse_allow_internal_dependencies", bool), + ("release_threshold", int), + ("reserved_mem_current", int), + ("reserved_mem_high", int), + ("used_mem_current", int), + ("used_mem_high", int), + ], +) +def test_mempool_attributes(ipc_enabled, mempool_device, property_name, expected_type): + """Test all properties of the DeviceMemoryResource class.""" + device = mempool_device + if platform.system() == "Windows": + return # IPC not implemented for Windows + + mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE, ipc_enabled=ipc_enabled)) + assert mr.is_ipc_enabled == ipc_enabled + + # Get the property value + value = getattr(mr.attributes, property_name) + + # Test type + assert isinstance(value, expected_type), f"{property_name} should return {expected_type}, got {type(value)}" + + # Test value constraints + if expected_type is int: + assert value >= 0, f"{property_name} should be non-negative" + + # Test memory usage properties with actual allocations + if property_name in ["reserved_mem_current", "used_mem_current"]: + # Allocate some memory and check if values increase + initial_value = value + buffer = None + try: + buffer = mr.allocate(1024) + new_value = getattr(mr.attributes, property_name) + assert new_value >= initial_value, f"{property_name} should increase or stay same after allocation" + finally: + if buffer is not None: + buffer.close() + + # Test high watermark properties + if property_name in ["reserved_mem_high", "used_mem_high"]: + # High watermark should never be less than current + current_prop = property_name.replace("_high", "_current") + current_value = getattr(mr.attributes, current_prop) + assert value >= current_value, f"{property_name} should be >= {current_prop}" + + +def test_mempool_attributes_ownership(mempool_device): + """Ensure the attributes bundle handles references correctly.""" + device = mempool_device + mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE)) + attributes = mr.attributes + old_handle = mr._mempool_handle + mr.close() + del mr + + # After deleting the memory resource, the attributes suite is disconnected. + with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"): + _ = attributes.used_mem_high + + # Even when a new object is created (we found a case where the same + # mempool handle was really reused). + mr = DeviceMemoryResource(device, dict(max_size=POOL_SIZE)) + with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"): + _ = attributes.used_mem_high + + # Even if we stuff the original handle into a new class. + mr._mempool_handle, old_handle = old_handle, mr._mempool_handle + with pytest.raises(RuntimeError, match="DeviceMemoryResource is expired"): + _ = attributes.used_mem_high + mr._mempool_handle = old_handle From fcfeba0cb47a893daf34fde82cfca9fd287f8581 Mon Sep 17 00:00:00 2001 From: Abhilash Majumder Date: Thu, 18 Sep 2025 04:10:13 +0530 Subject: [PATCH 106/113] [NVVM IR] NVVM IR Integration (#907) * nvvm ir integration * add test * remove nvvm error handling from utils * use version dependent nvvm inclusion * fix nvvm compilation flow and test * refactor * fix unwanted rebase * fix core linter errors * refactor tests * refactor * refactor * ruff format * ruff format * revert changes to cuda_utils * new line * fix CI rm list import * use noqa * format * verify and skip 110 * add flags and lto * rename gpu-arch to arch * change libnvvm version check * format * compute 90 * Apply suggestions from code review * update test * use exception manager * format * format ruff * [pre-commit.ci] auto code formatting * add release notes * [pre-commit.ci] auto code formatting * rectify quotes * refix format * refresh * [pre-commit.ci] auto code formatting * user major minor * fix test * fix IR - again * fix nvvm option handling * remove redundant IR & fix linter * avoid extra copy + ensure compiled objcode loadable --------- Co-authored-by: Leo Fang Co-authored-by: Leo Fang Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- cuda_core/cuda/core/experimental/_module.py | 6 +- cuda_core/cuda/core/experimental/_program.py | 166 ++++++++++++- .../_utils/clear_error_support.py | 6 +- cuda_core/docs/source/release/0.X.Y-notes.rst | 1 + cuda_core/tests/test_program.py | 234 +++++++++++++++++- 5 files changed, 396 insertions(+), 17 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_module.py b/cuda_core/cuda/core/experimental/_module.py index c659a8d78..71293be4d 100644 --- a/cuda_core/cuda/core/experimental/_module.py +++ b/cuda_core/cuda/core/experimental/_module.py @@ -11,7 +11,7 @@ from cuda.core.experimental._stream import Stream from cuda.core.experimental._utils.clear_error_support import ( assert_type, - assert_type_str_or_bytes, + assert_type_str_or_bytes_like, raise_code_path_meant_to_be_unreachable, ) from cuda.core.experimental._utils.cuda_utils import driver, get_binding_version, handle_return, precondition @@ -615,14 +615,14 @@ def _lazy_load_module(self, *args, **kwargs): if self._handle is not None: return module = self._module - assert_type_str_or_bytes(module) + assert_type_str_or_bytes_like(module) if isinstance(module, str): if self._backend_version == "new": self._handle = handle_return(self._loader["file"](module.encode(), [], [], 0, [], [], 0)) else: # "old" backend self._handle = handle_return(self._loader["file"](module.encode())) return - if isinstance(module, bytes): + if isinstance(module, (bytes, bytearray)): if self._backend_version == "new": self._handle = handle_return(self._loader["data"](module, [], [], 0, [], [], 0)) else: # "old" backend diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index d8b875bce..dee6f001e 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -5,6 +5,7 @@ from __future__ import annotations import weakref +from contextlib import contextmanager from dataclasses import dataclass from typing import TYPE_CHECKING, Union from warnings import warn @@ -20,6 +21,7 @@ _handle_boolean_option, check_or_create_options, driver, + get_binding_version, handle_return, is_nested_sequence, is_sequence, @@ -27,6 +29,79 @@ ) +@contextmanager +def _nvvm_exception_manager(self): + """ + Taken from _linker.py + """ + try: + yield + except Exception as e: + error_log = "" + if hasattr(self, "_mnff"): + try: + nvvm = _get_nvvm_module() + logsize = nvvm.get_program_log_size(self._mnff.handle) + if logsize > 1: + log = bytearray(logsize) + nvvm.get_program_log(self._mnff.handle, log) + error_log = log.decode("utf-8", errors="backslashreplace") + except Exception: + error_log = "" + # Starting Python 3.11 we could also use Exception.add_note() for the same purpose, but + # unfortunately we are still supporting Python 3.9/3.10... + e.args = (e.args[0] + (f"\nNVVM program log: {error_log}" if error_log else ""), *e.args[1:]) + raise e + + +_nvvm_module = None +_nvvm_import_attempted = False + + +def _get_nvvm_module(): + """ + Handles the import of NVVM module with version and availability checks. + NVVM bindings were added in cuda-bindings 12.9.0, so we need to handle cases where: + 1. cuda.bindings is not new enough (< 12.9.0) + 2. libnvvm is not found in the Python environment + + Returns: + The nvvm module if available and working + + Raises: + RuntimeError: If NVVM is not available due to version or library issues + """ + global _nvvm_module, _nvvm_import_attempted + + if _nvvm_import_attempted: + if _nvvm_module is None: + raise RuntimeError("NVVM module is not available (previous import attempt failed)") + return _nvvm_module + + _nvvm_import_attempted = True + + try: + version = get_binding_version() + if version < (12, 9): + raise RuntimeError( + f"NVVM bindings require cuda-bindings >= 12.9.0, but found {version[0]}.{version[1]}.x. " + "Please update cuda-bindings to use NVVM features." + ) + + from cuda.bindings import nvvm + from cuda.bindings._internal.nvvm import _inspect_function_pointer + + if _inspect_function_pointer("__nvvmCreateProgram") == 0: + raise RuntimeError("NVVM library (libnvvm) is not available in this Python environment. ") + + _nvvm_module = nvvm + return _nvvm_module + + except RuntimeError as e: + _nvvm_module = None + raise e + + def _process_define_macro_inner(formatted_options, macro): if isinstance(macro, str): formatted_options.append(f"--define-macro={macro}") @@ -229,11 +304,10 @@ def __post_init__(self): self._formatted_options = [] if self.arch is not None: - self._formatted_options.append(f"--gpu-architecture={self.arch}") + self._formatted_options.append(f"-arch={self.arch}") else: - self._formatted_options.append( - "--gpu-architecture=sm_" + "".join(f"{i}" for i in Device().compute_capability) - ) + self.arch = f"sm_{Device().arch}" + self._formatted_options.append(f"-arch={self.arch}") if self.relocatable_device_code is not None: self._formatted_options.append( f"--relocatable-device-code={_handle_boolean_option(self.relocatable_device_code)}" @@ -370,28 +444,33 @@ class Program: code : Any String of the CUDA Runtime Compilation program. code_type : Any - String of the code type. Currently ``"ptx"`` and ``"c++"`` are supported. + String of the code type. Currently ``"ptx"``, ``"c++"``, and ``"nvvm"`` are supported. options : ProgramOptions, optional A ProgramOptions object to customize the compilation process. See :obj:`ProgramOptions` for more information. """ class _MembersNeededForFinalize: - __slots__ = "handle" + __slots__ = "handle", "backend" - def __init__(self, program_obj, handle): + def __init__(self, program_obj, handle, backend): self.handle = handle + self.backend = backend weakref.finalize(program_obj, self.close) def close(self): if self.handle is not None: - handle_return(nvrtc.nvrtcDestroyProgram(self.handle)) + if self.backend == "NVRTC": + handle_return(nvrtc.nvrtcDestroyProgram(self.handle)) + elif self.backend == "NVVM": + nvvm = _get_nvvm_module() + nvvm.destroy_program(self.handle) self.handle = None __slots__ = ("__weakref__", "_mnff", "_backend", "_linker", "_options") def __init__(self, code, code_type, options: ProgramOptions = None): - self._mnff = Program._MembersNeededForFinalize(self, None) + self._mnff = Program._MembersNeededForFinalize(self, None, None) self._options = options = check_or_create_options(ProgramOptions, options, "Program options") code_type = code_type.lower() @@ -402,6 +481,7 @@ def __init__(self, code, code_type, options: ProgramOptions = None): # TODO: allow tuples once NVIDIA/cuda-python#72 is resolved self._mnff.handle = handle_return(nvrtc.nvrtcCreateProgram(code.encode(), options._name, 0, [], [])) + self._mnff.backend = "NVRTC" self._backend = "NVRTC" self._linker = None @@ -411,8 +491,22 @@ def __init__(self, code, code_type, options: ProgramOptions = None): ObjectCode._init(code.encode(), code_type), options=self._translate_program_options(options) ) self._backend = self._linker.backend + + elif code_type == "nvvm": + if isinstance(code, str): + code = code.encode("utf-8") + elif not isinstance(code, (bytes, bytearray)): + raise TypeError("NVVM IR code must be provided as str, bytes, or bytearray") + + nvvm = _get_nvvm_module() + self._mnff.handle = nvvm.create_program() + self._mnff.backend = "NVVM" + nvvm.add_module_to_program(self._mnff.handle, code, len(code), options._name.decode()) + self._backend = "NVVM" + self._linker = None + else: - supported_code_types = ("c++", "ptx") + supported_code_types = ("c++", "ptx", "nvvm") assert code_type not in supported_code_types, f"{code_type=}" raise RuntimeError(f"Unsupported {code_type=} ({supported_code_types=})") @@ -433,6 +527,33 @@ def _translate_program_options(self, options: ProgramOptions) -> LinkerOptions: ptxas_options=options.ptxas_options, ) + def _translate_program_options_to_nvvm(self, options: ProgramOptions) -> list[str]: + """Translate ProgramOptions to NVVM-specific compilation options.""" + nvvm_options = [] + + assert options.arch is not None + arch = options.arch + if arch.startswith("sm_"): + arch = f"compute_{arch[3:]}" + nvvm_options.append(f"-arch={arch}") + if options.debug: + nvvm_options.append("-g") + if options.device_code_optimize is False: + nvvm_options.append("-opt=0") + elif options.device_code_optimize is True: + nvvm_options.append("-opt=3") + # NVVM is not consistent with NVRTC, it uses 0/1 instead... + if options.ftz is not None: + nvvm_options.append(f"-ftz={'1' if options.ftz else '0'}") + if options.prec_sqrt is not None: + nvvm_options.append(f"-prec-sqrt={'1' if options.prec_sqrt else '0'}") + if options.prec_div is not None: + nvvm_options.append(f"-prec-div={'1' if options.prec_div else '0'}") + if options.fma is not None: + nvvm_options.append(f"-fma={'1' if options.fma else '0'}") + + return nvvm_options + def close(self): """Destroy this program.""" if self._linker: @@ -513,6 +634,31 @@ def compile(self, target_type, name_expressions=(), logs=None): return ObjectCode._init(data, target_type, symbol_mapping=symbol_mapping, name=self._options.name) + elif self._backend == "NVVM": + if target_type not in ("ptx", "ltoir"): + raise ValueError(f'NVVM backend only supports target_type="ptx", "ltoir", got "{target_type}"') + + nvvm_options = self._translate_program_options_to_nvvm(self._options) + if target_type == "ltoir" and "-gen-lto" not in nvvm_options: + nvvm_options.append("-gen-lto") + nvvm = _get_nvvm_module() + with _nvvm_exception_manager(self): + nvvm.verify_program(self._mnff.handle, len(nvvm_options), nvvm_options) + nvvm.compile_program(self._mnff.handle, len(nvvm_options), nvvm_options) + + size = nvvm.get_compiled_result_size(self._mnff.handle) + data = bytearray(size) + nvvm.get_compiled_result(self._mnff.handle, data) + + if logs is not None: + logsize = nvvm.get_program_log_size(self._mnff.handle) + if logsize > 1: + log = bytearray(logsize) + nvvm.get_program_log(self._mnff.handle, log) + logs.write(log.decode("utf-8", errors="backslashreplace")) + + return ObjectCode._init(data, target_type, name=self._options.name) + supported_backends = ("nvJitLink", "driver") if self._backend not in supported_backends: raise ValueError(f'Unsupported backend="{self._backend}" ({supported_backends=})') diff --git a/cuda_core/cuda/core/experimental/_utils/clear_error_support.py b/cuda_core/cuda/core/experimental/_utils/clear_error_support.py index b13a3d6b0..0410e7aa2 100644 --- a/cuda_core/cuda/core/experimental/_utils/clear_error_support.py +++ b/cuda_core/cuda/core/experimental/_utils/clear_error_support.py @@ -9,10 +9,10 @@ def assert_type(obj, expected_type): raise TypeError(f"Expected type {expected_type.__name__}, but got {type(obj).__name__}") -def assert_type_str_or_bytes(obj): +def assert_type_str_or_bytes_like(obj): """Ensure obj is of type str or bytes, else raise AssertionError with a clear message.""" - if not isinstance(obj, (str, bytes)): - raise TypeError(f"Expected type str or bytes, but got {type(obj).__name__}") + if not isinstance(obj, (str, bytes, bytearray)): + raise TypeError(f"Expected type str or bytes or bytearray, but got {type(obj).__name__}") def raise_code_path_meant_to_be_unreachable(): diff --git a/cuda_core/docs/source/release/0.X.Y-notes.rst b/cuda_core/docs/source/release/0.X.Y-notes.rst index 8d639c177..55ef4a241 100644 --- a/cuda_core/docs/source/release/0.X.Y-notes.rst +++ b/cuda_core/docs/source/release/0.X.Y-notes.rst @@ -29,6 +29,7 @@ New features - Added :attr:`Device.arch` property that returns the compute capability as a string (e.g., '75' for CC 7.5), providing a convenient alternative to manually concatenating the compute capability tuple. - CUDA 13.x testing support through new ``test-cu13`` dependency group. - Stream-ordered memory allocation can now be shared on Linux via :class:`DeviceMemoryResource`. +- Added NVVM IR support to :class:`Program`. NVVM IR is now understood with ``code_type="nvvm"``. New examples diff --git a/cuda_core/tests/test_program.py b/cuda_core/tests/test_program.py index e5c873f1f..d30b845c2 100644 --- a/cuda_core/tests/test_program.py +++ b/cuda_core/tests/test_program.py @@ -9,10 +9,160 @@ from cuda.core.experimental import _linker from cuda.core.experimental._module import Kernel, ObjectCode from cuda.core.experimental._program import Program, ProgramOptions +from cuda.core.experimental._utils.cuda_utils import driver, handle_return +cuda_driver_version = handle_return(driver.cuDriverGetVersion()) is_culink_backend = _linker._decide_nvjitlink_or_driver() +def _is_nvvm_available(): + """Check if NVVM is available.""" + try: + from cuda.core.experimental._program import _get_nvvm_module + + _get_nvvm_module() + return True + except RuntimeError: + return False + + +nvvm_available = pytest.mark.skipif( + not _is_nvvm_available(), reason="NVVM not available (libNVVM not found or cuda-bindings < 12.9.0)" +) + +try: + from cuda.core.experimental._utils.cuda_utils import driver, handle_return + + _cuda_driver_version = handle_return(driver.cuDriverGetVersion()) +except Exception: + _cuda_driver_version = 0 + +_libnvvm_version = None +_libnvvm_version_attempted = False + +precheck_nvvm_ir = """target triple = "nvptx64-unknown-cuda" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" + +define void @dummy_kernel() {{ + entry: + ret void +}} + +!nvvm.annotations = !{{!0}} +!0 = !{{void ()* @dummy_kernel, !"kernel", i32 1}} + +!nvvmir.version = !{{!1}} +!1 = !{{i32 {major}, i32 {minor}, i32 {debug_major}, i32 {debug_minor}}} +""" # noqa: E501 + + +def _get_libnvvm_version_for_tests(): + """ + Detect libNVVM version by compiling dummy IR and analyzing the PTX output. + + Workaround for the lack of direct libNVVM version API (nvbugs 5312315). + The approach: + - Compile a small dummy NVVM IR to PTX + - Use PTX version analysis APIs if available to infer libNVVM version + - Cache the result for future use + """ + global _libnvvm_version, _libnvvm_version_attempted + + if _libnvvm_version_attempted: + return _libnvvm_version + + _libnvvm_version_attempted = True + + try: + from cuda.core.experimental._program import _get_nvvm_module + + nvvm = _get_nvvm_module() + + try: + from cuda.bindings.utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver + except ImportError: + _libnvvm_version = None + return _libnvvm_version + + program = nvvm.create_program() + try: + major, minor, debug_major, debug_minor = nvvm.ir_version() + global precheck_nvvm_ir + precheck_nvvm_ir = precheck_nvvm_ir.format( + major=major, minor=minor, debug_major=debug_major, debug_minor=debug_minor + ) + precheck_ir_bytes = precheck_nvvm_ir.encode("utf-8") + nvvm.add_module_to_program(program, precheck_ir_bytes, len(precheck_ir_bytes), "precheck.ll") + + options = ["-arch=compute_90"] + nvvm.verify_program(program, len(options), options) + nvvm.compile_program(program, len(options), options) + + ptx_size = nvvm.get_compiled_result_size(program) + ptx_data = bytearray(ptx_size) + nvvm.get_compiled_result(program, ptx_data) + ptx_str = ptx_data.decode("utf-8") + ptx_version = get_ptx_ver(ptx_str) + cuda_version = get_minimal_required_cuda_ver_from_ptx_ver(ptx_version) + _libnvvm_version = cuda_version + return _libnvvm_version + finally: + nvvm.destroy_program(program) + + except Exception: + _libnvvm_version = None + return _libnvvm_version + + +@pytest.fixture(scope="session") +def nvvm_ir(): + """Generate working NVVM IR with proper version metadata. + The try clause here is used for older nvvm modules which + might not have an ir_version() method. In which case the + fallback assumes no version metadata will be present in + the input nvvm ir + """ + from cuda.core.experimental._program import _get_nvvm_module + + nvvm = _get_nvvm_module() + major, minor, debug_major, debug_minor = nvvm.ir_version() + + nvvm_ir_template = """target triple = "nvptx64-unknown-cuda" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" + +define i32 @ave(i32 %a, i32 %b) {{ +entry: + %add = add nsw i32 %a, %b + %div = sdiv i32 %add, 2 + ret i32 %div +}} + +define void @simple(i32* %data) {{ +entry: + %0 = call i32 @llvm.nvvm.read.ptx.sreg.ctaid.x() + %1 = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() + %mul = mul i32 %0, %1 + %2 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() + %add = add i32 %mul, %2 + %call = call i32 @ave(i32 %add, i32 %add) + %idxprom = sext i32 %add to i64 + store i32 %call, i32* %data, align 4 + ret void +}} + +declare i32 @llvm.nvvm.read.ptx.sreg.ctaid.x() nounwind readnone +declare i32 @llvm.nvvm.read.ptx.sreg.ntid.x() nounwind readnone +declare i32 @llvm.nvvm.read.ptx.sreg.tid.x() nounwind readnone + +!nvvm.annotations = !{{!0}} +!0 = !{{void (i32*)* @simple, !"kernel", i32 1}} + +!nvvmir.version = !{{!1}} +!1 = !{{i32 {major}, i32 {minor}, i32 {debug_major}, i32 {debug_minor}}} +""" # noqa: E501 + return nvvm_ir_template.format(major=major, minor=minor, debug_major=debug_major, debug_minor=debug_minor) + + @pytest.fixture(scope="module") def ptx_code_object(): code = 'extern "C" __global__ void my_kernel() {}' @@ -92,7 +242,7 @@ def test_program_init_valid_code_type(): def test_program_init_invalid_code_type(): code = "goto 100" with pytest.raises( - RuntimeError, match=r"^Unsupported code_type='fortran' \(supported_code_types=\('c\+\+', 'ptx'\)\)$" + RuntimeError, match=r"^Unsupported code_type='fortran' \(supported_code_types=\('c\+\+', 'ptx', 'nvvm'\)\)$" ): Program(code, "FORTRAN") @@ -150,3 +300,85 @@ def test_program_close(): program = Program(code, "c++") program.close() assert program.handle is None + + +@nvvm_available +def test_nvvm_deferred_import(): + """Test that our deferred NVVM import works correctly""" + from cuda.core.experimental._program import _get_nvvm_module + + nvvm = _get_nvvm_module() + assert nvvm is not None + + +@nvvm_available +def test_nvvm_program_creation_compilation(nvvm_ir): + """Test basic NVVM program creation""" + program = Program(nvvm_ir, "nvvm") + assert program.backend == "NVVM" + assert program.handle is not None + obj = program.compile("ptx") + ker = obj.get_kernel("simple") # noqa: F841 + program.close() + + +@nvvm_available +def test_nvvm_compile_invalid_target(nvvm_ir): + """Test that NVVM programs reject invalid compilation targets""" + program = Program(nvvm_ir, "nvvm") + with pytest.raises(ValueError, match='NVVM backend only supports target_type="ptx"'): + program.compile("cubin") + program.close() + + +@nvvm_available +@pytest.mark.parametrize( + "options", + [ + ProgramOptions(name="test1", arch="sm_90", device_code_optimize=False), + ProgramOptions(name="test2", arch="sm_100", device_code_optimize=False), + pytest.param( + ProgramOptions(name="test_sm110_1", arch="sm_110", device_code_optimize=False), + marks=pytest.mark.skipif( + (_get_libnvvm_version_for_tests() or 0) < 13000, + reason="Compute capability 110 requires libNVVM >= 13.0", + ), + ), + pytest.param( + ProgramOptions( + name="test_sm110_2", + arch="sm_110", + ftz=True, + prec_sqrt=False, + prec_div=False, + fma=True, + device_code_optimize=True, + ), + marks=pytest.mark.skipif( + (_get_libnvvm_version_for_tests() or 0) < 13000, + reason="Compute capability 110 requires libNVVM >= 13.0", + ), + ), + pytest.param( + ProgramOptions(name="test_sm110_3", arch="sm_110", link_time_optimization=True), + marks=pytest.mark.skipif( + (_get_libnvvm_version_for_tests() or 0) < 13000, + reason="Compute capability 110 requires libNVVM >= 13.0", + ), + ), + ], +) +def test_nvvm_program_options(init_cuda, nvvm_ir, options): + """Test NVVM programs with different options""" + program = Program(nvvm_ir, "nvvm", options) + assert program.backend == "NVVM" + + ptx_code = program.compile("ptx") + assert isinstance(ptx_code, ObjectCode) + assert ptx_code.name == options.name + + code_content = ptx_code.code + ptx_text = code_content.decode() if isinstance(code_content, bytes) else str(code_content) + assert ".visible .entry simple(" in ptx_text + + program.close() From d8b4acc1838845d08eaa3f7248246af5244617a8 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 17 Sep 2025 18:40:20 -0400 Subject: [PATCH 107/113] Fix #789: Remove self-cycle in cuda.bindings.driver (#976) --- cuda_bindings/cuda/bindings/_lib/utils.pxi.in | 17 ++++++++--------- cuda_bindings/cuda/bindings/driver.pyx.in | 1 + cuda_bindings/cuda/bindings/nvrtc.pyx.in | 2 ++ cuda_bindings/cuda/bindings/runtime.pyx.in | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in index c2a8b9a9a..e0ec56604 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in @@ -9,7 +9,6 @@ from libc.string cimport memcpy from enum import Enum as _Enum import ctypes as _ctypes cimport cuda.bindings.cydriver as cydriver -import cuda.bindings.driver as _driver cimport cuda.bindings._lib.param_packer as param_packer cdef void* _callocWrapper(length, size): @@ -135,7 +134,7 @@ cdef class _HelperInputVoidPtr: elif isinstance(ptr, (int)): # Easy run, user gave us an already configured void** address self._cptr = ptr - elif isinstance(ptr, (_driver.CUdeviceptr)): + elif isinstance(ptr, (_driver["CUdeviceptr"])): self._cptr = int(ptr) elif PyObject_CheckBuffer(ptr): # Easy run, get address from Python Buffer Protocol @@ -172,7 +171,7 @@ cdef class _HelperCUmemPool_attribute: {{if 'CU_MEMPOOL_ATTR_USED_MEM_CURRENT'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT,{{endif}} {{if 'CU_MEMPOOL_ATTR_USED_MEM_HIGH'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = _driver.cuuint64_t() + self._cuuint64_t_val = _driver["cuuint64_t"]() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -243,7 +242,7 @@ cdef class _HelperCUpointer_attribute: self._attr = attr.value if self._attr in ({{if 'CU_POINTER_ATTRIBUTE_CONTEXT'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,{{endif}}): if self._is_getter: - self._ctx = _driver.CUcontext() + self._ctx = _driver["CUcontext"]() self._cptr = self._ctx.getPtr() else: self._cptr = init_value.getPtr() @@ -257,7 +256,7 @@ cdef class _HelperCUpointer_attribute: elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_DEVICE_POINTER'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER,{{endif}} {{if 'CU_POINTER_ATTRIBUTE_RANGE_START_ADDR'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,{{endif}}): if self._is_getter: - self._devptr = _driver.CUdeviceptr() + self._devptr = _driver["CUdeviceptr"]() self._cptr = self._devptr.getPtr() else: self._cptr = init_value.getPtr() @@ -266,7 +265,7 @@ cdef class _HelperCUpointer_attribute: self._cptr = &self._void elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_P2P_TOKENS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,{{endif}}): if self._is_getter: - self._token = _driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS() + self._token = _driver["CUDA_POINTER_ATTRIBUTE_P2P_TOKENS"]() self._cptr = self._token.getPtr() else: self._cptr = init_value.getPtr() @@ -284,7 +283,7 @@ cdef class _HelperCUpointer_attribute: self._cptr = &self._size elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,{{endif}}): if self._is_getter: - self._mempool = _driver.CUmemoryPool() + self._mempool = _driver["CUmemoryPool"]() self._cptr = self._mempool.getPtr() else: self._cptr = init_value.getPtr() @@ -340,7 +339,7 @@ cdef class _HelperCUgraphMem_attribute: {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT,{{endif}} {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = _driver.cuuint64_t() + self._cuuint64_t_val = _driver["cuuint64_t"]() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -553,7 +552,7 @@ cdef class _HelperCUmemAllocationHandleType: {{endif}} {{if 'CU_MEM_HANDLE_TYPE_FABRIC' in found_values}} elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): - self._mem_fabric_handle = _driver.CUmemFabricHandle() + self._mem_fabric_handle = _driver["CUmemFabricHandle"]() self._cptr = self._mem_fabric_handle.getPtr() {{endif}} else: diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 4850d1a4a..22e33d759 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -17,6 +17,7 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +_driver = globals() include "_lib/utils.pxi" ctypedef unsigned long long signed_char_ptr diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index 5cac5a438..5cb8dadf5 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -15,6 +15,8 @@ from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ include "_lib/utils.pxi" ctypedef unsigned long long signed_char_ptr diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index fa9eea7e5..ae98d9792 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -17,6 +17,8 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ include "_lib/utils.pxi" ctypedef unsigned long long signed_char_ptr From 95ffffe0c5a9a5b43008764cd7212931e61bb66a Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 18 Sep 2025 17:37:55 -0700 Subject: [PATCH 108/113] Remove llvmlite from `test` dependencies in cuda_bindings/pyproject.toml (#988) --- cuda_bindings/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 36fa778d1..459050038 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -42,7 +42,6 @@ test = [ "numpy>=1.21.1", "pytest>=6.2.4", "pytest-benchmark>=3.4.1", - "llvmlite" ] [project.urls] From a3f3706bae5aba303bf773c31c498b6597029f5d Mon Sep 17 00:00:00 2001 From: Mark Mason Date: Fri, 19 Sep 2025 07:47:32 -0700 Subject: [PATCH 109/113] Replace is not None checks for linker flags with booleans (#989) The earlier code would check for requested linker flags using "is not None" instead of True/False. This can result in unwanted flags being passed to the linker in some instances. This change replaces the "is not None" check with simple boolean checks where appropriate. Co-authored-by: Leo Fang --- cuda_core/cuda/core/experimental/_linker.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cuda_core/cuda/core/experimental/_linker.py b/cuda_core/cuda/core/experimental/_linker.py index 2c35efd1b..cef778c9a 100644 --- a/cuda_core/cuda/core/experimental/_linker.py +++ b/cuda_core/cuda/core/experimental/_linker.py @@ -203,17 +203,17 @@ def _init_nvjitlink(self): self.formatted_options.append(f"-maxrregcount={self.max_register_count}") if self.time is not None: self.formatted_options.append("-time") - if self.verbose is not None: + if self.verbose: self.formatted_options.append("-verbose") - if self.link_time_optimization is not None and self.link_time_optimization: + if self.link_time_optimization: self.formatted_options.append("-lto") - if self.ptx is not None: + if self.ptx: self.formatted_options.append("-ptx") if self.optimization_level is not None: self.formatted_options.append(f"-O{self.optimization_level}") - if self.debug is not None and self.debug: + if self.debug: self.formatted_options.append("-g") - if self.lineinfo is not None and self.lineinfo: + if self.lineinfo: self.formatted_options.append("-lineinfo") if self.ftz is not None: self.formatted_options.append(f"-ftz={'true' if self.ftz else 'false'}") @@ -273,21 +273,21 @@ def _init_driver(self): self.option_keys.append(_driver.CUjit_option.CU_JIT_MAX_REGISTERS) if self.time is not None: raise ValueError("time option is not supported by the driver API") - if self.verbose is not None: + if self.verbose: self.formatted_options.append(1) self.option_keys.append(_driver.CUjit_option.CU_JIT_LOG_VERBOSE) - if self.link_time_optimization is not None: + if self.link_time_optimization: self.formatted_options.append(1) self.option_keys.append(_driver.CUjit_option.CU_JIT_LTO) - if self.ptx is not None: + if self.ptx: raise ValueError("ptx option is not supported by the driver API") if self.optimization_level is not None: self.formatted_options.append(self.optimization_level) self.option_keys.append(_driver.CUjit_option.CU_JIT_OPTIMIZATION_LEVEL) - if self.debug is not None: + if self.debug: self.formatted_options.append(1) self.option_keys.append(_driver.CUjit_option.CU_JIT_GENERATE_DEBUG_INFO) - if self.lineinfo is not None: + if self.lineinfo: self.formatted_options.append(1) self.option_keys.append(_driver.CUjit_option.CU_JIT_GENERATE_LINE_INFO) if self.ftz is not None: From c4f4ffe83d246eafb6adf1574e5a7c86bbcef944 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 19 Sep 2025 14:52:50 -0400 Subject: [PATCH 110/113] ci: python 3.13 free threading builds (#986) * ci: build free-threaded wheels * build(deps): bump cython lower bound * ci: enable freethreading for 3.13 in cibuildwheel * ci: bump cython lower bound in cuda_core * ci: skip tests that require llvmlite because it does not ship a free-threading build wheel * ci: remove filtering out of cuda-bindings artifacts * ci: remove redundant environment variable setting * ci: fix syntax errors in ci/test-matrix.json * ci: add optional dependency group to avoid installation of cupy when testing the FT builds * ci: remove 12.9.x from builds for now --- .github/workflows/build-wheel.yml | 7 +++++++ ci/test-matrix.json | 17 ++++++++++++++--- ci/tools/run-tests | 10 ++++++++-- cuda_bindings/pyproject.toml | 4 ++-- cuda_core/pyproject.toml | 10 ++++++++-- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d015c49fa..b2be4af40 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -30,6 +30,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.13t" name: py${{ matrix.python-version }} runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || @@ -116,6 +117,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" CIBW_ENVIRONMENT: > CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CIBW_ENABLE: "cpython-freethreading" with: package-dir: ./cuda_core/ output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} @@ -163,6 +165,7 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" + CIBW_ENABLE: "cpython-freethreading" with: package-dir: ./cuda_bindings/ output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} @@ -223,6 +226,10 @@ jobs: # workaround for actions/runner-images#12377 (the cached 3.13.4 is buggy on Windows) python-version: ${{ matrix.python-version == '3.13' && '3.13.5' || matrix.python-version }} + - name: verify free-threaded build + if: endsWith(matrix.python-verison, 't') + run: python -c 'import sys; assert not sys._is_gil_enabled()' + - name: Set up Python include paths run: | if [[ "${{ inputs.host-platform }}" == linux* ]]; then diff --git a/ci/test-matrix.json b/ci/test-matrix.json index 9311df909..0d6fdb7e7 100644 --- a/ci/test-matrix.json +++ b/ci/test-matrix.json @@ -14,6 +14,7 @@ { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, @@ -23,7 +24,8 @@ { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } ], "nightly": [ { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, @@ -51,6 +53,11 @@ { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, @@ -88,13 +95,17 @@ { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } ], "nightly": [ { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } ] } } diff --git a/ci/tools/run-tests b/ci/tools/run-tests index 22d6bd07c..868659097 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -77,12 +77,18 @@ elif [[ "${test_module}" == "core" ]]; then echo "Installing core wheel" pwd ls + + FREE_THREADING="" + if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then + FREE_THREADING+="-ft" + fi + if [[ "${LOCAL_CTK}" == 1 ]]; then # We already installed cuda-bindings, and all CTK components exist locally, # so just install the test dependencies. - pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}"] + pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"] else - pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"] + pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"] fi popd pushd ./cuda_core diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 459050038..b7dbd7a66 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE [build-system] -requires = ["setuptools>=77.0.0", "cython>=3.0,<3.1.0", "pyclibrary>=0.1.7"] +requires = ["setuptools>=77.0.0", "cython>=3.1,<3.2", "pyclibrary>=0.1.7"] build-backend = "setuptools.build_meta" [project] @@ -37,7 +37,7 @@ all = [ ] test = [ - "cython>=3.0,<3.1.0", + "cython>=3.1,<3.2", "setuptools>=77.0.0", "numpy>=1.21.1", "pytest>=6.2.4", diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 360939661..690a49a05 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 [build-system] -requires = ["setuptools>=77.0.0", "Cython>=3.0"] +requires = ["setuptools>=77.0.0", "Cython>=3.1"] build-backend = "setuptools.build_meta" @@ -49,10 +49,16 @@ dependencies = [ cu11 = ["cuda-bindings[all]==11.8.*"] cu12 = ["cuda-bindings[all]==12.*"] cu13 = ["cuda-bindings[all]==13.*"] -test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"] +# TODO: these should all be in development dependencies; optional dependencies +# are for features exposed to *users*, not a dumping ground for all tooling +# needed to build and test the project +test = ["cython>=3.1", "setuptools", "pytest>=6.2.4"] test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "cuda-toolkit[cudart]==11.*"] # runtime headers needed by CuPy test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy test-cu13 = ["cuda-core[test]", "cupy-cuda13x", "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-cu13-ft = ["cuda-core[test]", "cuda-toolkit[cudart]==13.*"] [project.urls] homepage = "https://nvidia.github.io/cuda-python/" From ac724d07d650ceaf7927331a5449dd19584046cc Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 19 Sep 2025 17:15:29 -0400 Subject: [PATCH 111/113] style: clean up some whitespace from generated code (#997) --- cuda_bindings/cuda/bindings/cyruntime.pyx.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in index 950e106c5..df85a806c 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -1894,7 +1894,6 @@ cimport cuda.bindings._lib.dlfcn as dlfcn {{endif}} cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: - # Load with gil: loaded_dl = load_nvidia_dynamic_lib("cudart") @@ -1920,7 +1919,7 @@ cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCa # Unload {{if 'Windows' == platform.system()}} - windll.FreeLibrary(handle) + windll.FreeLibrary(handle) {{else}} dlfcn.dlclose(handle) {{endif}} From 5876145afccff5c417a894482e7293a8faddde36 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 19 Sep 2025 15:43:06 -0700 Subject: [PATCH 112/113] Fail if no "INFO test_" lines are found in pathfinder test output (#979) * Fail if no "INFO test_" lines are found in pathfinder test output * Number of "INFO test_" lines: 48 --- ci/tools/run-tests | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/tools/run-tests b/ci/tools/run-tests index 868659097..8992dfced 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -35,7 +35,10 @@ if [[ "${test_module}" == "pathfinder" ]]; then "LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \ "FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS}" pwd - pytest -ra -s -v tests/ + pytest -ra -s -v tests/ |& tee /tmp/pathfinder_test_log.txt + # Fail if no "INFO test_" lines are found; capture line count otherwise + line_count=$(grep '^INFO test_' /tmp/pathfinder_test_log.txt | wc -l) + echo "Number of \"INFO test_\" lines: $line_count" popd elif [[ "${test_module}" == "bindings" ]]; then pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}" From d03e8c0e50389baec5ea41bb6200328b56b01a75 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 22 Sep 2025 07:37:19 -0700 Subject: [PATCH 113/113] Fix cuda_pathfinder/docs/source/release/1.2.3-notes.rst (#1002) --- cuda_pathfinder/docs/source/release/1.2.3-notes.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cuda_pathfinder/docs/source/release/1.2.3-notes.rst b/cuda_pathfinder/docs/source/release/1.2.3-notes.rst index 93128b234..3fa08bd19 100644 --- a/cuda_pathfinder/docs/source/release/1.2.3-notes.rst +++ b/cuda_pathfinder/docs/source/release/1.2.3-notes.rst @@ -12,6 +12,7 @@ Released on Sep 17, 2025 Highlights ---------- -* Extend experimental ``cuda.pathfinder._find_nvidia_headers`` API - to support CTK library headers +* Make the ``cuda.pathfinder._find_nvidia_header_directory`` API public + (by removing the leading underscore) and extend the function + to also support CTK library headers (`PR #956 `_)